Not sure what I'm doing wrong, e46/mini code with an average on it, I get a lot of wheelspin and I lift the rear wheels when I autocross and they tend to stop in the air, so I'm averaging the front two tires for the log and harry's laptimer.
This is the wheelspeed code, I'm correcting for my smaller 15" track/autocross tires
function processWheel(id, data, offset)
--wheel speed is 13 bits long, little endian
--low byte high byte
--76543210 76543210
--11111111 11111XXX
local highByte = bit.band(data[offset + 2], 0x1F)
local lowByte = data[offset + 1]
local value = highByte * 256 + lowByte
value = value * 0.0625
--convert to MPH. comment to keep KPH
value = value * 0.621371
--15" wheel correction
value = value * .9468
setChannel(id, value)
end
this is the wheelspeed data that I'm using, it's defaulting to 8mph when I'm at a standstill and the car is shut off
setChannel(AvgWheelId, ((lfWheelId + rfWheelId) /2))
wheelspeed defaulting to 8mph
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