Hello fellow roboticians,

I'm trying to make a simple state machine using a ruby script in ROCK, as a test I made a component that runs some internal process and then calls state(STOPPED) internally in the updateHook() method. When viewing the component with rock-display the state is properly transitioning from RUNNING to STOPPED.

In the ruby script I am continuously polling the state of the component with component.state == :STOPPED, once this returns true I wait for 5 seconds and then call component.start to start it again. The issue is that I get the following error:

/home/computer/dev/tools/orocos.rb/lib/orocos/task_context.rb:93:in `do_start': failed to start the '/
component' task of type component::Task. Tasks must be in STOPPED state before calling start, but was in RUNNING (Orocos::StateTransitionFailed)
    from /home/
computer/dev/tools/orocos.rb/lib/orocos/task_context.rb:93:in `block in start'
    from /home/
computer/dev/tools/orocos.rb/lib/orocos/corba.rb:116:in `refine_exceptions'
    from /home/
computer/dev/tools/orocos.rb/lib/orocos/task_context.rb:91:in `start'
    from
script.rb:57:in `block in <main>'
    from /home/
computer/dev/tools/orocos.rb/lib/orocos/process.rb:695:in `block in run'
    from /home/
computer/dev/tools/orocos.rb/lib/orocos/process.rb:1098:in `guard'
    from /home/
computer/dev/tools/orocos.rb/lib/orocos/process.rb:694:in `run'
    from script.rb:12:in `<main>'


This is strange as, like I mentioned, rock-display reports that the component is in the STOPPED state.

If I call component.stop, right after having checked that
component.state == :STOPPED returns true, the script works properly. I would like to avoid that since it adds redundancy. It seems state(STOPPED) is not properly recognized from the ruby side, or I am not doing it properly. In any case I have not found any documentation or examples on how to do it this way, the only documentation I found was the task states which describe what I did: http://rock-robotics.org/stable/documentation/orogen/task_states.html

Is this a bug or am I doing it wrong?

I saw that with Roby it's possible to do state machine stuff, but it looks way too complicated for such a trivial task.

Thank you for your time,

Karl Kangur

This message and any attachments are intended for the use of the addressee or addressees only.
The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its
content is not permitted.
If you received this message in error, please notify the sender and delete it from your system.
Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.

_______________________________________________
Rock-dev mailing list
Rock-dev@dfki.de
http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev

Reply via email to