I've wanted to add data overlays to my motorcycle videos taken with GoPro for some time. This project is my efforts to make it happen. Mainly I wanted to have an overlay that shows the current lean angle of the motorcycle.
The hardware serves two functions:
- Log GPS information.
- Start GoPro recording and GPS logging at the same time. This makes aligning the overlay and video easier.
Hardware
- ESP8266 - This is used to connect the the GoPro's wifi network and send the command to start and stop video recording. It is also used to do some parsing of GPS serial data and configuring the GPS at startup via the UART's.
- Openlog - Used to record GPS data to SD card
- GPS - Ublox NEO-6M, generates the GPS serial data.
Firmware (for esp8266)
The firmware for the ESP8266 has been developed with the opensdk. There are a number of functions, more or less following this order.
- Search and connect to Gopro wifi network
- Determine if a GPS fix has been achieved
- Trigger GoPro recording and GPS data logging simultaneously (well almost simultaneously). A led is also flashed at this time to help with syncing the video with data.
- Stop video recording and data logging (not yet implemented)
Here is a high level state machine.
Software (on PC)
A command line tool to generate the frames for the final video. The tool parses the recorded GPS data log, calculates an estimate of lean angle, applies a low pass filter to the output and generates png images that can be imported as frames for the video. Github link provided.
If you use a savitzky-golay filter, the lean angle will be much more responsive. It is more computationally intensive, but probably worth it (especially if done on the PC after the fact)