User manual

RP6 ROBOT SYSTEM - 4. Programming the RP6
viour's outputs and forces the system to feed the motor-control with its own com-
mands. Obviously “Escape” has higher priority than “Cruise”.
With these two very basic behaviours, the robot will already start to cruise around and
explore its' environment. The sensor system simply consists of two sensors for detect-
ing collisions. Of course this is nothing for very complex behaviours.
Just imagine a situation in which you would have to move around inside your home
restricting your senses to two fingertips – no eyes, no ears, none of your other senses
to help you except these two fingertips, which have to be held straight in front of you
all the time...
The more sensors the robot gets, the more the complexity of the robot's behaviours
may increase! Typically an insect is equipped with a vast number of sensors, which
can even provide analoge values indicating the sensed intensity. You may easily ima-
gine how the system's “intelligence” could be increased by equipping the robot with
insect's compound eyes...
Here we use a procedure invented by Rodney Brooks (http://people.c-
sail.mit.edu/brooks/ ) around 1985, the so-called Subsumption-Architecture.
The original publication(s) can be found here:
http://people.csail.mit.edu/brooks/papers/AIM-864.pdf
http://people.csail.mit.edu/brooks/papers/how-to-build.pdf
but you may find other relevant documents and summaries
(The Internet provides lots of additional information – simply start searching!)
Example 12: Behaviour controlled Robot 2
Directory: <RP6Examples>\RP6BaseExamples\Example_05_Move_05\
File: RP6Base_Move_05.c
ATTENTION: The robot will move in this example program!
Next step is to add an “Avoid” behaviour, which uses the ACS to avoid obstacles in-
stead of first colliding with them. The three behaviours are structured as shown in the
following figure:
Of course collisions have to be considered as most important events and therefore the
“Escape” behaviour still has the highest priority level. “Escape” will suppress the
“Avoid” commands and similarly “Avoid” suppresses the commands of “Cruise”.
As soon as the IR-Sensors have detected an obstacle the “Avoid” behaviour just as
its name tells us - will initiate an avoidance-manoeuvre. If the left ACS-channel has
detected an obstacle the robot will drive a left turn and a right turn for the right ACS-
channel. If both ACS-channels detect obstacles, the robot will rotate to the left or to
the right according to the first reporting channel. The robot will even turn a bit longer
after both channels report free space again. The program uses stopwatches to control
these delay periods.
- 118 -