Error in calling commands from another TaskContrext

Hi All,

I'm currently working myself into orocos and struggle about a strange problem.

I try to call a command of TaskContext-A from within TaskContext-B and get
allways the error message:

---------- snip --------

pure virtual method called
terminate called without an active exception
Aborted
Press Enter to continue!

---------- snip --------

A call of the same command from within ORO_main works just fine!?!?

Does anyone have an idea what I'm doing wrong?

Error in calling commands from another TaskContrext

Can you send us the pertinent code that doesn't work? That will help
us to help you ...
S

On Oct 11, 2008, at 07:39 , Joerg Wleklik wrote:

> Hi All,
>
> I'm currently working myself into orocos and struggle about a
> strange problem.
>
> I try to call a command of TaskContext-A from within TaskContext-B
> and get
> allways the error message:
>
> ---------- snip --------
>
> pure virtual method called
> terminate called without an active exception
> Aborted
> Press Enter to continue!
>
> ---------- snip --------
>
> A call of the same command from within ORO_main works just fine!?!?
>
> Does anyone have an idea what I'm doing wrong?

Error in calling commands from another TaskContrext

Hi,

please find attached the a sample to reproduce my problem.

To build just unpack and call make
(assumed that orocos is installed under /usr/local)

I want to call the command "StepControl.MoveTo_A" from within the task context
StateInfo.

If I call the command "MoveTo_A(100)" in the TaskBrowser all works as
expected. To call the command from the task context "StateInfo", I created a
command and also a methode but cot the same error for both ways.

To reproduce run "robotcontrol" and call "MoveTo_A(100)" in the TaskBrowser.
This sould result in a list of Debug outputs.

Than try "StateInfo.MethodCallMove" or "StateInfo.CallMove" to see the error.

Thanks in advance for any help
Joerg

Am Samstag 11 Oktober 2008 15:46:20 schrieben Sie:
> Can you send us the pertinent code that doesn't work? That will help
> us to help you ...
> S
>
> On Oct 11, 2008, at 07:39 , Joerg Wleklik wrote:
> > Hi All,
> >
> > I'm currently working myself into orocos and struggle about a
> > strange problem.
> >
> > I try to call a command of TaskContext-A from within TaskContext-B
> > and get
> > allways the error message:
> >
> > ---------- snip --------
> >
> > pure virtual method called
> > terminate called without an active exception
> > Aborted
> > Press Enter to continue!
> >
> > ---------- snip --------
> >
> > A call of the same command from within ORO_main works just fine!?!?
> >
> > Does anyone have an idea what I'm doing wrong?

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Error in calling commands from another TaskContrext

On Saturday 11 October 2008 17:52:56 Joerg Wleklik wrote:
> Hi,
>
> please find attached the a sample to reproduce my problem.
>
> To build just unpack and call make
> (assumed that orocos is installed under /usr/local)

I haven't looked for yet what's causing the crash, but what is definately
wrong is this piece of code:


void StateInfo::updateHook()
{
// Read the inbound ports:
MyDataStruct mds;
mds.A = inData_A.data()->Get();

if ( mds.A != -1 ) {
log(Debug) << "Got valid Data for A !"<< mds.A <<
Logger::endl;
}

Command move_A =
getPeer("StepControl")->commands()->getCommand("MoveTo_A");
if(move_A.done() == true){
log(Debug) << "Command MoveTo_A is done!" << mds.B <<
Logger::endl;
}
}

The move_A object has *local* state and is a *copy* of the command
in 'StepControl' (all commands are copies and independent of each other). So
move_A.done() will always be false since you did not call move_A() .
So you need to store move_A as a member of StateInfo.

Peter

>
> I want to call the command "StepControl.MoveTo_A" from within the task
> context StateInfo.
>
> If I call the command "MoveTo_A(100)" in the TaskBrowser all works as
> expected. To call the command from the task context "StateInfo", I created
> a command and also a methode but cot the same error for both ways.
>
> To reproduce run "robotcontrol" and call "MoveTo_A(100)" in the
> TaskBrowser. This sould result in a list of Debug outputs.
>
> Than try "StateInfo.MethodCallMove" or "StateInfo.CallMove" to see the
> error.
>
>
> Thanks in advance for any help
> Joerg
>
> Am Samstag 11 Oktober 2008 15:46:20 schrieben Sie:
> > Can you send us the pertinent code that doesn't work? That will help
> > us to help you ...
> > S
> >
> > On Oct 11, 2008, at 07:39 , Joerg Wleklik wrote:
> > > Hi All,
> > >
> > > I'm currently working myself into orocos and struggle about a
> > > strange problem.
> > >
> > > I try to call a command of TaskContext-A from within TaskContext-B
> > > and get
> > > allways the error message:
> > >
> > > ---------- snip --------
> > >
> > > pure virtual method called
> > > terminate called without an active exception
> > > Aborted
> > > Press Enter to continue!
> > >
> > > ---------- snip --------
> > >
> > > A call of the same command from within ORO_main works just fine!?!?
> > >
> > > Does anyone have an idea what I'm doing wrong?
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Error in calling commands from another TaskContrext

On Sunday 12 October 2008 22:11:58 Peter Soetens wrote:

