Project: Obstacle Avoidance
Project Description
You will write a program governing robot behavior so that it avoids obstacles. Since one obstacle is boredom, you will also make the robot do something novel when it has been repetetive and dance every so often because life is too short not to.
Working in pairs, you will develop a program that includes these elements:
- The robot should move so as to avoid obstacles in the room.
-
If the robot performs the same two turns in a row (e.g. two right
turns), the robot beeps and turns for a second or two (before
performing any further movements).
- Note: The beep/turn around activity applies only when there are two turns, so going forward or backward twice in a row does not count!
- To accomplish this requirement, you likely will need at least one variable that keeps track of the previous robot activity. This variable is updated after each action. After a turn left or right, this variable can be consulted to determine if the previous move was the same type of turn.
- Every ten actions, the robot performs a short dance three times in a row (the dance can just be a few actions).
- The program contains at least one
ifstatement. -
The program contains a
switchstatement or a secondifstatement. -
The program contains at least three loops; at least one must be
a
forloop, and at least one must be awhileloop. - The program uses eSpeak to announce each time it turns, each time it moves forward or backward, and each time it performs its short dance after ten other actions.
Note: The robot's motion need not be continual; you can interleave short motions with sensing operations.
Together with the program, your commentary must describe what steps are needed to demonstrate the program is working correctly (this can be pseudocode).
Grading
In addition to the general grading guidelines for evaluation, the project is worth 25 points.
- [4 points] Program guides robot through a sequence of moves
- [4 points] Robot avoids obstacles encountered
- [4 points] Robot beeps and turns if it performs two turns in a row
- [4 points] Every ten actions, the robot performs a short dance three times
- [3 points] Uses eSpeak to identify actions
- [3 points] Uses at least two
ifstatements or oneifstatement and oneswitchstatement - [3 points] Uses at least three loops (as specified)
-
Comments on Program Format, Comments, Readability, etc.
(Points not given, but points can be deducted.)
