[Rock-dev] Assignment of a task to service by profiles
Christian Rauch
Christian.Rauch at dfki.de
Wed Sep 4 17:43:21 CEST 2013
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
--
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