View Single Post
      11-28-2021, 06:22 PM   #1
TrackEnthusiast
Private
64
Rep
52
Posts

Drives: 125i 2014
Join Date: Jan 2016
Location: Brazil

iTrader: (0)

I did something really, really cool to get telemetry data

So, I needed to learn how to code (Node.js)... and since simply watching classes is not the way, you acctually have to code to learn, I taught to myself: "Well, maybe I should think of a project I would like to do". Than, being a trully track day addict, I decided "Ok then, maybe I should do something related to cars and racing" and then I remebered reading in this forums that many people were interested in getting the data from the MLaptimer app, so I decided to start there: making an web app to get the telemetry data from the app files to render videos. That was a pretty easy task and, when it was nearly finished, I discovered somethnig really, really cool. To explain what it is, I'll have to start from the beggining.

At that time, (6 months ago) besides learning to code, I also needed to buy an appropriate GPS to record my track activities (karting, tracking an old opel Kadett and a BMW 125i F20). The GPS data from MLaptimer, despite coming from the cars GPS, is as bad as the data from any smartphone, since navigation GPS chips operates at 1 Hz. So, I was allways browsing the web after a good deal for a Qstars or any other bluetooth GPS. However, they are expensive and also it would be a pain to integrate 3 different data sources: The video from the GoPro, the sensor data from the MLaptimer app and the GPS. I considered acquiring a OBDII stick and then using HLT or RaceChrono to put everything together, as many people do. My problem with this solution was that I know from previous attempts that data acquired with this OBDII dongles, many times, is not accurate. Also, that would be too many things to setup before getting in the track...

But then, for pure luck, the solution for his problem glanced right in front of my eyes: A friend of mine was showing me the footage of a kart session he acquired with his GoPro 7 camera and then rendered with race render, which also renders to the video the track drawing as acquired by the cameras GPS (all GoPro's from Hero 5 on have GPS). By watching the track drawing, I realized that the cameras GPS was really good, because I had recently drove that same track in a hot lap with my 125i and the track drawing I had from the cars GPS was pretty squared. Then, I asked him to show me the data file that race render generates from the GoPro video and, in the file, I could see that the cameras GPS was generating nearly 20 pts/sec. Then I had a blast: Why not using the GoPro to film and also as the GPS and then integrating the MLaptimer app data by synchronizing the high resolution GPS track from the camera with the low resolution GPS track from the app?

It took me a couple of months to code everything and also a couple of track days to test, but news is: IT WORKS BEUATIFULLY! Even with the camera inside the car, the GPS data from the GoPro is accurate enough to time the laps within 0.05 s. So, just to clarify how it works: You have to enable GPS in the camera and put it to record when you start your session, as you would normally do. At the same time you put MLaptimer app to record and, latter on, the code I wrote will process the video and the MLaptimer file in the browser and generates a .csv file wich you can use to render the data to the video with the app you like better. I used Dashware, since it is free and allows to personalize the dashes. Only thing it is windows only (sorry mac users).

Video rendered from the .csv file with DashWare:



At this point maybe you are thinking "rendering videos with dashes is not that cool, there are many other ways to achieve that, including the BMW OBDII dongle, which costs 200 bucks". And you are right, rendering videos is not the coolest part. What is really cool about the code I wrote is that, besides outputing the .csv file from the parsed data, it will also output a .vbo file which you can open with Circuit Tools and then compare your laps and sessions with all sensor data integrated!!! That is really cool, you can analyze your laps by sectors, ompare different racing lines, position of your braking, throtle modulation in the corners, and more, all in sync with the track footage!




Comparing 2 fast laps with circuit tools (my computer laged a little when I made the video, but you get the point). In the graphs below the video you can see throtle position and braking G-force (combination of brake switch signal with longitudinal G force). Besides that, you could also have graphs for gear (auto-only), engine RPM, GPS speed and g forces. So, how cool is that?
Appreciate 2
No one1044.50
M3 boi3211.00