Just as documented getGpsDist() returns "distance from the beginning of the logging session, or from the start finish line, if configured." Which means, once lapping, the distance gets reset to 0 every time one crosses the finish line.
Can you publish a function that always returns the distance from the start of the session? It would be very useful to calculate mpg more accurately, and predict how many laps are left with current fuel.
I am calculating total distance with lua by adding the travelled distance before it gets reset, but it is not completely precise as the last part (between ticks) gets lost. It is also more code and memory for scripting is very limited.
Function with Total Distance
Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>
Jump to
- Autosport Labs
- ↳ General Discussion
- ↳ News and Announcements
- ↳ New Project Suggestions
- CAN Devices
- ↳ ShiftX2
- ↳ AnalogX
- RaceCapture App
- ↳ RaceCapture App Operation and General Q&A
- ↳ RaceCapture App Bug Reporting / Feature Requests
- CAN bus and OBDII integration
- ↳ CAN mapping discussion
- ↳ OBDII PIDs discussion
- RaceCapture/Pro | RaceCapture/Apex | PodiumConnect
- ↳ RaceCapture/Pro introductions
- ↳ RaceCapture/Pro General Q&A
- ↳ Sensors
- ↳ Hardware and Installation
- ↳ Lua Scripting
- ↳ Telemetry
- ↳ Bug Reporting
- ↳ Feature Requests
- RaceCapture/Track
- ↳ RaceCapture/Track Introductions
- ↳ RaceCapture/Track Operation
- ↳ RaceCapture/Track Installation
- ↳ RaceCapture/Track Bug Reporting / Feature Requests
- Megajolt/E and Megajolt Lite Jr. (MJLJ)
- ↳ Ignition Map Library
- ↳ Powered by Megajolt Gallery
- ↳ Assembly
- ↳ Installation
- ↳ Operation
- ↳ Q&A
- ↳ Future Upgrades
- ↳ Bug Reporting
- ↳ Fixes/Patches/Updates
- ↳ Hard Rev Limiter