Hello,
I'm trying to execute a command like that:
RTT::TaskContext * task = findPeer(peer, refPeer);
if (task) {
RTT::CommandRepository * commandRepository = task->commands();
//create command
RTT::CommandC command(task->commands(), commandName);
float seekValue = 0.0;
command.argC(seekValue);
seekValue = 0.0;
command.reset();
command.execute();
}
but I'm getting the following error:
#0 0x00007fffd8556f60 in ?? ()
#1 0x00007ffff7879025 in RTT::CommandProcessor::step (this=0xf18c60)
at /home/robocup/build/orocos-rtt-1.12.1/src/CommandProcessor.cpp:85
#2 0x00007ffff785b1aa in RTT::ExecutionEngine::step (this=0xf189b0)
at /home/robocup/build/orocos-rtt-1.12.1/src/ExecutionEngine.cpp:318
#3 0x00007ffff78feeee in RTT::TimerThread::step (this=0xf2bef0)
at /home/robocup/build/orocos-rtt-1.12.1/src/TimerThread.cpp:146
#4 0x00007ffff79349ec in RTT::OS::periodicThread (t=<value optimized out>)
at /home/robocup/build/orocos-rtt-1.12.1/src/os/PeriodicThread.cpp:106
#5 0x00007fffee92a971 in start_thread () from /lib/libpthread.so.0
#6 0x00007fffeae9792d in clone () from /lib/libc.so.6
#7 0x0000000000000000 in ?? ()
Someone guide me on how to use the "RTT::CommandC"?
Thanks in advance,
Arturo
RTT::CommandC
On Wed, May 4, 2011 at 4:56 PM, Arturo Reuschenbach
<d2133087 [..] ...> wrote:
> Hello,
> I'm still trying to execute a command with the class RTT::CommandC like
> this:
>
> RTT::TaskContext * task = findPeer(peer, refPeer);
> if (task) {
> RTT::CommandRepository * commandRepository = task->commands();
> RTT::CommandC command(task->commands(), commandName);
> float seekValue = 0.0;
This line is the bug. The seekValue is created on the stack, and the
command function will try to write that value, while it no longer
exists during the execution. You need to make this variable a class
member variable or make sure that it exists while the command is
executed in the peer.
> command.argC(seekValue);
> command.execute();
> }
>
> but I'm getting the following error:
>
> #0 0x00007fffd8556f60 in ?? ()
> #1 0x00007ffff7879025 in RTT::CommandProcessor::step (this=0xf18c60)
> at /home/robocup/build/orocos-rtt-1.12.1/src/CommandProcessor.cpp:85
> #2 0x00007ffff785b1aa in RTT::ExecutionEngine::step (this=0xf189b0)
>
> at /home/robocup/build/orocos-rtt-1.12.1/src/ExecutionEngine.cpp:318
> #3 0x00007ffff78feeee in RTT::TimerThread::step (this=0xf2bef0)
> at /home/robocup/build/orocos-rtt-1.12.1/src/TimerThread.cpp:146
> #4 0x00007ffff79349ec in RTT::OS::periodicThread (t=<value optimized out>)
>
> at /home/robocup/build/orocos-rtt-1.12.1/src/os/PeriodicThread.cpp:106
> #5 0x00007fffee92a971 in start_thread () from /lib/libpthread.so.0
> #6 0x00007fffeae9792d in clone () from /lib/libc.so.6
> #7 0x0000000000000000 in ?? ()
>
> Someone guide me on how to use the "RTT::CommandC" or give me some example?
The rest of your code is correct use.
Peter
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
RTT::CommandC
It make sense.
Thank you for the quick response.
Arturo
Am 04.05.11 17:52, schrieb Peter Soetens:
> On Wed, May 4, 2011 at 4:56 PM, Arturo Reuschenbach
> <d2133087 [..] ...> wrote:
>> Hello,
>> I'm still trying to execute a command with the class RTT::CommandC like
>> this:
>>
>> RTT::TaskContext * task = findPeer(peer, refPeer);
>> if (task) {
>> RTT::CommandRepository * commandRepository = task->commands();
>> RTT::CommandC command(task->commands(), commandName);
>> float seekValue = 0.0;
> This line is the bug. The seekValue is created on the stack, and the
> command function will try to write that value, while it no longer
> exists during the execution. You need to make this variable a class
> member variable or make sure that it exists while the command is
> executed in the peer.
>
>> command.argC(seekValue);
>> command.execute();
>> }
>>
>> but I'm getting the following error:
>>
>> #0 0x00007fffd8556f60 in ?? ()
>> #1 0x00007ffff7879025 in RTT::CommandProcessor::step (this=0xf18c60)
>> at /home/robocup/build/orocos-rtt-1.12.1/src/CommandProcessor.cpp:85
>> #2 0x00007ffff785b1aa in RTT::ExecutionEngine::step (this=0xf189b0)
>>
>> at /home/robocup/build/orocos-rtt-1.12.1/src/ExecutionEngine.cpp:318
>> #3 0x00007ffff78feeee in RTT::TimerThread::step (this=0xf2bef0)
>> at /home/robocup/build/orocos-rtt-1.12.1/src/TimerThread.cpp:146
>> #4 0x00007ffff79349ec in RTT::OS::periodicThread (t=<value optimized out>)
>>
>> at /home/robocup/build/orocos-rtt-1.12.1/src/os/PeriodicThread.cpp:106
>> #5 0x00007fffee92a971 in start_thread () from /lib/libpthread.so.0
>> #6 0x00007fffeae9792d in clone () from /lib/libc.so.6
>> #7 0x0000000000000000 in ?? ()
>>
>> Someone guide me on how to use the "RTT::CommandC" or give me some example?
> The rest of your code is correct use.
>
> Peter
--
Arturo Reuschenbach
AG Künstliche Intelligenz,
Projekt AutoNOMOS, Wissenschaftlicher Mitarbeiter Cog.-Nav.-Lab
Freie Universität Berlin
Institut für Informatik
Arnimallee 7, Raum 011
14195 Berlin
Tel 0049 / 30 838 75117
Fax 0049 / 30 838 75059
_______________________________________________
AutoNOMOS mailing list
AutoNOMOS [..] ...
https://lists.spline.inf.fu-berlin.de/mailman/listinfo/autonomos
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
RTT::CommandC
Hello,
I'm still trying to execute a command with the class RTT::CommandC like
this:
RTT::TaskContext * task = findPeer(peer, refPeer);
if (task) {
RTT::CommandRepository * commandRepository = task->commands();
RTT::CommandC command(task->commands(), commandName);
float seekValue = 0.0;
command.argC(seekValue);
command.execute();
}
but I'm getting the following error:
#0 0x00007fffd8556f60 in ?? ()
#1 0x00007ffff7879025 in RTT::CommandProcessor::step (this=0xf18c60)
at /home/robocup/build/orocos-rtt-1.12.1/src/CommandProcessor.cpp:85
#2 0x00007ffff785b1aa in RTT::ExecutionEngine::step (this=0xf189b0)
at /home/robocup/build/orocos-rtt-1.12.1/src/ExecutionEngine.cpp:318
#3 0x00007ffff78feeee in RTT::TimerThread::step (this=0xf2bef0)
at /home/robocup/build/orocos-rtt-1.12.1/src/TimerThread.cpp:146
#4 0x00007ffff79349ec in RTT::OS::periodicThread (t=<value optimized out>)
at /home/robocup/build/orocos-rtt-1.12.1/src/os/PeriodicThread.cpp:106
#5 0x00007fffee92a971 in start_thread () from /lib/libpthread.so.0
#6 0x00007fffeae9792d in clone () from /lib/libc.so.6
#7 0x0000000000000000 in ?? ()
Someone guide me on how to use the "RTT::CommandC" or give me some example?
Thanks in advance,
Arturo