Learning outcomes
- Explain the two passes of RNEA.
- Relate inverse dynamics to columns of M.
- Query engine dynamics without confusing algorithms and APIs.
Prerequisites: Linear algebra, ODEs, and earlier lectures in this sequence.
Recursive Newton–Euler algorithm
A tree-structured robot permits local computations along its links. RNEA first propagates spatial velocity and acceleration from parent to child. A backward pass accumulates inertial and external wrenches from children to parents. Projecting each link wrench onto its joint motion subspace gives the required generalized force.
In a conventional spatial notation, a link velocity has the form
For a fixed-base tree with bounded joint size, inverse dynamics can be computed in linear time in the number of bodies. Contact constraints and actuator allocation are separate problems.
Mass matrix through inverse dynamics
For ideal unconstrained dynamics, inverse dynamics returns
CRBA builds composite subtree inertias and uses them to assemble the joint-space mass matrix. Its purpose differs from RNEA: CRBA supplies M, while RNEA supplies force for a requested acceleration.
Worked column test
For
MuJoCo and Pinocchio
Practice 4 compares dense M with finite differences of MuJoCo inverse dynamics on a contact-free arm, at a fixed state. Passive force terms cancel in the difference when independent of the requested acceleration. It also checks the full force balance.
MuJoCo exposes functions such as mj_rne and mj_crb, while its high-level inverse call also handles engine-specific forces and constraints. Pinocchio exposes algorithms named rnea and crba directly. Do not label every call to mj_inverse as a bare textbook RNEA calculation MuJoCo API Pinocchio algorithms.
Exercise
Why do column differences become unreliable if each call uses a different q? Answer: M changes with configuration, so the result no longer isolates a linear map from acceleration to force at one state. Freeze q, v, contacts, and model parameters for the test.
A good dynamics API exercise tests numerical identities and documents conventions, rather than judging correctness from a robot animation.