Datasheet
Page 222· Applied Robotics with the SumoBot
In the first row, none of the sensors see anything, the state is search pattern (
SP), and the
SumoBot is starting by rotating right. On the second row, the SumoBot has detected an
object on its left, and the state has transitioned to track side left object (
TSLO). The
maneuver is rotate left (
RotLft). The object is then moved in front of the front-left IR
object detector. The state transitions to track front left object (
TFLO), and the maneuver is
curve left (
CrvLft). Then, the object is moved in front of both IR detectors, which
transitions the SumoBot to the go forward state (
GF) with the forward maneuver (Fwd).
The object is then taken away, and the left QTI is placed over the white tawara line. This
results in the avoid tawara left (
ATL) state, which starts out with backing up (Bkwd).
√ Leave the SumoBot connected to the serial cable as you set it on the competition
ring.
√ Set the 3-position power switch to position-1.
√ Enter, save, and run SumoWrestlerWithDebugMode.bs2.
√ Press/release the SumoBot's Reset button.
√ To emulate the output shown in Figure 5-2, start with an object on the
SumoBot's left side.
√ Move it from the left side to the left front, then in front of both IR detectors.
Then, take the object away, and place the left QTI over the white tawara line.
√ Experiment with various sensor events, and compare events displayed in the
Debug Terminal to what the program is supposed to do for each event.
√ Set DEBUG_MODE to 0 and download the modified program to the SumoBot.
√ Move the 3-position power switch to position-2.
√ Press and release Reset, and verify that the program now functions at full speed,
with no diagnostic code.
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - SumoWrestlerWithDebugMode.bs2
' SumoWrestlerWithStateSubroutines.bs2 modified so that
' you can toggle DEBUG_MODE between 0 (competition mode) and 1 (display mode).
' {$STAMP BS2} ' Target = BASIC Stamp 2
' {$PBASIC 2.5} ' Language = PBASIC 2.5
' -----[ Compiler Definitions ]-----------------------------------------------
#DEFINE DEBUG_MODE = 1 ' 1 -> full debug 0 -> wrestle
' -----[ I/O Definitions ]---------------------------------------------------