Re: Trajectory generation (Problem)

"H.S. Randhawa" <[email protected]> Thu, 4 May 2006 18:28:44 +0530
Newsgroups gmane.science.robotics.orocos.user
Message-ID <[email protected]>
I already gone through statemachine manual. I defined a PAUSE state and want
that when state machine enters this PAUSE state it will write the joint
position values to serial port. Unable to  do that.
I defined the statemachine as

StateMachine TrackMachine
{
    var bool startPushed = false

    final state FINI {}

    initial state INIT {
        transitions {
            select RUN
        }
    }
//////////////////////STATE RUN/////////////////////////// /////
    state RUN {

    entry {
        var bool result = false

        // Homing position... We can also set this in another state.
        const frame home_f = frame( vector(0.4, 0.3, 1.1), rotation(0.0,0.0,
0.0) )

        do cout.display ("INIT State Entry Point")

        // The order is important :
        do Kernel.selectComponent( "CartesianSensor" )
        do Kernel.selectComponent( "CartesianEstimator" )
        do Kernel.selectComponent( "CartesianGenerator" )
        set result = Kernel.isSelected( "CartesianGenerator" )
        do Kernel.selectComponent( "CartesianController" )
        do Kernel.selectComponent( "CartesianEffector" )

        do CartesianGenerator.setHomeFrame( home_f )

        do cout.display ("INIT State Entered")

    }

    handle {
        do cout.display ("INIT State")
    }

    exit {
    }

    transitions {
        // Switch to next state if pause pressed.

        if Kernel.isSelected("Generator") then
            select Error
        if result == false then
            select Error
        //if startPushed == false then
            select START

    }
    }

//////////////////// STATE PAUSE////////////////////////////////////
   state PAUSE {
    entry {
        var bool progpause = false
        do cout.display("Program is paused for and waiting for start()")
              }
    exit {
        do Execution.startProgram( "HRS" )
        do cout.display ("Started Program Again...")
    }
    transitions {
            select START
    }
    }


///////////////////////// STATE
START////////////////////////////////////////////
    state START {

    entry {
        do Execution.startProgram( "HRS1" )
        do cout.display ("Started Program...")
    }


    exit {
        do cout.display ("Stopping Program...")
        do Execution.stopProgram("HRS1")

    }
    transitions {
        //select PAUSE

    }
    }


    ////////////////////// Error Trap///////////////////////////////
    state Error {
    entry {
        do cout.display("Entered Error State !")
    }

    handle {
    }

    exit {}
    }

}

// Instantiate TrackMachine with name testmachine
RootMachine TrackMachine testmachine

Thanx for your valuable time

_______________________________________________
Orocos mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos