[Rock-dev] accessing ports in syskit compositions via services
Matthias Goldhoorn
matthias.goldhoorn at dfki.de
Tue Jun 25 14:25:13 CEST 2013
Hi,
The whole intention about the data services is this abstraction.
What else do you have in mind, you need to define the "generic portname"
anywhere...
How else should be an abstract "portname" defined an dataservice?
I mean creating an data-service is an 3-liner...
Matthias
On 25.06.2013 14:15, Felix Rehrmann wrote:
> Hi,
>
> I have a composition (see below) that has an OrientationSrv, for which I
> found two ways of accessing the underlying port.
> One is via the service, the other is via the orocos task. Latter has the
> problem that it depends on the port name of the orocos
> task, which might not be named like the service port and in this case
> actually is not. The access via the service is a bit uncomfortable
> as it requires the conversion into the data service first. - Is there
> another solution which allows to access the port via the service? Say
> a bit more straight forward?
>
> Felix
>
> class RotateTo< Syskit::Composition
>
> add Base::Motion2DControlledSystemSrv, :as => 'system'
> add Base::OrientationSrv, :as => 'orientation'
>
> argument :target_angle, :default => 0.0
> argument :rate, :default => 0.1
>
> on :start do |ev|
> @cmd_writer = system_child.orocos_task.motion_command.writer
> # The orientation service knows the port under the name
> orientation_samples.
> @ori_reader =
> orientation_child.as(Base::OrientationSrv).orientation_samples_port.reader
> # The orocos task's port is actually called pose_samples.
> #@ori_reader = orientation_child.pose_samples_port.reader
> end
>
> ....
>
--
Dipl.-Inf. Matthias Goldhoorn
Space and Underwater Robotic
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel.: +49 421 178 45-4193
Zentrale: +49 421 178 45-6550
Fax: +49 421 178 45-4150
E-Mail: matthias.goldhoorn at uni-bremen.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
More information about the Rock-dev
mailing list