Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Playing Soccer with OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Axel Poigné <poigne@g...>
Subject: Re: [Caml-list] Playing Soccer with OCaml
Dear Rafael

> In order to implement a subsumption architecture in OCaml you would
> probably need to use the threads library to make one thread for each
> behavior you wanted to make the robot perform, and two more threads to
> get inputs from the robots sensors and arbitrate the access of behaviors
> to the robot's actuators.

Programming robots using threads is notoriously bad idea. More or less all
the robots I know of, and, in fact, the hard real time part of most embedded
systems are implemented using one execution loop only, "synchronously" to
use a more technical term. The loop works as follows: read the input
(sensor) data, compute the "state change" (decoupled from the environment),
write the output (actuator) data. The rationale is to obtain deterministic
behaviour of course depending on the input. Since input is somewhat "fuzzy",
in particular for autonomous robots with all kinds of sensors involved, one
at least wants to understand what the software does. In particular one wants
control behaviour to be reproducible. I believe that complex threading does
not necessarily contribute to these goals. To be explicit: I have seen a
couple of robocup robots just doing nothing because of a deadlock with
regard to threading.

Without wanting to raise a flame, I believe that ocaml is not particular
well suited to generate code of the characteristics described above.
Further, much of the power of ocaml is in the sophisticated structuring
mechanisms for data - that are quite useless in robotics where most data are
elementary, and must be: anything with a touch of recursion is devasting for
real-time applications, deadlines then depend on size of data.


Axel Poigne

PS. Though subsumption was an advancement more recent approaches try to fuse
behaviours in a more sophisticated way.

PPS This may considered as a reaction to the recent mail of A Joseph Koshy
as well

------------------------------------------------------------------------
Dipl.Ing. Dr.rer.nat. Axel Poigné       http://www.ais.fraunhofer.de/~ap
                                        mailto:poigne@ais.fraunhofer.de
Fraunhofer AiS                          Tel: (+) 2241 142440
Schloss Birlinghoven                    Fax: (+) 2241 142324
D-53754 Sankt Augustin
Germany 

------------------------------------------------------------------------
Have a look at our new language for designing Embedded Software

sE = Java + synchronous Languages  (http://www.ais.fraunhofer.de/~ap/sE)





-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr