google-deepmind / google-deepmind/mujoco
USD decoder misses physics-purpose material bindings on colliders
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
### Intro
I am working on MJCF <-> USD roundtrip validation for MuJoCo models. One validation method compares physics-relevant compiled model fields after converting MJCF to USD and importing the USD back into MuJoCo.
### My setup
- MuJoCo built from source from `google-deepmind/mujoco` `main`.
- Build option: `MUJOCO_WITH_USD=ON`.
- API path: USD decoder plugin import, then compiled-model inspection.
- Platform: Linux x86_64.
- Source USD files are MuJoCo-authored USD generated from MJCF with contact properties.
### What's happening? What did you expect?
USD material bindings can use different purposes. A collider can bind one material for visual appearance and another material for physics.
Current behavior: the MuJoCo USD decoder computes the default/all-purpose material binding for colliders. That preserves the visual material assignment, but can miss a physics-purpose material carrying contact/friction properties.
Expected behavior: when a collider has a physics-purpose material binding, the decoder should read physics/contact properties from that material while still using the default binding for visual material assignment.
In roundtrip testing, missing the physics-purpose binding causes active collider friction and solver parameters to fall back to MuJoCo defaults even though the USD contains authored physics material data.
### Steps for reproduction
1. Convert the minimal MJCF below to MuJoCo-authored USD using the MuJoCo USD converter.
2. Import the USD into MuJoCo with the USD decoder plugin.
3. Inspect the decoded geom fields for `friction`, `solref`, `solimp`, `margin`, and `gap`.
4. Actual before the fix: contact properties can fall back to defaults because the physics-purpose material binding is not parsed.
5. Expected: the decoded geom preserves the authored contact/friction fields.
### Minimal model for reproduction
```xml
```
### Code required for reproduction
The repro path is:
```bash
# 1. Convert fixtures/active_contact_props.xml to USD.
# 2. Import the USD with MuJoCo's USD decoder plugin.
# 3. Save or inspect the decoded model and compare the active geom contact fields.
```
### Confirmations
- [x] I searched the [latest documentation](https://mujoco.readthedocs.io/en/latest/overview.html) thoroughly before posting.
- [x] I searched previous [Issues](https://github.com/google-deepmind/mujoco/issues) and [Discussions](https://github.com/google-deepmind/mujoco/discussions), I am certain this has not been raised before.
Contributor guide
Assessment
This issue has not been assessed yet.