Skip to content

T-111: SO-100 manipulator dynamics via Featherstone ABA (3rd real robot) - #7

Merged
machinavitalis merged 1 commit into
mainfrom
T-111-so100-dynamics
Jul 14, 2026
Merged

machinavitalis merged 1 commit into
mainfrom
T-111-so100-dynamics

Conversation

@machinavitalis

Copy link
Copy Markdown
Owner

Makes "compile a calibrated robot" true for the zoo's first manipulator. Zoo status: 3 of 4 robots now end-to-end (cartpole, crazyflie, so100).

Why it's different

A manipulator's forward dynamics need M(q)⁻¹, which the lowering coverage table has no solve for. The lowerable route is Featherstone's Articulated Body Algorithm — O(n) forward dynamics using only spatial matmuls and scalar reciprocals 1/D_i, never forming a matrix inverse.

What

  • jaxility/zoo/so100/_dynamics.py — the ABA (spatial [angular;linear] algebra); the spatial tree (transforms, axes, per-link mass/com/inertia) is read from the calibrated Robot so calibration propagates.
  • so100 __init__ — _dynamics_factory returns (f, (12,), (6,)); the entry is now a real dynamics factory.
  • Lowering (jax_to_casadi.py) — three general completeness fixes that unblock rigid-body dynamics (and any matrix-heavy JAX fn), each with capability tests:
    • broadcast_in_dim: rank-1→rank-2 row/col promotion + scalar→vector materialization (a scalar feeding a matmul must be a real column, not a scalar-multiply).
    • dot_general: lift numpy constants; dispatch on contracting dims so a 1D·1D inner product lowers to aᵀ @ b (scalar), not a 6×6.
    • add/sub/mul/div: broadcast non-scalar shapes (outer products u[:,None] * u[None,:]).

Verified

ABA matches MJX functional_dynamics to ~1e-5 (manipulator grade), lowers to CasADi (== JAX to 9e-13), calibration propagates. Full unit suite green (520 passed).

Honest fidelity note

so100 is validated to manipulator grade, not ULP. An independent ABA and MuJoCo's internal cinert CRB diverge ~1e-6 on this featherweight arm (distal inertias ~1e-5) — a deterministic representational floor, not a bug or round-off (established by an exhaustive debugging pass: FK exact 1e-16, com-Jacobian gravity exact 5e-17, longdouble-invariant). Tested at a 1e-4 bound.

so100's WBC OCP template is a T-024 follow-on, so jaxility build so100 fails structurally (like crazyflie) until it lands. Doc-drift: CLAIMS / KNOWN_GAPS / README + zoo tests updated.

🤖 Generated with Claude Code

Makes "compile a calibrated robot" true for the zoo's first *manipulator*.
Zoo status: 3 of 4 robots now end-to-end (cartpole, crazyflie, so100).

Why it's different: a manipulator's forward dynamics need M(q)^-1, which the
lowering coverage table has no solve for. The lowerable route is Featherstone's
Articulated Body Algorithm — O(n) forward dynamics using only spatial matmuls
and scalar reciprocals 1/D_i, no matrix inverse.

- jaxility/zoo/so100/_dynamics.py: the ABA (spatial [angular;linear] algebra),
  spatial tree sourced from the calibrated Robot so calibration propagates.
- so100 __init__: _dynamics_factory returns (f, (12,), (6,)); flip the entry to
  a real dynamics factory.
- Lowering (jax_to_casadi.py): three general completeness fixes that unblock
  rigid-body dynamics (and any matrix-heavy JAX fn), each with capability tests:
    * broadcast_in_dim: rank-1 -> rank-2 row/col promotion, and scalar -> vector
      materialization (a scalar feeding a matmul must be a real column, not a
      scalar-multiply).
    * dot_general: lift numpy constants; dispatch on contracting dims so a 1D.1D
      inner product lowers to a.T @ b (scalar), not a 6x6.
    * add/sub/mul/div: broadcast non-scalar shapes (outer products u[:,None] *
      u[None,:]).
- Verified: ABA matches MJX functional_dynamics to ~1e-5 (manipulator grade),
  lowers to CasADi (== JAX to 9e-13), calibration propagates.

Fidelity is manipulator-grade, NOT ULP: an independent ABA and MuJoCo's cinert
CRB diverge ~1e-6 on this featherweight arm (distal inertias ~1e-5) -- a
deterministic representational floor, not a bug. 1e-4 test bound. so100's WBC
OCP template is a T-024 follow-on, so `jaxility build so100` fails structurally
(like crazyflie) until it lands. Doc-drift: CLAIMS/KNOWN_GAPS/README + zoo tests.
@machinavitalis
machinavitalis merged commit 0243735 into main Jul 14, 2026
8 checks passed
@machinavitalis
machinavitalis deleted the T-111-so100-dynamics branch July 14, 2026 13:50
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.

1 participant