Blog Fast Cars by Robert Pepper 15 February 2023
Mapping a GPS-traced racing line as a GPX file on Google Maps
If you want to better your laptimes, then you need help because despite what we may think, few of us are born quick and even those that are benefit from assistance. In the early days that’s instruction, but when you’re chasing tenths or less you must have data.
Unfortunately, even in 2023 datalogging for amateur racers is nowhere near as simple and easy as it should be. So I hope this blog post helps a few people who want more accurate data, and welcome ideas and input.
I’ve started using a Racebox datalogger/laptimer and have to say I’m fairly impressed. It’s easy to use, just switch on and it logs. 10Hz frequency, so a nice detailed output of where you’ve been on the track. A full review will follow on my YouTube channel in due course.
The image below is of two tracklogs of exactly the same lap; the red line one is an Android phone at samping position at 1hz, the blue line is the Racebox at 10Hz. One is usuable, the other is not.
You can add a 10Hz Bluetooth GPS receiver to your Android phone, but that is yet another bit of electronic gear to fit, charge and go wrong just before you’re called on track. So I’ve got one but don’t often use it, preferring the reliable simplicity of the Racebox although that doesn’t offer OBD2 connection for car control inputs.
The datalog output from the Racebox via its associated website can be a .vbo file for analysis in the free Circuit Tools program which is a good tool for looking at exactly what’s going on with your driving, or a GPX file which is a standard format for tracklogs.
I exported a lap as a GPX file and loaded it into Google Maps, but it was quite a long way off, around 5-10 metres which is a long way when you’re trying to be accurate down to maybe half a metre. You can see below the original file has me approaching a distance from the left side of the track, missing the apex, and running off the track on exit. I suspected the calibration of Google’s map of the area is a little out; I used to deal with map calibration a lot back in the day when I scanned paper maps and manually geocalibrated them.
And in the Racebox website map it looks like Racebox uses the same Google Maps data as its calibration is also a little out:
I couldn’t find a way in any software package to shift a GPX file’s coordinates north/south and/or east/west so I just wrote one in PHP and it matches much better now, but not perfect. I haven’t made the PHP GPX shifter publicly available but will do if there is sufficient demand – I’ll need to tidy the UI and do some security work, none of which I feel like doing on the off-chance anyone wants to use it but I am happy to share the source code. Anyway, this is the result:
That’s a much more accurate representation of my line (I’ve also made the traceline thicker to represent a car width), but still not quite perfect. Then I realised why – I had the Racebox on the right hand side of the car, not central…and it’s sensitive enough for that to make a tiny difference. I can’t correct that in software so I’ll make sure it’s central next time I lap PI.
Metre-level accuracy is important. Looks like someone, maybe BMW was running an event the day the satellite took the photo, and that shows you the scale and detail of the tracklog.
I do think that if a lap is ideally driven and then mapped in this way it’ll be a very easy and effective way for people to learn a racing line, no need to get familiar with weird and wonderful software like Circuit Tools. So I’m doing this R&D for training reasons, I don’t need it for my own analysis as Circuit Tools is generally better.
If you’d like to see the whole Google Map then follow this link. If you want to see video of the lap I took the datatrace from then it’s here, and if you want to see how the Racebox can be used to make you faster, watch the video below.