google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
7.85k stars 786 forks source link

[MJX]Problem implementing an MJX environment from mujoco_menagerie/unitree_go1/scene.xml file (NotImplementedError) #1575

Closed lucattyy closed 5 months ago

lucattyy commented 5 months ago

Hi,

I'm a student and I'm trying to use MuJoCo for go1. I am trying to use xml from mujoco_menagerie/unitree_go1/scene.xmland train function in tutorial about barkour. Problem occurs when I try to get_env. Here is the error information: Traceback (most recent call last): File "/home/ubuntu/brax/brax/scripts/train_mjx_go1.py", line 458, in <module> env = envs.get_environment(env_name) File "/home/ubuntu/brax/brax/brax/envs/__init__.py", line 63, in get_environment return _envs[env_name](**kwargs) File "/home/ubuntu/brax/brax/scripts/train_mjx_go1.py", line 141, in __init__ sys = mjcf.load(path.as_posix()) File "/home/ubuntu/brax/brax/brax/io/mjcf.py", line 520, in load return load_model(mj) File "/home/ubuntu/brax/brax/brax/io/mjcf.py", line 448, in load_model mjx_model = mjx.put_model(mj) File "/home/ubuntu/.conda/envs/jax/lib/python3.9/site-packages/mujoco/mjx/_src/io.py", line 97, in put_model raise NotImplementedError(f'({g1}, {g2}) has no collision function') NotImplementedError: (mjtGeom.mjGEOM_PLANE, mjtGeom.mjGEOM_CYLINDER) has no collision function I thought there are some error in the xml file, but the scene.xml can be loaded in mujoco-3.1.1. Can anybody help me to understand what is going on here?

kevinzakka commented 5 months ago

MJX cannot always load XML files that work in regular MuJoCo. See this issue for some more information.

lucattyy commented 5 months ago

Hi @kevinzakka Thanks for your help. I will do some modification to the xml.