Calculating Inverse Corner Radius

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
celer
Posts: 1
Joined: Fri May 15, 2015 6:41 pm

Calculating Inverse Corner Radius

Post by celer »

Hi, I've been trying to calculate the Inverse Corner Radius but I'm really not getting any results I expect:

Code: Select all


setTickRate&#40;20&#41;

icrId = addChannel&#40;"ICR",10,2&#41;


function onTick&#40;&#41;

  # Convert the GPS Speed to meters per second
  mps = &#40;&#40;getGpsSpeed&#40;&#41;*0.44704&#41;&#41;


 # Prevent a divide by zero
 if mps >=0.05 then
   icr = &#40;getImu&#40;1&#41;*9.806&#41;/&#40;mps*mps&#41;
 else
   icr=0.0
 end
 setChannel&#40;icrId,icr&#41;


 if getGpio&#40;0&#41; == 1 then
  startLogging&#40;&#41;
 else
  stopLogging&#40;&#41;
 end
end


What I get is either almost entirely all zero's or no readings. Any thoughts?[/code]

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi, can you mock this out on your local computer feeding data to your formula? Also, some println() debugging statements would help quite a bit to see what it's calculating. Best is to build it up a little at a time and go from there.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply