-
Notifications
You must be signed in to change notification settings - Fork 41
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
dartsim: fix handling inertia matrix pose rotation #351
Conversation
When loading a model from SDF, the moment of inertia matrix is currently applying any rotations in the //inertial/pose two times, since the rotations are applied explicitly, but they are already applied in math::Inertial::Moi. Signed-off-by: Steve Peters <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-physics5 #351 +/- ##
===============================================
Coverage ? 76.84%
===============================================
Files ? 129
Lines ? 5960
Branches ? 0
===============================================
Hits ? 4580
Misses ? 1380
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix, I was wondering about this. Is there a way we can write a test here to catch that?
Also, would it be possible to target this at Citadel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I second the idea of having an automated test to catch future regressions.
yes, I'll target this at Citadel |
it will be easiest to write the test using the common test framework, which is now added in Garden, so I'll make a separate PR for garden once this is merged forward |
Signed-off-by: Louise Poubel <[email protected]>
Let's merge this into Fortress so it catches the next bus to Garden. We should backport it to Citadel soon. |
When loading a model from SDF, the moment of inertia matrix is currently applying any rotations in the //inertial/pose two times, since the rotations are applied explicitly, but they are already applied in math::Inertial::Moi. Signed-off-by: Steve Peters <[email protected]> Signed-off-by: Louise Poubel <[email protected]> Co-authored-by: Louise Poubel <[email protected]>
When loading a model from SDF, the moment of inertia matrix is currently applying any rotations in the //inertial/pose two times, since the rotations are applied explicitly, but they are already applied in math::Inertial::Moi. Signed-off-by: Steve Peters <[email protected]> Signed-off-by: Louise Poubel <[email protected]> Co-authored-by: Louise Poubel <[email protected]>
🦟 Bug fix
Fixes a bug in moment of inertia calculation
Summary
When loading a model from SDF in the dartsim plugin, the moment of inertia matrix is currently applying any rotations in the
//inertial/pose
two times, since the rotations are applied explicitly in SDFFeatures.cc, but they are already applied in math::Inertial::Moi.I confirmed the bug with a slightly modified version of the inertia_rotations test world from gazebo classic. That world has multiple 1x4x9 boxes with identical inertia values that are expressed with different inertial pose rotations. The boxes are initially standing up on a ground plane. Setting gravity to
[2, 0, -9.8]
causes the boxes to tip over, and they should move at the same rate and hit the ground at the same time. This works properly in gazebo-classic with DART but not fortress or citadel.I'll upload a copy of the example world for use with fortress as well as screen captures of my testing and then mark this ready for review.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.