Questions about various lap time values and sending over CAN
Posted: Sun May 19, 2019 1:35 pm
I have a RCP/MK2 integrated with an AEM CD-7. I have two routes I can go
1) The AEM dash can calculate all of the timing stuff on its own via GPS data. I can simulate AEM's GPS unit (already partially done -- https://gist.github.com/thoraxe/37b7e3c ... lua-L3-L67 ) but I have to add "course" which I think is really just direction. Need to check with them
2) I can use the RCP lap data and send it over CAN and then display it on the CD-7. While this is easier, the CD-7 supports more lap functions than the RCP.
https://wiki.autosportlabs.com/RaceCapt ... Statistics
Here are the RCP lap functions:
4.7.1 getLapCount()
4.7.2 getLapTime()
4.7.3 getPredTime()
4.7.4 getAtStartFinish()
4.7.5 resetLapStats()
Here's what the dash supports:
* previous lap time
* predicted lap time
* lap count
* fastest lap time
* current running lap time (elapsed time in the present lap)
* last lap's delta against fastest lap
* +/- prediction bar
It looks like some of these align with existing functions, but some do not. All would need to be sent over CAN. The question is whether or not it makes sense to just calculate the current course/heading (to use the built-in AEM functions) or to do it via the RCP (which will require a lot more scripting).
Let's go through the above:
previous lap time
getLapTime()
predicted lap time
getPredTime()
lap count
getLapCount()
That's it for the builtins...
fastest lap time
RCP doesn't calculate this according to the Lua guide. So a variable would need to be created and then a small scriptlet (is getLapTime() < fastest_lap_var) to maintain this value
current running lap time (elapsed time in the present lap)
this one seems like it'd be complex. you'd have to use getAtStartFinish() as a conditional to then mark the current time in terms of when the start/finish was crossed (and hope that you actually caught the start/finish) and then you'd have to calculate the elapsed lap time from the start/finish time.
197MPH (theoretical gearing top speed of my car - never gonna happen) rounded up to 200MPH is 293ft/s. At a tick rate of 20 (20 samples per second) that means the vehicle moves ~15ft per tick. What is the "window" through which getAtStartFinish is calculated? Would this require a higher tick?
Last lap's delta against fastest lap
Once you have fastest lap you can calculate this
* +/- prediction bar
Once you have the fastest lap you could do math against the predicted lap to calculate a delta for this
Is it worth it to write all these scripts/calculations?
1) The AEM dash can calculate all of the timing stuff on its own via GPS data. I can simulate AEM's GPS unit (already partially done -- https://gist.github.com/thoraxe/37b7e3c ... lua-L3-L67 ) but I have to add "course" which I think is really just direction. Need to check with them
2) I can use the RCP lap data and send it over CAN and then display it on the CD-7. While this is easier, the CD-7 supports more lap functions than the RCP.
https://wiki.autosportlabs.com/RaceCapt ... Statistics
Here are the RCP lap functions:
4.7.1 getLapCount()
4.7.2 getLapTime()
4.7.3 getPredTime()
4.7.4 getAtStartFinish()
4.7.5 resetLapStats()
Here's what the dash supports:
* previous lap time
* predicted lap time
* lap count
* fastest lap time
* current running lap time (elapsed time in the present lap)
* last lap's delta against fastest lap
* +/- prediction bar
It looks like some of these align with existing functions, but some do not. All would need to be sent over CAN. The question is whether or not it makes sense to just calculate the current course/heading (to use the built-in AEM functions) or to do it via the RCP (which will require a lot more scripting).
Let's go through the above:
previous lap time
getLapTime()
predicted lap time
getPredTime()
lap count
getLapCount()
That's it for the builtins...
fastest lap time
RCP doesn't calculate this according to the Lua guide. So a variable would need to be created and then a small scriptlet (is getLapTime() < fastest_lap_var) to maintain this value
current running lap time (elapsed time in the present lap)
this one seems like it'd be complex. you'd have to use getAtStartFinish() as a conditional to then mark the current time in terms of when the start/finish was crossed (and hope that you actually caught the start/finish) and then you'd have to calculate the elapsed lap time from the start/finish time.
197MPH (theoretical gearing top speed of my car - never gonna happen) rounded up to 200MPH is 293ft/s. At a tick rate of 20 (20 samples per second) that means the vehicle moves ~15ft per tick. What is the "window" through which getAtStartFinish is calculated? Would this require a higher tick?
Last lap's delta against fastest lap
Once you have fastest lap you can calculate this
* +/- prediction bar
Once you have the fastest lap you could do math against the predicted lap to calculate a delta for this
Is it worth it to write all these scripts/calculations?