Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direction of gravity vector of IMU simulation #116

Closed
yosuke opened this issue Feb 9, 2024 · 4 comments · Fixed by #118
Closed

Direction of gravity vector of IMU simulation #116

yosuke opened this issue Feb 9, 2024 · 4 comments · Fixed by #118
Assignees

Comments

@yosuke
Copy link
Contributor

yosuke commented Feb 9, 2024

When I visualize the IMU simulation using ROS RViz IMU plugin, the linear acceleration vector is directing downward (toward the ground), while this should direct upward (toward the sky) as shown in the following URL:
http://wiki.ros.org/rviz_imu_plugin?action=AttachFile&do=get&target=rviz_imu_plugin.png

This is probably because the gravity vector is added in the UnitySensors implementation:
https://github.com/Field-Robotics-Japan/UnitySensors/blob/master/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs#L51

While the gravity vector is subtracted in the other implemenation (e.g. gazebo):
https://github.com/gazebosim/gazebo-classic/blob/gazebo11/gazebo/sensors/ImuSensor.cc#L375-L376

We probably need to think "Because the IMU is not moving, linear velocity is applied against the gravitational force (that is why the vector should be subtracted)".

@Autumn60
Copy link
Contributor

Autumn60 commented Feb 9, 2024

@yosuke
Thank you for the Issue.

This is due to my lack of knowledge about the IMU.
For reference, what values of vertical acceleration does the IMU show when it is in free fall?

@Autumn60 Autumn60 self-assigned this Feb 9, 2024
@yosuke
Copy link
Contributor Author

yosuke commented Feb 9, 2024

@Autumn60
Good point.
My assumption is, it turns zero during free fall.
And yes, it seems right:
https://physics.stackexchange.com/questions/402611/why-an-accelerometer-shows-zero-force-while-in-free-fall

@Autumn60 Autumn60 linked a pull request Feb 9, 2024 that will close this issue
@Autumn60
Copy link
Contributor

@yosuke
This issue was fixed in #118.
Would you try the develop branch?

@RyodoTanaka
Copy link
Member

@yosuke @Autumn60
Thank you for your discussion and the merge.
This issue looks already solved by the merge, thus I close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants