[Rock-dev] Regarding dynamic properties
Sylvain Joyeux
sylvain.joyeux at dfki.de
Fri Dec 20 10:35:06 CET 2013
On Tuesday, December 17, 2013 01:18:52 PM Matthias Goldhoorn wrote:
> They are quite stables so far, expect:
> they are in the end thought orocos.rb RPC (operations) on the task.
> The problem here is if, the underlying task is not (yet) running the
> often setting something on not-yet initialized members. This could be
> checked within the task, but i still find this ugly.
>
> I would prefer that:
> - the operation get's called if the task was already configured
> - the normal property get's set if the task is not (yet) configured
> - Syskit get's hang if the operation is called
>
> Each user then (which is normally the case) has to check during
> configuration time the value of the property.
>
> Thoughts?
I completely agree that this is a problem, and on the general solution (i.e.
that the property should be written if the task is not started yet and call
the user's setXXX method only if the task is running).
However, I would not do that in orocos.rb, but in the generated code:
- have a specialized virtual method (e.g. __orogen__setExposure) that is
the one called by the operation
- have this method either set the property or call the user-provided virtual
method (which would be still called setExposure) depending on the task's
state
- we would need to know in which hook the property gets applied (in
configureHook or startHook) to decide whether the set method should be
called as soon as the task is configured or only if it is running. By
default, I would say "configureHook". This would anyways be great for
syskit: we could avoid fully reconfiguring the task in cases only a
stop/start cycle is needed.
The reasons for that are:
- testing whether a task is running from outside the task's thread is
asynchronous. The task could have e.g. stopped between the time you check
and the time the operation is processed.
- it makes orocos.rb complex and the dynamic property stuff an orocos.rb-
specific thing (I would like to avoid that)
- the 'most-synchronous' way to test whether a task is running involves a
CORBA call, i.e. costly.
--
Dr. Ing. Sylvain Joyeux
Space and Security Robotics
DFKI Bremen
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 218-64136
E-Mail: sylvain.joyeux 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