Hie,
We try to send very quickly several commands to a non periodic component. The non periodic component is low priority. Logs show us that the commands are sent all together at first and then, only the first command is executed by the non periodic component .... what's happened for the other commands?
In summary,
//the non periodic component is m_faultManager
//In the sender component:
//get the commands of the non periodic component:
m_cmdCreateFault1 = m_faultManager->commands()->getCommand
m_cmdCreateFault2 = m_faultManager->commands()->getCommand
m_cmdCreateFault3 = m_faultManager->commands()->getCommand
//send the commands
res = m_cmdCreateFault1();
res = m_cmdCreateFault2();
res = m_cmdCreateFault3();
We can see, by logs:
. only m_cmdCreateFault1 is executed
. res, sent(), accepted(), valid(), done() and executed() do not allow us to know whether the command has been successful.
If the component (m_faultManager) is periodic, all the commands are executed.
Does anybody know where is my mistake?
Thanks a lot
Guillaume
Command on a non periodic component
On Tuesday 20 January 2009 15:11:22 gde [..] ... wrote:
> Hie,
> We try to send very quickly several commands to a non periodic component.
> The non periodic component is low priority. Logs show us that the commands
> are sent all together at first and then, only the first command is executed
> by the non periodic component .... what's happened for the other commands?
The dequeueing of commands did not work properly for non periodic activities.
Only one command was lifted from the queue, the others remained there until
the activity was triggered again. This is an artifact of the discussion we had
if each trigger() should lead to processing one command (hence you need to
count triggers) or that each trigger does as much as possible and that
simultaneous triggers lead to only one execution. The latter was chosen but
the Command Processor was not adapted to work like this.
This patch solves this and makes sure all commands are processed.
Note: I checked the event queue, which does work correctly, ie processing all
events in the queue.
cd orocos-rtt-1.6.0
patch -p0 < fix-cp-dequeue.patch
Recompile, and it should be fixed.
Thanks for reporting,
Peter
>
> In summary,
>
> //the non periodic component is m_faultManager
> //In the sender component:
> //get the commands of the non periodic component:
> m_cmdCreateFault1 = m_faultManager->commands()->getCommand("createFault");
> m_cmdCreateFault2 = m_faultManager->commands()->getCommand("createFault");
> m_cmdCreateFault3 = m_faultManager->commands()->getCommand("createFault");
>
> //send the commands
> res = m_cmdCreateFault1();
> res = m_cmdCreateFault2();
> res = m_cmdCreateFault3();
>
> We can see, by logs:
> . only m_cmdCreateFault1 is executed
> . res, sent(), accepted(), valid(), done() and executed() do not allow us
> to know whether the command has been successful.
>
> If the component (m_faultManager) is periodic, all the commands are
> executed.
>
> Does anybody know where is my mistake?
>
> Thanks a lot
> Guillaume
It works !!!
Perfect, all my commands are executed.
Thank you very much for your help.
Guillaume