...
>
> The move_A object has *local* state and is a *copy* of the command
> in 'StepControl' (all commands are copies and independent of each other).
> So move_A.done() will always be false since you did not call move_A() . So
> you need to store move_A as a member of StateInfo.

That's also the reason why it crashes. The C++ command object move_A has been
destroyed before the receiving task could execute it, but it was already
queued... so eventually the receiving TC executed a deleted command.

The solution is to make move_A a member variable of your class.

Peter

>
> Peter
>
> > I want to call the command "StepControl.MoveTo_A" from within the task
> > context StateInfo.
> >
> > If I call the command "MoveTo_A(100)" in the TaskBrowser all works as
> > expected. To call the command from the task context "StateInfo", I
> > created a command and also a methode but cot the same error for both
> > ways.
> >
> > To reproduce run "robotcontrol" and call "MoveTo_A(100)" in the
> > TaskBrowser. This sould result in a list of Debug outputs.
> >
> > Than try "StateInfo.MethodCallMove" or "StateInfo.CallMove" to see the
> > error.
> >
> >
> > Thanks in advance for any help
> > Joerg
> >
> > Am Samstag 11 Oktober 2008 15:46:20 schrieben Sie:
> > > Can you send us the pertinent code that doesn't work? That will help
> > > us to help you ...
> > > S
> > >
> > > On Oct 11, 2008, at 07:39 , Joerg Wleklik wrote:
> > > > Hi All,
> > > >
> > > > I'm currently working myself into orocos and struggle about a
> > > > strange problem.
> > > >
> > > > I try to call a command of TaskContext-A from within TaskContext-B
> > > > and get
> > > > allways the error message:
> > > >
> > > > ---------- snip --------
> > > >
> > > > pure virtual method called
> > > > terminate called without an active exception
> > > > Aborted
> > > > Press Enter to continue!
> > > >
> > > > ---------- snip --------
> > > >
> > > > A call of the same command from within ORO_main works just fine!?!?
> > > >
> > > > Does anyone have an idea what I'm doing wrong?
> >
> > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>
> --
> Peter Soetens -- FMTC --

Error in calling commands from another TaskContrext

Am Sonntag, 12. Oktober 2008 schrieb Peter Soetens:
> On Sunday 12 October 2008 22:11:58 Peter Soetens wrote:
>
> ...
>
> > The move_A object has *local* state and is a *copy* of the command
> > in 'StepControl' (all commands are copies and independent of each other).
> > So move_A.done() will always be false since you did not call move_A() .
> > So you need to store move_A as a member of StateInfo.
>
> That's also the reason why it crashes. The C++ command object move_A has
> been destroyed before the receiving task could execute it, but it was
> already queued... so eventually the receiving TC executed a deleted
> command.
>
> The solution is to make move_A a member variable of your class.
>
> Peter

Jop, that was the problem. Now it works as expected.

THANKS for your help

Joerg

>
> > Peter
> >
> > > I want to call the command "StepControl.MoveTo_A" from within the task
> > > context StateInfo.
> > >
> > > If I call the command "MoveTo_A(100)" in the TaskBrowser all works as
> > > expected. To call the command from the task context "StateInfo", I
> > > created a command and also a methode but cot the same error for both
> > > ways.
> > >
> > > To reproduce run "robotcontrol" and call "MoveTo_A(100)" in the
> > > TaskBrowser. This sould result in a list of Debug outputs.
> > >
> > > Than try "StateInfo.MethodCallMove" or "StateInfo.CallMove" to see the
> > > error.
> > >
> > >
> > > Thanks in advance for any help
> > > Joerg
> > >
> > > Am Samstag 11 Oktober 2008 15:46:20 schrieben Sie:
> > > > Can you send us the pertinent code that doesn't work? That will help
> > > > us to help you ...
> > > > S
> > > >
> > > > On Oct 11, 2008, at 07:39 , Joerg Wleklik wrote:
> > > > > Hi All,
> > > > >
> > > > > I'm currently working myself into orocos and struggle about a
> > > > > strange problem.
> > > > >
> > > > > I try to call a command of TaskContext-A from within TaskContext-B
> > > > > and get
> > > > > allways the error message:
> > > > >
> > > > > ---------- snip --------
> > > > >
> > > > > pure virtual method called
> > > > > terminate called without an active exception
> > > > > Aborted
> > > > > Press Enter to continue!
> > > > >
> > > > > ---------- snip --------
> > > > >
> > > > > A call of the same command from within ORO_main works just fine!?!?
> > > > >
> > > > > Does anyone have an idea what I'm doing wrong?
> > >
> > > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> >
> > --
> > Peter Soetens -- FMTC --

--

Hard & Software Development
 
Envisiontec GmbH
Brüsseler Straße 51
D-45968 Gladbeck
Fon: +49 2043 9875-0
Fax: +49 2043 9875-99
mail: joerg [dot] wleklik [..] ...
web: www.envisiontec.de
 
Geschäftsführer: Ali El-Siblani
Handelsregister-Nr.: HR B 7173
Amtsgericht Gelsenkirchen
Steuer-Nr.: 320/5906/0785
UST-ID Nr.: DE813668162
Commerzbank AG Dorsten
BLZ: 360 400 39
Konto: 6316111
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm