[Rock-dev] roby: how to define different services depending on the configuration

Sylvain Joyeux sylvain.joyeux at dfki.de
Tue Apr 5 10:59:33 CEST 2011


On 04/05/2011 10:47 AM, Alexander Duda wrote:
> Hi
>
> I have one task which provides different services depending on the
> configuration.
>
> I thought maybe I can add driver_for multiple times to the task
> definition. But that seems not to work.
>
> class Camera::CameraTask
>      driver_for 'Camera' do
>      	provides Srv::ImageProvider
>      end
>      driver_for 'StructuredLight' do
>      	provides Srv::StructuredLightImage
>      end
>      def configure
>      	super
>          orogen_task.camera_id = robot_device.device_id
>      end
> end

What does "not to work" means ? What problem do you have with this setup ?

Why do you make StructuredLight a device in the first place ? It is a 
pure service (you don't have a "structured light camera", only a camera 
that is setup to provide the kind of images that structured light requires).

In general, don't overuse services / devices. I.e. only use them when 
you start having the need for them.
-- 
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics

!!! Achtung, neue Telefonnummer!!!

Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-454136
Fax:   +49 (0)421 218-454150
E-Mail: robotik at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3
-----------------------------------------------------------------------


More information about the Rock-dev mailing list