Splitting StateMachine definition in multiple files

Hi Falks,

The app I am developing is fully dependent on StateMachine
implementation: my root state machine controls the autonomous mission of
my robot, executing sub state machines depending on my robot's state.

The pb I encounters is that I have to define all my state machines (root
and subs) on the same osd file, while it would be really great for me to
define sub machines in independent files (usefull for unit testing and
of course reusability).

As anyone an idea on how to do that we the current 1.10 Orocos scripting
service?

Could this feature be added to the next (2.0) release?

Thanks,

Charles.

Splitting StateMachine definition in multiple files

On Wed, Mar 3, 2010 at 10:34, Charles Lesire-Cabaniols
<Charles [dot] Lesire [..] ...> wrote:
> Hi Falks,
>
> The app I am developing is fully dependent on StateMachine
> implementation: my root state machine controls the autonomous mission of
> my robot, executing sub state machines depending on my robot's state.
>
> The pb I encounters is that I have to define all my state machines (root
> and subs) on the same osd file, while it would be really great for me to
> define sub machines in independent files (usefull for unit testing and
> of course reusability).
>
> As anyone an idea on how to do that we the current 1.10 Orocos scripting
> service?
>
> Could this feature be added to the next (2.0) release?

We actually had this discussion when implementing the state machines.
The idea back then was that if you needed a definition of another
state machine, you should be able to #include it and use the cpp
preprocessor to do the work for you. Since keeping every state machine
definition into memory is eventually a waste of resources (gcc doesn't
do this either), we sticked to this.

The current architecture for parsing scripts is to create a parser on
the stack and thus clean up everything when parsing is done. We'd need
to create a component local repository to keep track of definitions
before we could implement what you propose. Not a big patch, but I'm
not 100% convinced either.

Maybe we should build-in the support of calling a preprocessor ?

Peter