[Rock-dev] [roby] using of the state_machine

Sylvain Joyeux sylvain.joyeux at dfki.de
Fri Apr 12 10:05:10 CEST 2013


On 04/12/2013 08:32 AM, Matthias Goldhoorn wrote:
> ...an given define is working...
>
> e.g.
>
>       define "mantis_walker",
> Limes::MantisWalker.use(mantis_control_loop_def)
>
>       describe('moves the robot in a forward direction').
>            optional_arg('speed_x',"The walking speed").
>            optional_arg('time_out',"The walking speed")
>       state_machine "walk" do
>           cmp = state mantis_walker_def(:speed_x => speed_x, :time_out =>
> time_out)
>           start(cmp)
>       end
>
> P.S. is there a way to forward all arguments diretly instead
> re-assigning all of them manually?
#arguments is a hash, so

   state mantis_walker_def(arguments)

and, by the way, this "walk" state machine is not necessary (so far), 
since the same interface is already provided by mantis_walker_def itself:

   mantis_walker_def!(:speed_x => ..., :time_out => ...)
> But i would prefer the way to directly use compositions there.
> I don't need to call some Compositions, and for them, and the use of
> them within an state machine i need an forwarding-define.
> Thats slightly annoying.
You always need to be able to call the compositions directly: testing in 
syskit instanciate, runtime-testing the single states, so on, so forth.

What I want to have as well is integrate them in unit-testing, to check 
that all the definitions in a system can be deployed (checking against 
syskit regressions & against changes in the component definitions)

> Second, why we need defines in general?, Couldn't we make Compositions
> Transparent, so that everywhere (also inside the shell) an Composition
> can be called directly?
> Don't see (currently) the point to make an differentiation here.
Same: by using defines, you get to be able to test OFFLINE and OFF THE 
STATE MACHINE each of the single states. Harder without. Making 
compositions directly available in the shell is possible, but would 
require quite a bit of work (we would need to be able to 
marshal/demarshal the InstanceRequirements objects).

Everything is an action, *including* the definitions.

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