In the fall of 2015 my research group at Carleton Univeristy was involved in a data gathering project with the goal to assess the effects that various types of speed bumps have on city bus ride quality. The City of Ottawa was interested in installing more speed bumps in residential neighbourhoods and the city bus service, OC Transpo, was concerned about the effect this would have on their buses.

The data acquisition equipment that we used included string potentiometers on the wheel suspensions, accelerometers at various locations inside the bus, a GPS unit mounted on top of the bus, and a camera mounted behind the driver. For two weekends we instrumented the buses on Saturday and drove the buses over the various types of speed bumps on the Sunday.

My responsibility on the project was to manage the data from the video camera and the GPS, and to ensure that their data could be synchronized with the string potentiomter data. I was also tasked with marking the locations of the speed bumps in the data in some way.

I wrote two small C++ programs for this project, one to be used during the experiment and one for post-processing.

The GPS sensor that we used was the Garmin GPS18x that connects to a PC by USB. I installed a software package called Franson GpsGate which can be configured to receive the data from the GPS hardware, and then output it in a variety formats/protocols. I used this program to output the GPS data by UDP, and then my program received the sensor data over UDP. I selected this strategy because I have considerable experience in using UDP network connections to communicate binary data. The program I developed is shown in the image below:

The software automatically establishes the UDP network connection to Franson GpsGate whenever it is running. The main buttons in the UI are very large because I ran the program on my Microsoft Surface and used the touch screen to control it. The user interface provides status information when it is connected to GpsGate and indicates the file name if it is recording to disk. Each time the "Start Recording" button is pressed, the program starts recording to a new file. When the data is saved to disc it is recorded in the NMEA standard for GPS data with one change: I added a timestamp to the start of each line that indicates the relative time since the start of the recording at which the message was received.

The event marker buttons were used to indicate when the bus drove over a speed bump. When a button is pressed, the program stores an entry in a separate file from the GPS data (but with a matching filename) with the timestamp of when the button was pressed and the button's label. So as long as the user of the program pressed the event markers at the correct times, the GPS coordiantes of each of the speed bump events could be determined.

The second software program that I developed for this project loads the GPS and event marker data files and provides various options for outputting that data, with the primary functionality being that the path the bus took and the event marker locations can be viewed in Google Earth.

Here is a screenshot of the program after data has been loaded:

The table on the left indicates the number of each type of GPS message that are contained in the recording. The list on the right is the list of event markers. The Google Earth export extracts timestamps and GPS coordinates from the $GPRMC messages and generates a KML file containing those coordinates and the coordinates that match up with each of the event markers. Here is a sample of the resulting plot in Google Earth: