Skip to content

Dynamics functions on a model with no dynamic parameters: silent zeros and several different errors; add a clear check #722

Open

Description

@petercorke

Problem. A model whose links have no dynamic parameters (all link masses 0, e.g. the default rtb.models.Panda or the ETS Puma560) is accepted by every dynamics function, and what comes back depends on the function (RTB 1.4.4, default Panda):

Call Result
gravload, rne, inertia, friction all-zero result, silently
coriolis ValueError containing a dump of a Link definition
accel, fdyn LinAlgError: Singular matrix

Surfaced in discussion #459 (#459), where a user's fdyn call failed and he had to work out for himself that the model had no inertial data.

Proposal.

  • One check, e.g. a private _require_dynamics() on the robot base class and a public has_dynamics property: true if any link has non-zero mass. (Not "all": the DH Puma560's first link legitimately has m = 0.)
  • Call it at the start of every dynamics method; raise one clear error naming the model, e.g. "model 'Panda' has no dynamic parameters; use rtb.models.DH.Panda() or set m, r, I on the links".
  • Raise rather than warn, since zeros are a wrong answer.
  • Say in the model documentation which models have dynamics.

Risk. Scripts, examples or tests that call gravload and so on on a kinematics-only model and accept zeros will start raising. Run the suite and examples first.

Related. #686 (this is the behaviour side; that one is the missing-data side), #637, #688, #636, and discussion #459.

Activity

  1. added
    tech-debtKnown technical debt / deferred cleanup, not a live bug
    on Oct 10, 2026
  2. petercorke commented on Oct 10, 2026

    @petercorke
    OwnerAuthor

    Correction to the table above: the coriolis ValueError is not specific to models with no dynamic parameters. It also occurs on URDF-based models that do have dynamics (UR5, KinovaGen3, LBR, a two-link URDF with inertials), because coriolis calls nofriction(), which copies the robot, and the copied links keep their original parent. Filed separately as #730. The zero-dynamics check proposed here is still wanted for the other rows.

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