By Chris Bolduc, Jeremy Redgrift, and Zaid Ali
After some contemplation, both as a group and individually, we decided on one implementation. The first implementation we had considered was a sort of “back-and-forth” implementation. The robot would start in the center of the circle and move forward until it found the boundary of the circle, then it would back up to its starting point (the center), angle itself a little to the right, and repeat the process. We quickly discovered that this wouldn’t work due to there being no reliable way to determine the position of the center, or starting point, of the circle once the robot started moving. After more contemplation, we decided to use the robot’s photo-sensors to, in-effect, bounce off the boundaries randomly pushing cans out of the circle along the way. The exact way this would work is as follows: the robot would move forward until a boundary is found, rotate approximately 130 degrees and continue moving forward until another boundary is found.
The “bouncing” implementation we chose to use was not a terribly complex one. This enabled it to be both easy and quick to implement and understand as well as being flexible to change. The name “bouncing” that we gave to the robot’s implementation came from the description of its behavior. The robot would essentially bounce off each boundary like the ball in “pong” would bounce off the paddle. The program flow is divided up into three main phases or methods as are as follows:
Startup Phase: The robot starts a two minute count as soon as it starts moving for the first time; once the two minutes have been reached, all the processes are killed and the robot stops functioning.
Phase 1: The robot begins moving forward while searching for the boundary – which is in the form of a black line.
Phase 2: The robot completely stops and begins to rotate left approximately 130 degrees.
Phase 3: The robot begins to move forward again and returns to the behavior of process 1.