In this lab session we will construct and program a sumo wrestling LEGO robot and at the end of the lab session the sumo wrestling LEGO robots will fight against each other in a sumo arena as described in Figure 1. Based on the ideas in Express bot, a fotobased building instructions for a base car with extensions, a simple LEGO sumo wrestler can be build (click on the image to see details): The LEGO sumo wrestler consist of the four modules: a base car, a rear castor wheel, a light sensor and a pusher (click on the images to see details): The four modules can be build after the Lego Digital Designer (LDD) building instructions: SumoBase.lxf, Rear.lxf, LightSensor.lxf, and Pusher.lxf. The four modules are assembled as follows with a motor and sensor wiring that prevent wires to stick out (click on the images to see details):
LEGO robot that exhibits several behaviorsTry out the program SumoBot.java on the sumo wrestler LEGO robot in the sumo arena. The classes needed to run this program are in Classes.zip. Observe the robot and try to identify the different observed behaviors that the robot exibits and the circumstances that triggers the different behaviors. Look at the LCD and try to interpret the output.Behaviors as concurrent threadsFred Martin describes how a control program for a robot can be structured according to the reactive strategy, [2]. He give en example of such a program with three different behaviors as shown in Figure 2. Each behavior is described with two components: a condition that triggers the behavior and actions that are performed when the triggering condition is true.
The SumoBot program is also structured according to the reactive strategy. In the program there are three behaviors that are very similar to the behaviors in Figure 2. They are: AvoidEdge, Turn and Drive. If you look into the SumoBot.java program you will see three objects corresponding to the three behavors: Look into the three classes and try to identify how the triggering condition is implemented in each of the classes and how the actions for each behavior is implemented. Class BehaviorEach behavior thread is an extension of Behavior.java which is an extension of
In the Behavior class a suppression mechanism has been implemented so that only one behavior at a time can have access to the driving motors. When a behavior wants to have access the suppress method is called to suppress access from lower priority behaviors to the driving motors. The method release is called when the behavior no longer needs access. The suppression mechanism were inspired by Rodney Brooks subsumption architecture, [1]. An instance of the class SuppressNode is used by other behavior threads to suppress motor commands from this behavior. How is this instance variable used to implement a suppression mechanism in Behavior.java to obtain controlled access to the motors ? Compare this with the arbiter of Fred Martin, [2, page 214-218]. Add a behavior OverturnOpponentMount an ultrasonic sensor in front to detect the opponent and a motor to drive a mechanism that can overturn the opponent when the robot is close enough to the opponent. Look into base car with extensions for building inspiration.Add a behavior OverturnOpponent to the SumoBot program. |