Skip to content

fix: MuJoCo 3.x compat — remove convexhull, fix MPL_hand class, fix include paths#1

Merged
Vittorio-Caggiano merged 2 commits into
myochallengefrom
fix/mujoco3-compat
May 10, 2026
Merged

fix: MuJoCo 3.x compat — remove convexhull, fix MPL_hand class, fix include paths#1
Vittorio-Caggiano merged 2 commits into
myochallengefrom
fix/mujoco3-compat

Conversation

@Vittorio-Caggiano
Copy link
Copy Markdown

Summary

This PR fixes four XML bugs in the MPL_sim asset files that cause runtime errors with MuJoCo 3.x. These bugs are currently worked around by myosuite's patching layer in myosuite/utils/simhive_assets.py; once this PR merges and a new release is cut, that layer can be removed.

Bug 1 — arms_assets.xml: deprecated convexhull compiler attribute

MuJoCo 3.x removed the convexhull compiler attribute. Removed convexhull="false" from the <compiler> element.

Bug 2 — arms_chain.xml: broken include paths

Lines 37 and 63 used paths like ./../../MPL_sim/assets/simpleHandR_chain.xml which assumed a submodule layout (MPL_sim as a sibling directory). In the pip package, all assets are in the same directory. Fixed to simple relative paths:

<include file="simpleHandR_chain.xml"/>
<include file="simpleHandL_chain.xml"/>

Bug 3 — simpleHandR_assets.xml + arms_assets.xml: unknown default class MPL_hand

When simpleHand*_assets.xml files are included alongside arms_assets.xml, MuJoCo throws unknown default class MPL_hand because MPL_hand was defined as a top-level default in simpleHandR_assets.xml rather than as a child of MPL_arm. MuJoCo requires that child-class defaults be nested under their parent.

Fix: moved the MPL_hand default as a nested child of MPL_arm in arms_assets.xml, and removed the duplicate top-level definition from simpleHandR_assets.xml.

Bug 4 — simpleHandL_chain.xml + simpleHandR_chain.xml: childclass="MPL_hand"

No change needed — childclass="MPL_hand" on body elements is correct now that MPL_hand is properly defined as a nested child default of MPL_arm.

Test plan

  • Load arms_chain.xml (combined with assets) in MuJoCo 3.x — no XML errors
  • myosuite bimanual env loads cleanly: mujoco.MjModel.from_xml_path(resolved) succeeds
  • pytest myosuite/tests/test_tier_a_myochallenge_matrix.py — 19 passed, 0 failed

🤖 Generated with Claude Code

…L_hand class

Bug 1 (arms_assets.xml): Remove deprecated `convexhull="false"` compiler attribute
removed in MuJoCo 3.x.

Bug 2 (arms_chain.xml): Fix include paths from `./../../MPL_sim/assets/simpleHand*.xml`
to simple relative `simpleHand*.xml`. The old paths assumed a submodule layout where
MPL_sim is a sibling directory; the pip package layout has all assets in one directory.

Bug 3 (arms_assets.xml + simpleHandR_assets.xml): Define `MPL_hand` default class as a
child of `MPL_arm` in arms_assets.xml so it is always available when the combined
arms+hands model is loaded. Remove the duplicate top-level `MPL_hand` default from
simpleHandR_assets.xml (which caused "unknown default class MPL_hand" when included
alongside arms_assets.xml because MuJoCo requires child-class defaults to be nested).

Bug 4 (simpleHandL_chain.xml + simpleHandR_chain.xml): No change needed — `childclass="MPL_hand"`
on body elements is correct once MPL_hand is properly defined as a nested child default.

These bugs are currently worked around at runtime by myosuite's patching layer in
myosuite/utils/simhive_assets.py. Once this PR merges and a new mpl_sim release is
cut, that patching layer can be removed.
@Vittorio-Caggiano Vittorio-Caggiano changed the base branch from main to myochallenge May 10, 2026 22:43
@Vittorio-Caggiano Vittorio-Caggiano merged commit 630a39d into myochallenge May 10, 2026
1 check passed
@Vittorio-Caggiano Vittorio-Caggiano deleted the fix/mujoco3-compat branch May 10, 2026 22:44
@Vittorio-Caggiano Vittorio-Caggiano restored the fix/mujoco3-compat branch May 10, 2026 22:48
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