[Rock-dev] Assignment of a task to service by profiles
Matthias Goldhoorn
matthias.goldhoorn at dfki.de
Wed Sep 4 17:50:35 CEST 2013
known bug see:
https://rock.opendfki.de/ticket/330
Am 04.09.2013 17:43, schrieb Christian Rauch:
> Hi,
>
> I have a problem with the automatic assignment from a task to a service.
> The flavour is next.
>
> I have the following Composition, that is writing on a command_in port
> of a Motion2DControlledSystemSrv (might be a robot or simulation):
> {{{
> class BaseMotion < Syskit::Composition
> argument :translation, :default => 0
> argument :rotation, :default => 0
>
> add Base::Motion2DControlledSystemSrv, :as => 'system'
>
> on :start do |ev|
> @cmd_writer =
> system_child.as(Base::Motion2DControlledSystemSrv).command_in_port.writer
> end
>
> poll do
> @cmd_writer.write(:translation => translation, :rotation =>
> rotation) if @cmd_writer
> end
>
> on :stop do |ev|
> @cmd_writer.write(:translation => 0.0, :rotation => 0.0) if
> @cmd_writer
> end
> end
> }}}
>
> In the profile (models/profiles/seekurjr/robot.rb), there is:
> {{{
> module Virgo
> module Profiles
> profile 'Robot' do
> [...]
>
> robot do
> device(Dev::Platforms::MobileRobotics, :as => "seekur").
> period(0.1).
> frame('body')
> [...]
> end
>
> [...]
>
> use Base::Motion2DControlledSystemSrv => seekur_dev
> define 'base_motion', Virgo::BaseMotion.use('system' =>
> seekur_dev)
> }}}
>
> where "Dev::Platforms::MobileRobotics" is defined by:
> {{{
> Dev::Platforms.device_type 'MobileRobotics' do
> provides Base::Motion2DControlledSystemSrv
> provides Virgo::BumperSrv
> end
>
> class Aria::Task
> driver_for Dev::Platforms::MobileRobotics, :as => 'device'
> [...]
> end
> }}}
>
> That profile is selected in the action interface
> (models/actions/seekurjr/main.rb):
> {{{
> require 'models/actions/common_prediction'
> require 'models/actions/common_base'
>
> class Main < Roby::Actions::Interface
> use_profile Virgo::Profiles::Robot
> use_library Virgo::ActionsInterface
> end
> }}}
>
> and (models/actions/common_base):
> {{{
> module Virgo
> module ActionsInterface
> action_library
>
> describe("Move forward with 0.25 m/s").
> returns(Virgo::BaseMotion)
> def fwd_025
> Virgo::BaseMotion.with_arguments(:translation=>0.25,
> :rotation=>0.0).as_plan
> end
>
> end
> end
> }}}
>
>
> Now, if I execute "syskit run -r seekurjr fwd_025!" I expect that the
> service "Base::Motion2DControlledSystemSrv" is filled by Aria::Task
> automatically, as it is explicitly defined in the Robot profile (by
> seekur_dev) that is selected by the option "-r".
>
> What I get is:
> {{{
> 17:21:20.638 (Roby) cannot find a concrete implementation for 1 task(s)
> 17:21:20.638 (Roby) Syskit::TaskContext placeholder for
> Base::Motion2DControlledSystemSrv
> 17:21:20.638 (Roby) 3 candidates
> 17:21:20.638 (Roby) Skid4Control::SimpleController,
> 17:21:20.638 (Roby) Aria::Task,
> 17:21:20.638 (Roby)
> Base::ControlLoop/[controller.is_a?(Base::Motion2DControlledSystemSrv)]
> }}}
>
> Why is Aria::Task not automatically used? If I use the "base_motion_def"
> from the same profile, the Aria::Task is used as expected.
> At the end, we want to switch profiles, where each profile defines what
> Task is providing the Base::Motion2DControlledSystemSrv.
>
> Regards,
> Christian
>
>
--
--
Matthias Goldhoorn
Unterwasserrobotik
Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 218-64100
Fax: +49 (0)421 218-64150
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