Page 184 - The Unofficial Guide to Lego Mindstorms Robots
P. 184
173
9
R oboTag, a Game for Two Robots
In this chapter:
• Building Instructions
• Subsumption
Architecture
• Online Resources
RoboTag is a game for two robots. The robots drive around in a simple arena; the edge of the arena is marked by a black line.
When one robot bumps into the other robot, it shouts "Tag!" by sending a message out its IR port. The tagged robot must sit
still for a while, and then the game continues.
The two robots are identical. Each has two motor-driven treads. Each robot has a bumper on its front and a downward pointing
light sensor. The light sensor is used to detect the edge of the playing arena. When the light sensor "sees" the edge, the robot
backs up and turns to stay inside the arena.
When the bumper is triggered, the robot assumes it bumped into the other robot and shouts "Tag!" It waits for an
acknowledgement from the other robot (in the form of another IR message). If the acknowledgment is received, the robot adds
one to its current score.
When one of the robots receives the "Tag!" message from the other robot, it is obliged to send an acknowledgement and then
sit still for a short time. Then it starts up again, wandering around to tag the other robot.
RoboTag is the creation of Matthew Miller, who teamed up with a friend, Paul Stauffer, to build and program the first
RoboTag contestants. In this chapter, I'll use RoboTag as a way to explain subsumption architecture, an important paradigm in
robotics programming.