Page 125 - The Unofficial Guide to Lego Mindstorms Robots
P. 125
114
five seconds, she assumes she can reach her starting point by turning around and driving forward for five seconds again.
T iming is not a very accurate technique. Variations in battery power, the material Minerva is driving on, and other
u npredictable factors will mess things up. Turning around, in particular, is not very reliable: Minerva almost never heads back
precisely the way she came. Minerva's directional transmission makes things more complicated, as well, because it takes a
li ttle time for the transmission to shift from one direction to the other. This affects the timing of Minerva's forward motion, as
the shifting time is also rec orded.
Rotation Sensors
Ideally, Minerv a should have some feedback about how far she's traveled and how far she's turned. You could, for example,
buy some rotati on sensors and attach them to inputs 1 and 2. If you put the rotation sensors on Minerva's two main wheels, you
w ould know exactly how many times, and in what direction, each wheel had turned. By assuming that the wheels didn't slip on
the ground, you coul d get a very accurate idea of where Minerva was, relative to her starting position. You wouldn't have to
w orry about the directional transmission any more.
Wheels do slip, sadly, so unexp ected terrain like driving over blocks would likely throw this method of navigation off as well.
S till, it's a step up from timing.
N avigation Tools
T here are seve ral generic navigation tools that you might consider attaching to your RCX to answer the question of location:
1. A magnetic comp ass would give a good indication of what direction Minerva was pointing. Feedback from the compass
re ading would allow Minerva to turn around with much better accuracy. The interface between the compass and Minerva's
inputs, of course, is entirely up to you and would probably require a bit of electronics hacking.
2. Triangulation is a commonly used navigation technique. Suppose you mounted three radio transmitters around the area
where Minerva was going to drive. By listening to the three signals, Minerva could determine her position relative to the radio
transmitters. Again, this is pretty high-tech, serious electronics.∗
∗ An obvious choice might be the Global Positioning System (GPS). Unfo rtunately, garden variety GPS is only accurate to 100
m or so. Unless you're the US military, or willing to spend some serious money, you won 't get accurate enough information
fr om GPS to help your robot navigate.