Hi everyone,
after I updated from 1.6.x to 1.8.1 the Command Interface doesn't work well anymore.
After updating I built the whole Project new but sometimes the Command methode get called and sometimes not for no apparent reason.
Here is the code:
With this code I try to call the other task's command:
Command
parseFile = this->getPeer("Planung")->commands()->getCommand
parseFile(fname);
This is the desired Task/Object to be called:
Planung::Planung(string nam) : TaskContext(nam)
, C_parseFile("pre_parseFile",&Planung::pre_parseFile, Planung::done_parseFile, this)
{
...
this->commands()->addCommand( &C_parseFile, "Bla Blub", "QString","Filename");
...
}
bool Planung::pre_parseFile(QString f) {
cerr<<"Command called!\n";
return true;
}
But pre_parseFile() only gets called sometimes?? There were no warnings or errors during compile time or at runtime.
Can anyone spot the error?!
Thanks in advanced!
Johannes
Command trouble after update to 1.8.1
On Wednesday 25 March 2009 16:33:46 SchickJohannes23 [..] ... wrote:
> Hi everyone,
>
> after I updated from 1.6.x to 1.8.1 the Command Interface doesn't work well
> anymore.
>
> After updating I built the whole Project new but sometimes the Command
> methode get called and sometimes not for no apparent reason.
>
> Here is the code:
>
> With this code I try to call the other task's command:
> Command<bool(QString)> parseFile;
> parseFile =
> this->getPeer("Planung")->commands()->getCommand<bool(QString)>("pre_parseF
>ile"); parseFile(fname);
I'm just thinking of something... are you re-using the same command object
every time ? Do you check the return value when you invoke the command, like
in:
In case the return value is already false, your command was never sent. If you
want to 'queue up' commands, you need to use multiple Command<bool(QString>
objects.
Peter
Command trouble after update to 1.8.1
Peter Soetens wrote:
> On Wednesday 25 March 2009 16:33:46 SchickJohannes23 [..] ... wrote:
>> Hi everyone,
>>
>> after I updated from 1.6.x to 1.8.1 the Command Interface doesn't work well
>> anymore.
>>
>> After updating I built the whole Project new but sometimes the Command
>> methode get called and sometimes not for no apparent reason.
>>
>> Here is the code:
>>
>> With this code I try to call the other task's command:
>> Command<bool(QString)> parseFile;
>> parseFile =
>> this->getPeer("Planung")->commands()->getCommand<bool(QString)>("pre_parseF
>> ile"); parseFile(fname);
>
> I'm just thinking of something... are you re-using the same command object
> every time ? Do you check the return value when you invoke the command, like
> in:
>
>
>
> In case the return value is already false, your command was never sent. If you
> want to 'queue up' commands, you need to use multiple Command<bool(QString>
> objects.
>
> Peter
No this command object is really only used once in the whole programm -
but good to know!
Command trouble after update to 1.8.1
On Wednesday 25 March 2009 23:35:01 Johannes Schick wrote:
> Peter Soetens wrote:
> > On Wednesday 25 March 2009 16:33:46 SchickJohannes23 [..] ... wrote:
> >> Hi everyone,
> >>
> >> after I updated from 1.6.x to 1.8.1 the Command Interface doesn't work
> >> well anymore.
> >>
> >> After updating I built the whole Project new but sometimes the Command
> >> methode get called and sometimes not for no apparent reason.
> >>
> >> Here is the code:
> >>
> >> With this code I try to call the other task's command:
> >> Command<bool(QString)> parseFile;
> >> parseFile =
> >> this->getPeer("Planung")->commands()->getCommand<bool(QString)>("pre_par
> >>seF ile"); parseFile(fname);
> >
> > I'm just thinking of something... are you re-using the same command
> > object every time ? Do you check the return value when you invoke the
> > command, like in:
> >
> >
> >
> > In case the return value is already false, your command was never sent.
> > If you want to 'queue up' commands, you need to use multiple
> > Command<bool(QString> objects.
> >
> > Peter
>
> No this command object is really only used once in the whole programm -
> but good to know!
Then there's only one way to fix this, and that's trying to reproduce it. For
all clarity: this doesn't happen in 1.6, does it ?
If you could provide sample code, that would be easiest. Otherwise, could you
specify your OROCOS_TARGET (gnulinux ?) and the priorities/schedulers of both
component activities ? I assume you're running on a dual core ?
Create a new bug report on https://www.fmtc.be/bugzilla/orocos to store the
above information such that we can track it.
Thanks for reporting,
Peter
Re: Command trouble after update to 1.8.1
Okay, finally i got time to answer your questions.
First: I tried the new Version 1.8.2 - same thing but it seams slightly better - could be coincidence....
yep OROCOS_TARGET is gnulinux.
Sample code is here:
http://studwww.ira.uka.de/~s_jschic/orocos_test.zip
CPU is
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.80GHz
stepping : 9
with dual core - but same thing happens on a single processor unit.
Interesting thing I executed the same binary with 1.6 (well i recompiled it of curse) and sometimes the command didn't get called like in 1.8.*. So maybe I've done something wrong...
To change between versions I simply rename the hole orocos directory /opt/orocos (with bin,include, lib, share in it) , move the other verison to /opt/orocos and execute ldconfig. Something wrong about that?!
Well thanks in advanced!
Johannes
On Wednesday 25 March 2009 23:35:01 Johannes Schick wrote: parseFile;("pre_par
> > bool ok = parseFile(QString("thefile"));
> >
objects.
> Peter Soetens wrote:
> > On Wednesday 25 March 2009 16:33:46 SchickJohannes23 [..] ... wrote:
> >> Hi everyone,
> >>
> >> after I updated from 1.6.x to 1.8.1 the Command Interface doesn't work
> >> well anymore.
> >>
> >> After updating I built the whole Project new but sometimes the Command
> >> methode get called and sometimes not for no apparent reason.
> >>
> >> Here is the code:
> >>
> >> With this code I try to call the other task's command:
> >> Command
> >> parseFile =
> >> this->getPeer("Planung")->commands()->getCommand
> >>seF ile"); parseFile(fname);
> >
> > I'm just thinking of something... are you re-using the same command
> > object every time ? Do you check the return value when you invoke the
> > command, like in:
> >
> >
> > if ( !parseFile.ready() )
> > cerr << "Warning, command not ready: may fail to send !"<
> > if (!ok)
> > cerr << "Failed to send command, retry next time !" <
> >
> > In case the return value is already false, your command was never sent.
> > If you want to 'queue up' commands, you need to use multiple
> > Command
> >
> > Peter
>
> No this command object is really only used once in the whole programm -
> but good to know!
Then there's only one way to fix this, and that's trying to reproduce it. For
all clarity: this doesn't happen in 1.6, does it ?
If you could provide sample code, that would be easiest. Otherwise, could you
specify your OROCOS_TARGET (gnulinux ?) and the priorities/schedulers of both
component activities ? I assume you're running on a dual core ?
Create a new bug report on https://www.fmtc.be/bugzilla/orocos to store the
above information such that we can track it.
Thanks for reporting,
Peter