You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dynamics functions on a model with no dynamic parameters: silent zeros and several different errors; add a clear check #722
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.
Correction to the table above: the coriolisValueError 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.
Activity
petercorke commentedon Oct 10, 2026
Correction to the table above: the
coriolisValueErroris 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), becausecorioliscallsnofriction(), which copies the robot, and the copied links keep their originalparent. Filed separately as #730. The zero-dynamics check proposed here is still wanted for the other rows.