Homework 1: Basic robot maneuvers
CS88: Senior Seminar on "Natural" AI Methods
Spring 1998
Susan Fox
For this assignment you must work in groups of three or four
working with the Handyboard robot controller and the Legobug
(or some variation) robot chassis. There are only three Handyboards,
but enough parts to build 6 Legobugs. You must share the Handyboards.
Be careful with this equipment, it is expensive and delicate!!
This assignment has three main phases, due at different times. If
folks get these going on time, we'll try some more difficult tasks,
so don't procrastinate! The more difficult tasks are also more fun!
At the end of this assignment, we'll have a public robot demonstration
during and/or after class.
You must hand in one write-up per group for each phase.
This write-up should describe your algorithms, your experience, and
should include your (clean, commented, well-organized) code.
Unsolicited Advice: It is very easy to write hacked-up, "dirty"
code when working with actual robots. You write a bit of code, then
try it out, then tweak it. This will get you in a deep, deep hole
when it comes to more sophisticated tasks. Use good programming
style. Use data abstraction as you can. Good procedural abstraction
will save you endless time! Comment your code, and keep
around previous versions: don't overwrite unless you are sure you won't
need it.
Phase I: Basic wandering
Due Tuesday, February 3
In this phase you will become familiar with the basics of Lego construction,
and you will learn about Interactive C, the language for programming the
Handyboard. You'll start to implement some very simple behaviors for the
Robot.
- Build the "Legobug" according to the directions given
separately. You will get started on
this during class on Friday, January 30.
- Attach the Handyboard, and begin working with Interactive C. Try
a few simple programs like Hello World. Try directly controlling the
bug's motors interactively.
- Program the bug to move forward, then backward, then in a circle.
Write a program to make the bug move in a square (on the table).
Try that program with the bug on the floor.
- Make the bug wander randomly. Program it to stop when it hits
an obstacle.
- Next, make the bug respond well to obstacles. It should back
up, and turn to move in a new direction. Be sure it doesn't get stuck
in corners, even when their angle is acute.
- The ultimate test of this phase is successful wandering in the
bug "playpen" that I design. It will not be a simple square, nor will
it be a tight maze, but it will include some weird angles.
Phase II: Follow the yellow-brick road
Due Friday, February 6
In this phase you will program your bug to use its light sensor(s) and
follow a path marked on the ground. The bug will have to successfully
stay on the path and get from a starting point to a goal. The path
will be more constrained than in the previous section.
- First, design your light sensor configuration. How many light
sensors will you use? Where will they be attached to the robot?
Add the sensors to your bug.
- Next, program the robot to recognize the "path" from the "wilderness."
Test it in a variety of lighting conditions.
- Program the bug to follow along straight sections of the path. Can
it recognize when the path changes directions?
- Make the final product. The bug should be able to recover when the
path changes direction, to find the path if it loses it. Try to ensure
that it doesn't double back on the path it has already followed.
Phase III: Light-seeking
Due Wednesday, February 11
In this phase you will program your bug to navigate a playpen, seeking
to approach a light source. When it has approached close to the light
source, it should stop.
- Redesign your sensor configuration so that it will detect a light
source that is close to surface level.
- Decide how to detect the direction of stronger light sources, and
program the bug to move toward a light. You should be able to have
the bug follow a flashlight around.
- Test your algorithms in the playpen, with a fixed light source
and a complex walled environment.