Page 1 of 1

Calculating Inverse Corner Radius

Posted: Fri May 15, 2015 6:46 pm
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(20)

icrId = addChannel("ICR",10,2)


function onTick()

  # Convert the GPS Speed to meters per second
  mps = ((getGpsSpeed()*0.44704))


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


 if getGpio(0) == 1 then
  startLogging()
 else
  stopLogging()
 end
end


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

Posted: Mon May 18, 2015 10:36 pm
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.