Skip to content

Commit e5631c0

Browse files
erikfreycopybara-github
authored andcommitted
[MJX] Don't raise sparse qM error in tendon_armature if there are no tendons.
PiperOrigin-RevId: 769753590 Change-Id: I5dd7a953f08e0566c5e22c2c926d7bd9c2c57bd6
1 parent 5f42078 commit e5631c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mjx/mujoco/mjx/_src/smooth.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,9 @@ def tendon_armature(m: Model, d: Data) -> Data:
11911191
if not isinstance(m._impl, ModelJAX) or not isinstance(d._impl, DataJAX):
11921192
raise ValueError('tendon_armature requires JAX backend implementation.')
11931193

1194+
if not m.ntendon:
1195+
return d
1196+
11941197
if not support.is_sparse(m):
11951198
return d.tree_replace({
11961199
'_impl.qM': (

0 commit comments

Comments
 (0)