There is a gyro and an accelerometer on board. Still need to get to documenting them, but here are a few notes to get you started.

These are the exact same parts as on our Ringo robot, and we use the same code. Have a look at the Ringo guide book in the navigation section. This is out dated, but will get you started.

The navigation functions written for Ringo were done by a friend a few years ago, and they have a lot of room for improvement. If you're able to understand them I sure would appreciate any help in re-writing them so they are more simple to use. The existing ones were kind of a "do everything for everyone" thing and they are very complicated to use outside of just calling them as intended. Maybe it's just because I didn't write the code but I always get all stressed when I have to do anything with those functions.

The parts used are an MMA8451Q (the accelerometer), and an L3GD20 for the gyro. The accel is placed directly over the drive axis directly in the center of the robot.

One thing to keep in mind with the accel (as you're probably already well aware), is the acceleration due to gravity is generally more than movement, so very slight tilting causes the accel to loose position quickly. There are functions to calibrate the nav sensors though, so as long as your "starting" angle where the cal is done is generally maintained, it works pretty well.

I know there is code available for these for python as well, and I have been able to read them from the Pi, but never got the software implemented beyond that point.

I notice that the navigation functions are in the BaseSketch, do they work exactly the same as on the Ringo? Ok I see that they differ from the documentation, GetHeading doesn't work but PresentHeading() and GetDegrees() are both present.

Also saw some interesting comments on using the IMU to correct drift while moving!

// ************ THE SETUP ITEMS BELOW SHOULD GENERALLY BE USED FOR ALL SPIRIT SKETCHES **************

hardwareBegin(); //initialize Spirit's Arduino processor to work with his circuitry SPI_Reset(); //resets and turns on the SPI port playStartChirp(); //Play startup chirp and blink eyes servoCenters(); //Place all servos back in default position