Datasheet

Chapter 4: Navigation Tips · Page 179
Press and hold the Reset button until you place it on the ring as shown in Figure
4-12.
Let go of the Reset button, and compare your search pattern to the one shown in
the figure.
Does your SumoBot mistake creases in the poster for white tawara lines? If your
SumoBot backs up and then executes a turn before it gets to the white tawara line, it may be
detecting one or more of the creases in the SumoBot Competition Ring poster. This is most
likely to happen when the SumoBot Competition Ring poster is in or near direct sunlight.
If your SumoBot is having problems detecting the creases on the poster, go back
to page 9 and make sure you have followed the setup instructions.
If the lighting conditions are still too bright, you can make the QTI self calibration code set a
lower threshold by changing this command:
multi = multi / 4 ' Take 1/4 average
Instead of dividing multi by 4, try 5, 6, 7, 8, 9, and 10.
The higher the value divided into multi, the lower the threshold, and the less sensitive the
SumoBot will be to creases in the poster. This is a bit of a double-edged sword, because it
also makes the SumoBot less sensitive to the white tawara line, and we don't want it to miss
that.
Tune your
FOR...NEXT loops so that your SumoBot's search pattern either starts
to resemble the one in the figure, or if you have a search pattern in mind that you
think will be effective, modify the State = search routine as you see fit.
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - SearchPatternAndAvoidTawara.bs2
' SumoBot searches the sumo ring for opponent and changes direction whenever
' it encounters the white Tawara line.
' {$STAMP BS2} ' Target = BASIC Stamp 2
' {$PBASIC 2.5} ' Language = PBASIC 2.5
' -----[ I/O Definitions ]---------------------------------------------------
ServoLeft PIN 13 ' Left servo connected to P13
ServoRight PIN 12 ' Right servo connected to P12
qtiPwrLeft PIN 10 ' Left QTI on/off pin P10
qtiSigLeft PIN 9 ' Left QTI signal pin P9
qtiPwrRight PIN 7 ' Right QTI on/off pin P7
qtiSigRight PIN 8 ' Right QTI signal pin P8