[Rock-dev] Multiple services of same type in tasks and data_service_type
Christian Rauch
Christian.Rauch at dfki.de
Tue Nov 5 15:29:11 CET 2013
Am 05.11.2013 14:51, schrieb Sylvain Joyeux:
> On 11/05/2013 11:30 AM, Christian Rauch wrote:
>> Hi,
>>
>> if a task provides multiple services of the same type with different
>> alias, how do I select one particular service by name in my profile?
>>
>> In my case a task provides two different Base::<type>ControlledSystemSrv
>> and syskit tells me:
>> {{{
>> = there is an ambiguity while looking for a service of type
>> Base::ControlledSystemSrv in Motionproxy::Task
>> | candidates are:
>> | controlled_system,
>> | motion_sample_consumer
>> }}}
>>
>> How do I select one of the candidates when I want to fulfil
>> 'controlled_system' of a ControlLoop?
> Yes, you simply select it with e.g.
>
> use('controlled_system' => Motionproxy::Task.controlled_system_srv)
>
> Just updated the documentation ...
Thanks.
>
>> A similar problem arises when a data_service_type also provides two
>> different Base::<type>ControlledSystemSrv as both have the output port
>> "command_out" but different type.
>> Is there a way to rename the ports of a service in the provides statement?
> See the bottom of
> http://rock-robotics.org/stable/documentation/system/data_services.html
>
Ok, this is also what syskit proposes ('command_out' => 'command_out'; I
meant <..>ControllerSrv in the previous mail). But I guess after I do
this, I won't be able to use the output ports of both services any more.
For example the command_out of Base::Motion2DControllerSrv and the
command_out of Base::<some_other_type>ControllerSrv will not be
reachable later because one service superposes the other.
Is there a way to have both ports accessible even if they have the same
name by giving the service (something like
#.as(Base::...ControllerSrv).command_out) or by renaming on of them?
--
Christian Rauch
Space Robotics
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel: +49 (0)421 178 45-6619
Empfang: +49 (0)421 178 45-6611
Fax: +49 (0)421 178 45-4150
E-Mail: Christian.Rauch at dfki.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
More information about the Rock-dev
mailing list