[Rock-dev] orocos.rb accessing complex task properties

Alexander Duda Alexander.Duda at dfki.de
Thu Dec 16 12:06:34 CET 2010


On Thu, 2010-12-16 at 10:38 +0100, Sylvain Joyeux wrote:

> > Therefore I would suggest to block calls like
> > task.property if the property is a class or a struct
> >
> > task.property.x = 123
> > should result in
> > "Warning: Use task.read(x) to access complex properties"
> Do you mean: use task.read('property') ?

Yes, I meant task.read('property')

> There are means to make "task.property.x = value" work. As stated, don't 
> like that, but I can make amends for the sake of simplicity

I am not sure if this a good solution, because the user will never know
that the property is sent multiple times. 

task.property.x = 1
task.property.y = 2
task.property.z = 3
will result in sending the hole property 3 times. Too much magic? 
But maybe this is still the best I can think of.

> Unfortunately, there are no ways to make a difference between
>    task.property.x = value
> and
>    property = task.property
>    property.x = value

Yes, that's why the hole starts to be non-transparent.

An other solution would be like I said.
prop = task.read('property') or maybe task.read.property
task.property = prop 

I believe an user would not do this (hopefully ;-))
task.read.property.x = 123

At least it would be more transparent.

I know there is no nice solution for it but at least we have to find a
way so we do not have to tell each new user 

task.property.x = 123 is not working because ...

Alex

-- 
Dipl.-Ing. Alexander Duda 
Unterwasserrobotik

DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-456620
Fax:   +49 (0)421 178-454150
E-Mail: alexander.duda 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