[Rock-dev] Device/Deployment Matching in Roby
Janosch Machowinski
Janosch.Machowinski at dfki.de
Tue Aug 21 13:14:30 CEST 2012
Hi,
there is also a use_deployment statement:
define('eslam_mapping', Cmp::Eslam.
use('filtered_laser', 'xsens_imu', 'stereo', 'sweeping_laser').
use_frames('lcamera'=>'lcamera', 'odometry'=>'odometry')).
use_conf('mapping').
use_deployments(/mapping/)
Greetings
Janosch
On 20.08.2012 18:24, Chris Mueller wrote:
> Hi Roby-Users,
>
> i've currently met another magic behaviour in roby that is probably
> not known for everyone and i think personally not very obvious, especially
> for new roby users. The documentation mentioned this feature indeed,
> but i would recommend to add more concret details for it.
>
> I've already mentioned in the past, that it was not clear for myself
> how roby is choosing the correct physical deployment
> if there exists more than one deployment providing a specific Orocos
> Task. This issue is documented in:
> http://rock-robotics.org/master/documentation/system/subsystem_design.html
> (Topic: Orocos Deployments)
>
> It says this is usually a policy issue and especially for roby devices
> there is clear rule how it works.
>
> "If the task context is a device driver, i.e. needs to access
> hardware, ambiguities are not acceptable (one deployment might have
> access to the required hardware while the other has not). In this
> case, the deployment that has the same name than the device will be
> used (if there is one), or an error will be generated."
>
> If have currently some trouble to use this description for the concret
> implemention.
>
> Here is a short example. Assume you have the following deployments:
>
> simple_deployment("pwm_led", "pwm_gumstix::Task")
> simple_deployment("pwm_servo", "pwm_gumstix::Task")
>
> In your config/ directory you have a ruby file that defines all robot
> devices. e.G:
>
> Robot.devices do
> device(Dev::PwmControl, :as => "led").with_conf("led")
> device(Dev::PwmControl, :as => "servo").with_conf("servo")
> end
>
> With driver_mapping in models/orogen/pwm_gumstix.rb:
>
> class PwmGumstix::Task
> driver_for "Dev::PwmControl" do
> provides Srv::AnyService
> end
> end
>
> The concret problem is now: How can Roby match the correct deployment
> process to the right device and if you try to instanciate the current
> model
> for this example you get an error of the form:
> multiple deployments for Dev::PwmControl: pwm_led, pwm_servo
>
> The solution is very simple: the ":as" property is not only an
> internal identifier for the roby devices. The name of this property
> must also match the
> name of a existing deployment. This is some explicit mapping mechanism
> that was completely unknown for myself and its very helpful to know,
> if your system has several devices using the same TaskContext type.
>
> Here is the simple fix for this problem:
> device(Dev::PwmControl, :as => "pwm_led").with_conf("led") # for
> deployment pwm_led
> device(Dev::PwmControl, :as => "pwm_servo").with_conf("servo") # for
> deployment pwm_servo
>
> Hope you are not struggling about that like I did.
>
> Chris
>
>
> _______________________________________________
> Rock-dev mailing list
> Rock-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
--
Dipl. Inf. Janosch Machowinski
SAR- & Sicherheitsrobotik
DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 178 45-6614
Fax: +49 (0)421 178 45-4150
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
-----------------------------------------------------------------------
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20120821/09c097d4/attachment-0001.htm
More information about the Rock-dev
mailing list