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

Alexander Duda Alexander.Duda at dfki.de
Thu Dec 16 10:27:39 CET 2010


If you are trying to access a task property which is a struct or class
orocos.rb is not very transparent.

task.property.x = 123	# is not working

#you have to do it this way
prop = task.property
prop.x = 123
task.property = prop

This is because task.property is creating a new object
and .x= is modifying it but it is not written back to the task.
As far as I know there is no nice solution for it because of corba.

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"

task.property2 = 123   #should still work

Otherwise nearly all new user will run into it.

Thoughts?

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