CS 372 Artificial Intelligence

Robot Building Lab

Session 4


Exercises for this week

Write a program for your robot to run around its environment trying to avoid obstacles in its way. Your robot needs a way to detect obstacles. You can either use touch sensors (ON/OFF switches you used for Dogged last week) or infra-red sensors. Infra-red sensors can allow you to sense obstacles even before the robot is about to hit one. All you will need is a pair of sensors, one mounted on the front left and one on the front right. Make sure that the sensors are sturdily mounted and no parts of the assmpbly will fall off during bumps. A simple strategy for this behavior could be to use the following simple set of control rules:

  1. If you hit an obstacle, or detect that you are about to hit one, on your left, stop, back up a little, and turn right just a bit.
  2. If you hit an obstacle, or detect that you are about to hit one, on your right, stop, back up a little, and turn leftjust a bit.
  3. If you hits an obstacle straight on, or detect that you are about to hit one, stop, back up a little, and turn left or right a bit.
  4. If there are no obstacles in the way, go straight.

These set of rules can be used to drive a robot through a maze. You may want to try the behavior in various maze configurations: mazes can be configured so that all turns are only right-handed turns, or only left-handed turns, or both. You may need to adjust your robot's obstacle turning behavior (especially in Rule 3) accordingly. Experiment with this.

You will also notice that the sixe of your robot can be critical to negotiating a narrow maze. Try to make the robot body as compact as possible with out extending too much beyond the wheels in the front or back.

Collecting Reactions

Once completed, you should invite some friends to observe the three creatures and record their reactions for discussion.

 


Back to CS372 Lab Pages | Back to CS372 Page