/* ----------------- Bumper for bioloid car --------------------------------- */
bumper:at (irC > 100) // at obstacle detection
{
wheels = 0 | sleep (500ms); // stop and wait a bit
wheels = -50 | sleep (1s); // go backward
wheels = 0 time:1s | // stop smoothly
wheels = 100; // go forward
};
wheels = 100; // initial start
/* ----------------- Bumper for bioloid car --------------------------------- */
This should make your bioloid car go forward, stop before the first obstacle,
go back for a bit and go again. You will have to figure how to make it
stop. You must load bioloid_car.u before executing this script to have good result.
(it's better to have a robot with 4 wheels to have a good look of the behaviour, see description of motors in
bioloid_car.u).