Skip to content

mjx support for flex elements? Status confusing. #2656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
aespielberg opened this issue May 28, 2025 · 0 comments
Open
2 tasks done

mjx support for flex elements? Status confusing. #2656

aespielberg opened this issue May 28, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@aespielberg
Copy link

Intro

Hi!

I am a researcher using mujoco for developing capabilities on manipulation.

My setup

I'm using mjx 0.6.1, in cpu mode, on Ubuntu 24.

What's happening? What did you expect?

When I run the flex bunny.xml in a jitted mjx simulation, the flexvert_xpos data is completely empty.

If this is unsupported, that is fine, but there is nothing to suggest that it is not supported.

https://mujoco.readthedocs.io/en/stable/mjx.html#

Flex elements are not listed as any of the features that are not supported. In fact, it is even worse: the documentation states that "MJX will raise an exception if asked to copy to device an mjModel with field values referencing unsupported features."

However, you can copy flex elements to and from mjModels without any exceptions. Since flex elements do not seem to be supported in mjx, the bug is that this needs to raise an exception, but does not. Otherwise, like me, you spend time thinking your simulations are succeeding and wondering why you are unable to get any data out of your soft-bodied simulation.

It was only when I searched the flex modeling folder on github that I realized that while the fields are there, there is no logic supported for flex elements in mjx: https://github.com/search?q=repo%3Agoogle-deepmind%2Fmujoco+flex+language%3APython&type=code&l=Python

(Incidentally, it would be great if the documentation can be updated to describe if flex elements are coming soon or unsupported.)

Steps for reproduction

  1. Load the bunny.xml.
  2. Convert it to an mjx model.
  3. jit the simulation function.
  4. Run the simulation.
  5. Try to extract flexvert_xpos - it will be all 0s. And the initial mjx_data struct will be empty.

Minimal model for reproduction

No response

Code required for reproduction

No response

Confirmations

@aespielberg aespielberg added the bug Something isn't working label May 28, 2025
@btaba btaba self-assigned this May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants