[Bug 552] New: Deployed components do not auto-start state machines

For more infomation about this bug, visit
Summary: Deployed components do not auto-start state machines
Product: OCL
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Deployment
AssignedTo: orocos-dev [..] ...
ReportedBy: kiwi [dot] net [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Any state machine scripts loaded for a component aren't auto-started. They have
to be manually started in code. Would like to have auto-starting scripts, and
if others agree, then it begs the questions
# Should the component's "AutoStart" also start any/all loaded scripts? (I
suspect no is the answer here, allowing certain scripts to be auto-started with
the below options)
# Should each "StateMachineScript" entry have an associated "AutoStart" value?
(Yes?)
# How and where should the XML file indicate whether to start a script in
reactive or automatic mode?
# If a script fails to start, what should an auto-started component do?

Thoughts?
S

Ruben Smits's picture

[Bug 552] Deployed components do not auto-start state machines

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=552

Ruben Smits <ruben [dot] smits [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #428 is|0 |1
obsolete| |
Attachment #428 is|1 |0
patch| |

--- Comment #3 from Ruben Smits <ruben [dot] smits [..] ...> 2009-05-22 23:53:35 ---
(From update of attachment 428)
wrong bug :(

Ruben Smits's picture

[Bug 552] Deployed components do not auto-start state machines

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=552

--- Comment #2 from Ruben Smits <ruben [dot] smits [..] ...> 2009-05-22 23:52:55 ---
Created an attachment (id=428)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=428)
adds path option to the deployer

[Bug 552] Deployed components do not auto-start state machines

For more infomation about this bug, visit

Peter Soetens
<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
CC| |peter [dot] soetens [..] ...

--- Comment #1 from Peter Soetens
<peter [dot] soetens [..] ...> 2008-05-16 23:19:42 ---
(In reply to comment #0)
> Any state machine scripts loaded for a component aren't auto-started. They have
> to be manually started in code. Would like to have auto-starting scripts, and
> if others agree, then it begs the questions
> # Should the component's "AutoStart" also start any/all loaded scripts? (I
> suspect no is the answer here, allowing certain scripts to be auto-started with
> the below options)
> # Should each "StateMachineScript" entry have an associated "AutoStart" value?
> (Yes?)
> # How and where should the XML file indicate whether to start a script in
> reactive or automatic mode?
> # If a script fails to start, what should an auto-started component do?
>
> Thoughts?

The current solution is to add the following code in your startHook():

if ( this->engine()->programs()->getStateMachine("ToBeStarted") )
this->engine()->programs()->getStateMachine("ToBeStarted")->activate()
&& this->engine()->programs()->getStateMachine("ToBeStarted")->start();

and similar code in your stopHook. In order to make sure that activate() is
'atomic' and start() is immediately allowed: don't put commands in your entry
{} hook.

We have a big application where the above construct is very common.