RCX Programming


Lesson 8

In this lesson we will continue with the small LEGO car from Lesson4. We will show how a reactive control strategy can be implemented with a decentralized behaviour selection mechanism as an alternative to the central behaviour selection mechanism of Lesson5. In the program with a decentral selection mechanism each behaviour is an independent process, that samples the sensor data that triggers its behaviour (SmallCarDecentralSelection.c). These independant processes might be considered as agents inside the car agent: They work autonomously each with their own goal.

In the program all four processes has access to the motors and they might issue motor commands at the same time. Could that be a problem ? Compare this with the solution from Lesson5. Try also to figure out how a speaker can be used by the four processes as in the car that do random walk accompanied by two kinds of musical sounds.

Independent processes can also be used to implement a LightFollower with two light sensors connected to two motors as described by Braitenberg. This has been done in the program (LightFollower.c) where there is one process for each of the two connections between light sensor and motor. This approach can also be used to obtain a car that follow a line or a wall. In the suggested LightFollower fixed constants are used as upper and lower bounds for light values. Look in Notes on construction of Braitenberg's Vehicles, Chapter 1-5 of Braitenbergs book to see how the LightFollower can be programmed to addapt to changing light conditions.


Access to the other include and source files.
Last update: 18-04-06