[Rock-dev] Roby Bug Hunting Part #2

Sylvain Joyeux sylvain.joyeux at dfki.de
Wed Nov 7 10:01:32 CET 2012


On 11/06/2012 05:59 PM, Chris Mueller wrote:
> Hey Sylvain,
>
> here is another feedback to your latest commits in roby:
>
> 1) RuntimeError for setting Planning Descriptions via describe("..")
> Seems not to work on my machine. If i comment out all describe, it works.
describe() itself works absolutely fine on my machine. Could you try to 
isolate that error by creating a new bundle with "just" a test case that 
fails (and sending the tarball ...) ? Or better, isolate it in a test 
case in the Roby test suite ...
> 3) Here is maybe another misunderstanding i ran during some
> reimplementing of our methods.
>
> class SuperiorTask < Roby::Task
>       argument :variable, :default => 42
>
>       script do
>            # execute do
>                var = self.variable
>            # end
>       end
> end
>
> - Is this actually possible?
> - Is an execute block needed for getting the current argument value?
> (Don't know if the script plan is evaluated at runtime or startup. If
> the last case hits, i expect it would store the default value though an
> error message is also reasonable).
As stated here in a big red block ;-)
http://www.rock-robotics.org/master/api/tools/roby/building_plans/tasks.html#scripts

The script block is evaluated at the point of definition. You *have* to 
use execute { }
> * With execute block it seems to work.
> * Without i get an error message, self.variable is not defined
> (method_missing? error).
The error message should be different ... The issue is that, at 
definition time, no tasks are associated (yet) with the script.
> This seems maybe obvious from the low-level perspective in roby but is
> maybe confusing if you know this similar use case with planning methods:
>
> method(:superior_method)
>        var = argument[:variable]
>
>        script do
>             # variable is known in this block
>        end
> end
This difference has nothing to do with Roby, but with the Ruby language 
itself ! The same example works in task models:

class MyTask < Roby::Task
   var = 10
   script do
     # var is known in this block
   end
end

-- 
Sylvain Joyeux (Dr.Ing.)
Senior Researcher

Space & Security Robotics
Underwater Robotics

!!! Achtung, neue Telefonnummer!!!

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

Phone: +49 (0)421 178-454136
Fax:   +49 (0)421 218-454150
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
-----------------------------------------------------------------------



More information about the Rock-dev mailing list