Skip to content

RNE/inertia() silently wrong (not crashing) for URDF robots with fixed/structural joints #636

Description

@petercorke

Background

Three independent bug reports (#236, #463, #489) hit essentially the same crash: rne()/inertia() raising AttributeError/TypeError on URDF-loaded robots (Panda, KinovaGen3) that have a structural (non-actuated, jindex=None) link in the chain -- typically the base-mount link before the first real joint.

Current status (verified 2026-08-25)

The literal crash no longer reproduces on current main -- confirmed directly:

>>> robot = rtb.models.URDF.Panda()
>>> robot.rne(q=[-1.649, -0.107, 0, 0, 0, 0, 0], qd=np.zeros(7), qdd=np.zeros(7), gravity=[9.81, 0, 0])
[0. 0. 0. 0. 0. 0. 0.]

No exception -- but that's the wrong answer. The equivalent DH Panda model, same pose, same gravity vector, returns real nonzero torques ([1.307, 3.65, -3.52, -1.23, -1.60, 0.038, 0.078]). Same symptom reproduces on KinovaGen3 (#463's exact repro): near-zero-but-not-exactly-zero torques (~1e-8 to ~1e-3) instead of the real gravity-load torques a bent 7-DOF arm should show.

So whatever change stopped the crash did not fix the underlying computation -- it just made the wrong answer silent instead of loud, which is arguably worse for anyone not specifically checking against a reference.

Root cause and proposed fix

#483 diagnosed this precisely and submitted a full working patch: when a fixed/structural link precedes an actuated joint, that link's center-of-mass and inertia tensor are never transformed into the parent actuated joint's frame before being folded into the dynamics recursion -- they're silently dropped/miscounted. #483's patch (verified against Pinocchio by the submitter) fixes this at the source. Not yet applied to main.

Next steps

Originally reported: #236, #463, #489. Fix proposed in #483 (kept open, not duplicated here).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtKnown technical debt / deferred cleanup, not a live bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions