[Rock-dev] improvement TaskContext.get

Alexander Duda Alexander.Duda at dfki.de
Thu Nov 3 15:59:03 CET 2011


On Thu, 2011-11-03 at 15:26 +0100, Sylvain Joyeux wrote:
> On 11/03/2011 02:51 PM, Alexander Duda wrote:
> > Currently I have a helper method for this in Vizkit.rb but I think it
> > would be nice to move it into the method get
> >
> > thoughts?
> I cannot disagree more. That's looking too much like silent error to me, 
> and forbids giving any information about the reason for the failure.

I agree that this behavior is not useful for starting components on the
robot but for a user interface it is a little bit different. And by the
way the method port is playing the same game.
        
def port(name, verify = true)

> I also don't like the caching behaviour ... I'm not sure of seeing all 
> the implications of it, and that's a too important method to play that game.
> 
> Here's what I would propose: implement TaskContext.find(expression) 
> which returns nil if the task cannot be found (but no caching !).

What's bad with caching? 
task.ping is verifying if the task is still valid. If this kind of
caching is a problem all scripts will run into this because they all
cache tasks,ports etc.

by the way the corba name service is heavily caching as well.

Alex

> Ideally, the base method would even be find_all(expression), which 
> returns all the tasks matching the expression (so that 
> find_all(:provides => 'camera_base::Task') returns all cameras for 
> instance). #find and #get would simply be built on top of it.

-- 
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