From e5631c0bab16b6995722054b1700b74b7c055fec Mon Sep 17 00:00:00 2001 From: Erik Frey Date: Tue, 10 Jun 2025 12:45:49 -0700 Subject: [PATCH] [MJX] Don't raise sparse qM error in tendon_armature if there are no tendons. PiperOrigin-RevId: 769753590 Change-Id: I5dd7a953f08e0566c5e22c2c926d7bd9c2c57bd6 --- mjx/mujoco/mjx/_src/smooth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mjx/mujoco/mjx/_src/smooth.py b/mjx/mujoco/mjx/_src/smooth.py index fba3d3ce..bef176d6 100644 --- a/mjx/mujoco/mjx/_src/smooth.py +++ b/mjx/mujoco/mjx/_src/smooth.py @@ -1191,6 +1191,9 @@ def tendon_armature(m: Model, d: Data) -> Data: if not isinstance(m._impl, ModelJAX) or not isinstance(d._impl, DataJAX): raise ValueError('tendon_armature requires JAX backend implementation.') + if not m.ntendon: + return d + if not support.is_sparse(m): return d.tree_replace({ '_impl.qM': (