autosportlabs / RaceCapture-Pro_firmware

Firmware for RaceCapture-Pro Data Acquisition, control and Telemetry system for motorsports
GNU General Public License v3.0
66 stars 35 forks source link

test: add test to validate distance calculation #1100

Closed stieg closed 3 years ago

stieg commented 3 years ago

When reviewing my code for a presentation I thought that I might have a bug in my distance calculation and thus wanted to validate that it was there and needed fixing or that it was not and learn where I was wrong. Turns out there is no bug when compared to an extermal tool using a the Haversine method to calculate the distance. The only concerning bit is that our calculation is off by about 0.5 meters at 75 meters distance.