fix(urdf): rotate inertia tensors from the inertial frame into the link frame - #707
Open
karkikamal098 wants to merge 1 commit into
Open
karkikamal098 wants to merge 1 commit into
karkikamal098 wants to merge 1 commit into
Conversation
…nk frame URDF gives each link's inertia tensor in its <inertial> frame, which <origin rpy> may rotate relative to the link frame. The loader kept only the origin translation and passed the tensor through unrotated, so links with rotated inertial frames got wrong inertia, rne, coriolis and gravload results. Apply I_link = R I R^T. Related to petercorke#686 and petercorke#688.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 9 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #707 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 143 143
Lines 14269 14279 +10
=====================================
- Misses 14269 14279 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
URDF gives each link's inertia tensor in its
<inertial>frame, whose pose relative to the link frame is<origin xyz rpy>.Link.Iexpects the tensor about the centre of mass with axes parallel to the link frame. The loader kept only the translation of that origin and passed the tensor through unrotated, so any link with a non-zero inertialrpygot a wrong inertia tensor, and therefore wrongrne,inertia,coriolisandgravload, with no warning.This rotates the tensor into the link frame,
I_link = R I Rᵀ, in a small helper inURDFRobot.py.ris unchanged, sincexyzis already the centre of mass in the link frame.Affected models include those with rotated inertial frames in the bundled data (the Trossen arms, and the Clearpath Ridgeback base used by
FrankieOmni) and robot_descriptions models such as the UR series.Related issue
Related to #686 and #688 (dynamics accuracy of URDF models).
Checklist
mainand all need the compiled extension or IPython.tests/test_urdf_inertial.py, covering an unrotated frame, a yaw that swaps the x/y moments, a general rotation againstR I Rᵀ, the centre of mass, and anrnecheck where a 90° roll movesiyy = 2onto the joint axis, so a unit joint acceleration needs torque 2 (3 before the fix). The three rotation tests fail without this change.