BeamNGpy icon indicating copy to clipboard operation
BeamNGpy copied to clipboard

IMU Unit System

Open danielstuart14 opened this issue 3 years ago • 3 comments

Hi, I'm currently doing a research using beamNG.tech and one of the sensors I'm using is the IMU provided. I need for my research the linear acceleration values of the vehicle.

I'm having a little bit of trouble understanding the IMU values, as they are not very well documented.

These are my questions: a) Which unit system is the IMU reporting? (rad/s for rotation? Newtons for linear force?) b) The force reported uses the mass of the vehicle or it just represents the acceleration? (If so, is it reporting m/s^2?)

Thank you,

danielstuart14 avatar May 05 '21 16:05 danielstuart14

One more thing, after some fiddling around I found out that the Force values are absolute and not related to the imu orientation. Example: Accelerating in a straight line isn't going to result in a Positive X force, as the forces are related to the X, Y and Z position of the world.

danielstuart14 avatar May 05 '21 17:05 danielstuart14

Hey, the IMUs do report rotation in rad/s and acceleration in m/s^2. This does not include gravity. The current value of gravity can be obtained in Lua using core_environment.getGravity(), but I can expose that to BeamNGpy with relative ease (I actually exposed setGravity() but I guess never did the same for the getter 🙃.)

What your second comment points out does seem like a bug though; I'll change the IMUs to rotate according to the orientation of the vehicle they are mounted to.

Palculator avatar Aug 05 '21 08:08 Palculator

Was this resolved? Does the IMU now relate to the vehicle's orientation?

jvalentine avatar Sep 25 '21 10:09 jvalentine