2
SKILL
LEVEL
Ringo Educational Guide Rev04.1 ~ Plum Geek
Here is a quick list of the navigation functions along with a short description of
each. These functions take care of the data communication between Ringo’s brain
and the sensors as well as performing the required math on the resulting data so
they are easy to use.
Base setup functions:
NavigationBegin();
This function turns on and initializes the gyroscope and
accelerometer. It is important to call this function before running the other
navigation functions. It can be called over and over with no harmful effects.
CalibrateNavigationSensors();
This function calibrates the sensors. Even
when the sensors are perfectly still, they do have a slight offset because
no sensor is perfect. To calibrate the sensors, we measure some samples
when they are still to see what this offset is. Ringo then remembers this
offset and subtracts it out of future measurements. The NavigationBegin()
function calls this CalibrateNavigationSensors(), so you don’t need to call it
a second time. It is important that Ringo is perfectly still when calling this
CalibrateNavigationSensors(). Vibrations or wiggles on your table will adversly
effect the calibration. The sensors should be recalibrated every so often. Keep
in mind that it is useful to place a delay() before each calibration to make sure
Ringo isn’t still moving from a previous motor operation, etc. Wait a second or so
to calibrate after the Reset or User buttons are pressed as the presense of your
finger on the robot will adversly effect the calibration accuracy.
ZeroNavigation();
Ringo keeps a memory of his X and Y location as well as
his rotation. The X location is left/right of his starting location, with a positive
number to the right, and a negative number to the left. The Y location is front/rear
of his starting location with positive numbers in the forward direction and negative
numbers in the rear direction. Units are in millimeters of travel. Rotation is in units
of degrees. Positive degress are in the right (clockwise) direction and negative
degrees are in left (counter-clockwise) direction. Note that the degrees do not
loop. For example, if you rotate one and a half turns in the clockwise direction,
the resulting rotation value will be 540. The ZeroNavigation() function zeros these
running X, Y, and rotation numbers to zero.
GetHeading();
The GetHeading() function returns Ringo’s present heading in
degrees.
Using Ringo’s Navigation