Datasheet

Chapter 4: Navigation Tips ยท Page 157
Figure 4-6
Nearby Opponent
Seen by one IR
object detector, but
not for long if curving
is the only method
employed.
You can also program the SumoBot for more complex maneuvers, such as curving for a
while, then rotating in place. With a limited amount of curve time, it gives the SumoBot
a chance to get lined up with its opponent if it is close to making contact or has already
done so. If the opponent is across the ring and traveling away from the eye that detected
it, following a limited curve by a rotate in place can really help.
This activity introduces some coding techniques for orchestrating single and multi-step
maneuvers like the ones just described. Your SumoBot can use them to more effectively
face its opponent. With some experimentation, you will likely settle on an optimal
combination like curving and then rotating in place, or maybe curving, then pivoting.
The final choice will be yours. The final choice of how long to curve, then how far to
rotate in place will also be yours.
Executing a Maneuver While Watching the Sensors
This next example program makes the SumoBot pivot in place if it detects an object with
only one eye. It pivots in place until it sees the object with both eyes, then lunges
forward.
Remember, pivoting is probably not the best maneuver for this job. This example
program uses it because it's both easy to explain, and easy to test. This activity's Your Turn
section will introduce a more effective technique.
Regardless of whether it's pivoting, curving in place, or curving then rotating in place, the
key to making the maneuver successful is checking the sensors as often as possible. One