Thought I would want to share this.
https://github.com/BizzaBoy/AVC2015-KKThis is what we were running on Killer Kitty in the 3rd heat. Verbatim, not cleaned up (so I left all the bugs in ;-)).
I thought it might be interesting as it has a few cool things in it (other than an EKF scheme that would need some more work):
- bare metal, no RTOS ARM Cortex-M4
- systick/pendsv handler based scheme for deferred IRQ processing (navigation in pendsv handler)
- a profiler system to judge which modules take what time
- a stack checker using the MPU to detect stack overflows and underflows
- a nice exception handler that detects crashes, saves system information, gets the rover back into neutral state and then waits for a debugger to connect
- full speed async data logging onto a MicroSD card
- some TFT display code, which proved to be very handy in testing
- a NMEA/UBX/SRF/OSP GPS parser that handles PPS time stamping as well as the dreaded leap second correction; should work with MTK, UBLOX and SIRF units (well, I tested a bunch of them); GPS and GPS+GLONASS
- time stamped sensor readings
- MPU9150 code that will read back the embedded AK8975 compass at a 100Hz rate (well, how fast can you read useless data ;-)) [there is some HMC5883 code as well]
- a playback.c utility that reads back the log files, sorts entries to a time line and the prints them; the utility also has a simulation pass that allows to play the sensor data into the ekf/navigation/guidance code (very useful for debugging)
- a magneto.c utility to a magnetometer calibration (external source)
- heavy use of ARMV7M atomic primitives
- use a ARMV7M bitband operations to atomically set output pins on a GPIO port (quite handy and easy).
- a 6 state EKF that uses proper time sorted EKF_PREDICT/EKF_CORRECT sequences (i.e. corrects for GPS latency).
So there is a bunch to look at, and perhaps get others started faster. Maybe somebody forks over some BMO055 dead reconing code to me to look at in exchange ;-)
- Thomas