Hi .... I'm playing with data from a OSQ (One shot quali) and struggling to work out a laptime that corresponds with that shown in the game.
As there's no end of lap event and there's no lap 2 data to get the Lastlap data from the best i can work out is that I can use the last recieved LapData packet and try and take a best guess.
So for example I have captured a full laps worth of data and have the last lapdata packet send from the game... when I get the SEND event I know we are complete so i perform the following calculation. Taking the last position in the lap (distance), work out how far it is to the end of the lap (track length from a session packet - lapdistance from the Lapdata packet) ... calculate speed in meters/sec from speed in the telemetry packet and then calculate the time it would take to travel the remaining distance.
Sound logical ?
The trouble is that the result i'm getting is significantly different to what i see as a game time.
From an example data capture ... Current Lapdistance of 5895.4595 meters, total tracklength of 5896 meters and current laptime of 96.11017 secs and speed of 242 kph ....
5896-5895.4595 = 0.5405 meters
242/3.6 (to convert to m/s) = 67.222
0.5403/67.222 = 0.0080405 seconds (time to travel remaining distance)
Total laptime is 96.1182
BUT the time reported in the game was 96.136 but that's 0.0177 out from my calculation ...... Is there a better way to calculate this ? Am i missing something ?