Skip to content

Fix ABB/RFL inertias and preserve PyBullet base-link placement - #488

Open
gonzalocasas wants to merge 1 commit into
mainfrom
fix/486-robot-library-inertias
Open

Fix ABB/RFL inertias and preserve PyBullet base-link placement#488
gonzalocasas wants to merge 1 commit into
mainfrom
fix/486-robot-library-inertias

Conversation

@gonzalocasas

Copy link
Copy Markdown
Member

The bundled ABB IRB4600-40/2.55 and RFL URDFs contain 45 physically invalid inertia tensors, which prevent MuJoCo from loading either model. Apply the two patches contributed by @omnilink-tech, correcting the tensors and centres of mass for all 7 ABB and 38 RFL inertial links.

Applying the URDF changes also exposed a PyBullet integration bug: setting the ABB base to the world origin displaced its tool by about 14 cm because the backend passed a base-link pose to an API that expects the base's inertial pose. Convert between those frames when reading or setting a base pose, including object placement. Regression tests cover translated and rotated inertial frames at two base poses and check the child-link pose as well as the base, so matching setter/getter errors cannot hide a displacement.

The replacement values are uniform-density approximations of the collision meshes at the existing declared masses, not manufacturer dynamic parameters. The masses remain unvalidated: their implied densities range from about 1.08 kg/m³ for the RFL gantry to 14,171 kg/m³ for the ABB wrist. Both URDFs now carry this caveat. The numerical patch values are unchanged; only explanatory XML comments were added.

Closes #486.

Independent validation

  • Recomputed all 45 centres of mass and tensors with Trimesh 4.12.2, independently of the contributor's generator. All source collision meshes are watertight with consistent winding and positive volume. Applied mesh scales and collision-origin transforms, including the RFL gantry translation and rotated components. Maximum centre discrepancy: 4.19e-8 m; maximum relative tensor error (Frobenius norm): 3.54e-9. Checked the integration library against the analytic inertia of a rotated and translated box.
  • Verified that masses, inertial orientations, joints, collision geometry, and all other XML data are unchanged. Only inertial positions and tensors differ from main.
  • Added a NumPy regression test for positive definiteness and the principal-moment triangle inequality across all 94 tensors in 11 bundled URDFs. Confirmed that it rejects the original ABB and RFL files.
  • MuJoCo 3.12.0, with package paths resolved locally and inertiafromgeom="false", balanceinertia="false": both originals fail with non-positive inertia eigenvalues; both corrected models load and run with finite positions, velocities and accelerations, no warnings, and no simulation resets. ABB: 7 bodies, 415 kg, 500 steps. RFL: 35 bodies, 3340 kg, 5000 steps. These are smoke checks, not validation of real-machine dynamics.
  • Confirmed the four new PyBullet regression cases fail before the backend fix and pass afterward; the existing ABB forward-kinematics test also passes afterward.
  • pytest -q: 195 passed, 21 skipped (opt-in live ROS integration tests).
  • invoke lint, Ruff formatting checks for changed Python files, and git diff --check: passed.

What type of change is this?

  • Bug fix in a backwards-compatible manner.

Checklist

  • Added changelog entries under Unreleased.
  • Ran the local test suite; live ROS integration tests were skipped as noted above.
  • Ran lint with no errors.
  • Added regression tests.
  • Documented the approximation in the affected URDFs and credited the contributor in AUTHORS.md.

Apply the mesh-derived inertias contributed in issue #486, document their approximation, and validate physical realizability across the robot library. Correct the PyBullet inertial-to-link frame conversion exposed by the new ABB base centre of mass.

Co-authored-by: OmniLink <234818255+omnilink-tech@users.noreply.github.com>
@gonzalocasas
gonzalocasas marked this pull request as ready for review September 8, 2026 10:30
@gonzalocasas

Copy link
Copy Markdown
Member Author

@yijiangh @yck011522 hey guys, this bug report surfaced something unexpected in the pybullet client. It looks rather decent to me, but maybe you can take a deeper look at it? Thanks!!!

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 this pull request may close these issues.

tensors in the bundled robot library are not physically realisable (MuJoCo refuses to load them)

1 participant