Field-Robotics-Japan / UnitySensors

ROS/ROS2 enabled Sensor models (Assets) on Unity
Apache License 2.0
193 stars 29 forks source link

IMU acceleration is affected by scale #55

Closed sgrsn closed 8 months ago

sgrsn commented 11 months ago

In IMU calculations, Transform.InverseTransformVector is used to add gravity to acceleration, but this function is scale sensitive, so if the object's scale is changed, the acceleration values will not be calculated correctly.

If the scale is set to 1, there is no problem. image

If the scale is changed to 0.1, the gravity of the corresponding axis is calculated as 10 times. image

Autumn60 commented 11 months ago

Fixed this issue in #57.

sgrsn commented 10 months ago

@Autumn60 I have confirmed another problem. InverseTransformVector has the effect of shifting the angle if the scale of each axis is different. For example, when tilted by 45°, the acceleration of the two axes does not have the same magnitude. I think we should consider a method that does not use Transform.InverseTransformVector. image image

RyodoTanaka commented 8 months ago

This issue looks solved. I close this.