"connecting" a command to a peer

Hi,

I want to "connect" a command of my component to the one of a peer component:

I thought I could do something like this: for the command
_writeImagesCamera1 (Command<bool(void)>
_writeImagesCamera1):

_writeImagesCamera1 =
this->getPeer("Cam_R_Write")->commands()->getCommand<bool(void)>("getImage");

(something similar works for the methods (in that case you have to add
createMethod() ))

I get the following error when compiling:

/home/acm/packages/robotics-application/estimation/calibrationCamera/src/getImagesStereo.cpp:17:
error: no matching function for call to ‘RTT::Command<bool
()()>::Command(const char [12], bool (OCL::GetImagesStereo::*)(),
OCL::GetImagesStereo* const)’
/home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:212:
note: candidates are:
RTT::Command<CommandT>::Command(RTT::DispatchInterface*) [with
CommandT = bool ()()]
/home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:131:
note: RTT::Command<CommandT>::Command(const
RTT::Command<CommandT>&) [with CommandT = bool ()()]
/home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:124:
note: RTT::Command<CommandT>::Command(std::string)
[with CommandT = bool ()()]
/home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:114:
note: RTT::Command<CommandT>::Command() [with CommandT
= bool ()()]

The following thing is done in written in the RTT examples:

Command<bool(void)> mycom =
a_task.commands()->getCommand<bool(void)>("startCycle");

... which looks the same as the thing I am doing.

Any ideas, suggestions?

Tinne

BTW: I did not succeed in finding the RTT examples through the
website: don't they deserve a decent link on the website?

"connecting" a command to a peer

On Thu, Nov 26, 2009 at 14:57, Tinne De Laet
<tinne [dot] delaet [..] ...> wrote:
> Hi,
>
> I want to "connect" a command of my component to the one of a peer component:
>
> I thought I could do something like this: for the command
> _writeImagesCamera1 (Command<bool(void)>
> _writeImagesCamera1):
>
> _writeImagesCamera1 =
> this->getPeer("Cam_R_Write")->commands()->getCommand<bool(void)>("getImage");
>
> (something similar works for the methods (in that case you have to add
> createMethod() ))
>
> I get the following error when compiling:
>
> /home/acm/packages/robotics-application/estimation/calibrationCamera/src/getImagesStereo.cpp:17:
> error: no matching function for call to ‘RTT::Command<bool
> ()()>::Command(const char [12], bool (OCL::GetImagesStereo::*)(),
> OCL::GetImagesStereo* const)’
> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:212:
> note: candidates are:
> RTT::Command<CommandT>::Command(RTT::DispatchInterface*) [with
> CommandT = bool ()()]
> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:131:
> note:                 RTT::Command<CommandT>::Command(const
> RTT::Command<CommandT>&) [with CommandT = bool ()()]
> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:124:
> note:                 RTT::Command<CommandT>::Command(std::string)
> [with CommandT = bool ()()]
> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:114:
> note:                 RTT::Command<CommandT>::Command() [with CommandT
> = bool ()()]
>
> The following thing is done in written in the RTT examples:
>
>  Command<bool(void)> mycom =
> a_task.commands()->getCommand<bool(void)>("startCycle");
>
> ... which looks the same as the thing I am doing.
>
> Any ideas, suggestions?

The compiler is complaining about another source line than the one
you're presenting here.

>
> Tinne
>
> BTW: I did not succeed in finding the RTT examples through the
> website: don't they deserve a decent link on the website?

http://www.orocos.org/rtt/source

But it's maybe better to have a http://www.orocos.org/rtt/tutorials
page (wiki). Stephen is writing some up, but they are already quite
advanced.So I'd like to split them up in beginners and advanced.

Peter

"connecting" a command to a peer

On Nov 26, 2009, at 09:13 , Peter Soetens wrote:

> On Thu, Nov 26, 2009 at 14:57, Tinne De Laet
> <tinne [dot] delaet [..] ...> wrote:
>> Hi,
>>
>> I want to "connect" a command of my component to the one of a peer component:
>>
>> I thought I could do something like this: for the command
>> _writeImagesCamera1 (Command<bool(void)>
>> _writeImagesCamera1):
>>
>> _writeImagesCamera1 =
>> this->getPeer("Cam_R_Write")->commands()->getCommand<bool(void)>("getImage");
>>
>> (something similar works for the methods (in that case you have to add
>> createMethod() ))
>>
>> I get the following error when compiling:
>>
>> /home/acm/packages/robotics-application/estimation/calibrationCamera/src/getImagesStereo.cpp:17:
>> error: no matching function for call to ‘RTT::Command<bool
>> ()()>::Command(const char [12], bool (OCL::GetImagesStereo::*)(),
>> OCL::GetImagesStereo* const)’
>> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:212:
>> note: candidates are:
>> RTT::Command<CommandT>::Command(RTT::DispatchInterface*) [with
>> CommandT = bool ()()]
>> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:131:
>> note: RTT::Command<CommandT>::Command(const
>> RTT::Command<CommandT>&) [with CommandT = bool ()()]
>> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:124:
>> note: RTT::Command<CommandT>::Command(std::string)
>> [with CommandT = bool ()()]
>> /home/acm/packages/orocos/rtt/rtt-1.10/rtt/include/rtt/Command.hpp:114:
>> note: RTT::Command<CommandT>::Command() [with CommandT
>> = bool ()()]
>>
>> The following thing is done in written in the RTT examples:
>>
>> Command<bool(void)> mycom =
>> a_task.commands()->getCommand<bool(void)>("startCycle");
>>
>> ... which looks the same as the thing I am doing.
>>
>> Any ideas, suggestions?
>
> The compiler is complaining about another source line than the one
> you're presenting here.
>
>>
>> Tinne
>>
>> BTW: I did not succeed in finding the RTT examples through the
>> website: don't they deserve a decent link on the website?
>
> http://www.orocos.org/rtt/source
>
> But it's maybe better to have a http://www.orocos.org/rtt/tutorials
> page (wiki). Stephen is writing some up, but they are already quite
> advanced.So I'd like to split them up in beginners and advanced.

Agreed. I always thought the existing tutorials/examples were a really good start for beginners, and I was just trying to cover some of the topics that keep coming up on the ML. These are typically intermediate to advanced. Changing the organization a little to link them all together, and indicating level of difficulty, is a very good idea IMHO.

Stephen