Closed Icepomel0 closed 5 months ago
Hi @Icepomel0, can you post this on the brax github?
Hi Kevin,
Thanks for the reply. I think the issue is not from Brax but it is from MJX, where it does support some of the existing function of origin MuJoCo. I tried to load the model google_barkour by loading a specific defined in MJX one and it does cost any issue. Therefore I think the issue was raised from the model compatibility itself.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Kevin Zakka @.> Sent: Wednesday, March 27, 2024 10:44:31 AM To: google-deepmind/mujoco_menagerie @.> Cc: Yiming Xie @.>; Mention @.> Subject: Re: [google-deepmind/mujoco_menagerie] Loading Cassie model into Brax (Issue #49)
Hi @Icepomel0https://github.com/Icepomel0, can you post this on the brax github?
— Reply to this email directly, view it on GitHubhttps://github.com/google-deepmind/mujoco_menagerie/issues/49#issuecomment-2021656474, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARBUQKM7IV3FF4MSC5APNNLY2IB57AVCNFSM6AAAAABFETI3F6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGY2TMNBXGQ. You are receiving this because you were mentioned.Message ID: @.***>
Hi @Icepomel0
The model is not compatible with MJX, feel free to make a PR for a compatible version. Here is what I tried:
import mujoco
from mujoco import mjx
m = mujoco.MjModel.from_xml_path('agility_cassie/scene.xml')
mx = mjx.put_model(m)
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[5], line 1
----> 1 mx = mjx.put_model(m)
File ~/mujoco/mjx/mujoco/mjx/_src/io.py:91, in put_model(m, device)
88 raise NotImplementedError('tendons are not supported')
90 if (m.geom_condim != 3).any() or (m.pair_dim != 3).any():
---> 91 raise NotImplementedError('only condim=3 is supported')
93 # check collision geom types
94 for (g1, g2, *_), c in collision_driver.collision_candidates(m).items():
NotImplementedError: only condim=3 is supported
Now regarding the brax issue, brax.io.mjcf.loads
does a "fuse bodies" step before loading, which is annoying. @erikfrey
You can do this in brax instead:
import mujoco
from brax.io import mjcf
m = mujoco.MjModel.from_xml_path('agility_cassie/scene.xml')
mjcf.load_model(m)
Hi @btaba
Thanks for the help and declearation. Is there any pointer for how to edit the model to make it compatIble to MJX?
Hi @Icepomel0, you can take a look at the MJX page in the docs and an example of a MuJoCo model vs its MJX counterpart in the Google Barkour vB description of this repo. In particular, look at the MJX section of the README to understand what changes were necessary to make the model work with MJX.
Hi @kevinzakka
Thanks for your help. Will see and try to make it compatible and contribute it back.
Which model is the issue affecting? agility_cassie
What is the issue? When I use the code:
it returns such error message:
Is there any additional context you can provide (e.g., a spec sheet or a URDF to show a value mismatch)? I looked up the model to find the duplicate 'inertial' define for the model but I did not find anything. How to fix such issue? Thanks in advance!