BeamNG / BeamNGpy

Python API for BeamNG.tech
https://beamng.tech
MIT License
257 stars 45 forks source link

IMU Unit System #121

Open danielstuart14 opened 3 years ago

danielstuart14 commented 3 years ago

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 commented 3 years ago

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.

Palculator commented 3 years ago

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.

jvalentine commented 3 years ago

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