StateMachine, transition is not executed

Dear Developers,

I have a problem with the execution of the MachineState,

the result to execute this test.ops file is that "...SETUP" print appear, but nothin more is succes.

my code simple code to test is:

... <some code to initialize and load component myDriver > ...

StateMachine TestDriver {

  initial state SETUP
  {
    var bool isCfgOk = false
   
      entry
      {
          isCfgOk = ( myDriver.configure() == false )            
          print.ln(".......................... SETUP")
      }
      
      transitions    {
          if (isCfgOk==false) then select FAILURE;          
        if (isCfgOk==true) then    select RUNNING;         
    }
  }
  
  state RUNNING
  {
      entry
      {
    print.ln(".......................... RUNNING")        
          myDriver.start()
      }
  }
  
  state FAILURE
  {
      entry
      {
          print.ln("........................... Configuration Components failure. ¡¡¡¡")
      }
      
      transition if (true) then select SHUTDOWN
  }
  
  final state SHUTDOWN
  {
      entry
      {
          print.ln(".......................... SHUTDOWN")
          myDriver.stop()
         myDriver.cleanup()
      }
  }
}

RootMachine TestDriver deployApp;

// --------------------------------- execute MachineState deployApp.activate(); deployApp.start();

¿?¿?¿ Any ideas¿?¿?¿

StateMachine, transition is not executed

On Wednesday 21 September 2011 10:28:09 antonio [dot] castellon [..] ... wrote:
> Dear Developers,
>
> I have a problem with the execution of the MachineState,
>
> the result to execute this test.ops file is that "...SETUP" print appear,
> but nothin more is succes.

The most likely reason here is that the component which is executing this SM
is not being periodic. Recent Orocos versions warn for this when you load
it...

You could test this with checking 'comp.getPeriod()' or do
'comp.setPeriod(0.1)'

>
> my code simple code to test is:
>
> ...
> <some code to initialize and load component myDriver >
> ...
>
> StateMachine TestDriver
> {
> initial state SETUP
> {
> var bool isCfgOk = false
>
> entry
> {
> isCfgOk = ( myDriver.configure() == false )
> print.ln(".......................... SETUP")
> }
>
> transitions {
> if (isCfgOk==false) then select FAILURE;
> if (isCfgOk==true) then select RUNNING;
> }
> }
>
> state RUNNING
> {
> entry
> {
> print.ln(".......................... RUNNING")
> myDriver.start()
> }
> }
>
> state FAILURE
> {
> entry
> {
> print.ln("........................... Configuration Components failure.
> ¡¡¡¡") }
>
> transition if (true) then select SHUTDOWN
> }
>
> final state SHUTDOWN
> {
> entry
> {
> print.ln(".......................... SHUTDOWN")
> myDriver.stop()
> myDriver.cleanup()
> }
> }
> }
>
> RootMachine TestDriver deployApp;
>
> // --------------------------------- execute MachineState
> deployApp.activate();
> deployApp.start();
>
>
>
> ¿?¿?¿ Any ideas¿?¿?¿

Peter
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

enkulator's picture

StateMachine, transition is not executed

Dear Peter,

Thanks again for your responses,

The default Period is '0', I set the Period of myDriver to 0.1, but nothing
is changed. For other hand, always appear the next log lines:
*
*

*0.107 [ Info ][ScriptingService] Loading StateMachine 'deployApp'*
*0.107 [ Warning][ScriptingService] Loading StateMachine deployApp in a
TaskContext with getPeriod() == 0. Use setPeriod(period) in order to setup
execution of scripts. If you know what you are doing, you may disable this
warning using scripting.ZeroPeriodWarning=false*

More ideas?
Thanks in advance,

---- "*Si los españoles hablasen** sólo de lo que saben, habría un gran
silencio que podríamos aprovechar todos para **estudiar*" ( Manuel Azaña )

On Thu, Sep 22, 2011 at 10:59, Peter Soetens <peter [..] ...>wrote:

> On Wednesday 21 September 2011 10:28:09 antonio [dot] castellon [..] ... wrote:
> > Dear Developers,
> >
> > I have a problem with the execution of the MachineState,
> >
> > the result to execute this test.ops file is that "...SETUP" print appear,
> > but nothin more is succes.
>
> The most likely reason here is that the component which is executing this
> SM
> is not being periodic. Recent Orocos versions warn for this when you load
> it...
>
> You could test this with checking 'comp.getPeriod()' or do
> 'comp.setPeriod(0.1)'
>
> >
> > my code simple code to test is:
> >
> > ...
> > <some code to initialize and load component myDriver >
> > ...
> >
> > StateMachine TestDriver
> > {
> > initial state SETUP
> > {
> > var bool isCfgOk = false
> >
> > entry
> > {
> > isCfgOk = ( myDriver.configure() == false )
> > print.ln(".......................... SETUP")
> > }
> >
> > transitions {
> > if (isCfgOk==false) then select FAILURE;
> > if (isCfgOk==true) then select RUNNING;
> > }
> > }
> >
> > state RUNNING
> > {
> > entry
> > {
> > print.ln(".......................... RUNNING")
> > myDriver.start()
> > }
> > }
> >
> > state FAILURE
> > {
> > entry
> > {
> > print.ln("........................... Configuration
> Components failure.
> > ¡¡¡¡") }
> >
> > transition if (true) then select SHUTDOWN
> > }
> >
> > final state SHUTDOWN
> > {
> > entry
> > {
> > print.ln(".......................... SHUTDOWN")
> > myDriver.stop()
> > myDriver.cleanup()
> > }
> > }
> > }
> >
> > RootMachine TestDriver deployApp;
> >
> > // --------------------------------- execute MachineState
> > deployApp.activate();
> > deployApp.start();
> >
> >
> >
> > ¿?¿?¿ Any ideas¿?¿?¿
>
> Peter
>

StateMachine, transition is not executed

On Thursday 22 September 2011 11:53:56 Antonio Castellon wrote:
> Dear Peter,
>
> Thanks again for your responses,
>
> The default Period is '0', I set the Period of myDriver to 0.1, but nothing
> is changed. For other hand, always appear the next log lines:
> *
> *
>
> *0.107 [ Info ][ScriptingService] Loading StateMachine 'deployApp'*
> *0.107 [ Warning][ScriptingService] Loading StateMachine deployApp in a
> TaskContext with getPeriod() == 0. Use setPeriod(period) in order to setup
> execution of scripts. If you know what you are doing, you may disable this
> warning using scripting.ZeroPeriodWarning=false*
>

The warning clearly states that the period is still zero. You're probably
setting the period of the wrong component, ie, you're not loading the SM in
'myDriver'.

Peter