CS 372: Artificial Intelligence
Robot Building Lab

Session 3

Resource Kit
Outfitting A Robot Laboratory
Sample Syllabus for an AI Course
Robot Laboratory Handout
Session 2
Session 4



Last week, you learned how to wire up motors to the handy board. You also learned how to write and download IC programs from your computer to the handy board. This week, you will give demonstrations of the results of your exercises from last week:

  1. Show that your robot can go around a 2ft by 2ft box. This utilizes the fact that you provided the robot with a measure of how far it goes in a given time. Also it will need to use a procedure of turning 90 degrees. You will notice that the surface on which you calibrate your robot's speed as well as turning angle makes a big difference. Did you provide for that allowance? How?
  2. Moving in a circle. Again, the surface plays a big role here in order to make the robot go a measured diameter.
  3. Figure-8. This is a simple adaptation on the solution of the circle exercise.


Touch Sensors

Today you will be handed two touch sensors. These are simple momentary switches The switches remain closed/opened only while the latch is pushed down. These can be wired across the digital ports (between 5V and ground) so that reading the value on the port will return a 0 or a 1 depending on if the default configuration is open or close and the latch being pushed or not. With an extended assembly (made out of LEGO beams or other similar objects) you can mount these on your robots so that they act as touch sensors. I.e., they can help detect if the robot has bumped into something.

After your demos today, you should plug the handy board into the computer. Plug in the switches in the digital ports (ports numbered 7 through 15). The IC command


digital(PORTNUMBER);


returns a 1 or a zero depending on the inputs to the port numbered PORTNUMBER. Issue the command several times to determine the values returned when the respective switches are open, as well as closed.


Exercise

Imagine your robot in an environment that has a 1.5 ft corridor going around a 2 ft by 2 ft square box. Write a program that will enable the robot to go around this box. This time, as opposed to the exercise from last week, the robot will go in a straight line until it bumps into a wall. After a bump it will proceed to make a 90 degree turn (you may need to have it go backwards a little to enable turning room) and then continue again in a straight line.

This task can ideally be accomplished using one touch sensor. But it will rely on being able to make perfect turns.

Can you circumvent the problem of perfect turns by using more than one touch sensor?

An alternative to the solution above would be to continuously touch the inner wall and follow it all the way around. Again a touch sensor could be used.


Other Possible Behaviors

Think of some other behaviors that could now be accomplished by using the touch sensors. Can you use it so that it detects the edge of a table, in order to avoid a fall?



Resource Kit
Outfitting A Robot Laboratory
Sample Syllabus for an AI Course
Robot Laboratory Handout
Session 2
Session 4 ÿ