Activity #6

Stay in bounds


810:159, Robotics Laboratory

Spring Semester 2008


ENVIRONMENT :

A flat surface with a "floor" of relatively uniform color.  This color can be either relatively light or relatively dark.  Additionally, there is a boundary or "warning track" consisting of a band of color at the opposite end of the brightness spectrum from the floor (dark-on-light or light-on-dark).

GOAL :

"Freely" move about but remaining within the bounds of the environment.

DETAILS : 

One way in which a robot to sense its "location" is to use the concept of a "warning track" -- think of a lawn mowing robot that senses a buried wire.  That is, the robot moves about the environment until it senses that it has encountered the warning track.  At that point the robot would perform some sort of response which would ensure that the robot remains within the boundaries of its environment.

For this program, you will be creating a boundary detecting robot using the light sensor.  For original testing purposes, you may use your Test Pad and you may assume that the environment has a light (white) floor with a dark (black) warning track.  However, your finished code should allow for the environment to have the opposite configuration.  That is, I might put some light masking tape on a dark table and use it as a larger testing area (probably with an irregular shape).

There are at least three ways in which your robot can decide whether it is avoiding a dark warning track or a light warning track. 

  1. You could allow for a boolean variable in your code which is set just prior to download to the NXT.  This is the most restrictive technique because it requires you to redownload the code if we change environments.  However, it is probably the easiest and I WILL accept it. 
  2. You could allow for a boolean variable in your code which is set via input on the NXT brick.  Using this technique you would have your robot wait for user input via the buttons (using TextMenu?) before the robot begins movement. 
  3. You may sense the color of the floor when the program first starts running, and avoid significant light shifts toward the opposite end of the brightness spectrum.  Using this technique requires making the assumption that the robot is placed within the environment at start up but that fact is given in the environment description above.  This is probably the best solution in that it allows for your robot to be truly autonomous (no need for input from a controlling human).