Datasheet
Page 178· Applied Robotics with the SumoBot
FOR counter = 1 TO 12 ' Look right
maneuver = RotateRight
GOSUB Servos_And_Sensors
IF sensors <> 0 THEN GOTO Next_State
NEXT
FOR counter = 1 TO 24 ' Look left
maneuver = RotateLeft
GOSUB Servos_And_Sensors
IF sensors <> 0 THEN GOTO Next_State
NEXT
FOR counter = 1 TO 12 ' Re-align to forward
maneuver = RotateRight
GOSUB Servos_And_Sensors
IF sensors <> 0 THEN GOTO Next_State
NEXT
Next_State: ' Exit point of search pattern
ENDIF
LOOP
Figure 4-12 shows the search pattern. Because your servos may behave differently, it
will probably take some tuning to get your SumoBot to perform this search pattern.
While this search pattern works reasonably well, there's lots of room for improvement.
We'll take a closer look in the Your Turn section.
Figure 4-12
Sample SumoBot
Search Pattern
Example Program: SearchPatternAndAvoidTawara.bs2
√ If you are using the SumoBot Robot Competition Ring Poster, make sure that
you have followed the poster setup instructions (starting on page 9).
√ Enter, save, and run SearchPatternAndAvoidTawara.bs2.