google-deepmind / google-deepmind/mujoco

Bugs found when building MuJuCo with USD

Open
#3,004 6 comments 0 reactions 1 assignee Claimed by @havess View on GitHub
bug
Dominant language
C++
Stars
15.2k
Forks
1.8k
Avg merge
10d 16h
Merged PRs (30d)
25

Description

### Intro

Hi!

I am a graduate student at ECNU, I use MuJoCo for my research on EmbodiedAI.

### My setup

MuJoCo with USD on arm64 MacOS 26.1

### What's happening? What did you expect?

I built the mujuco myself with the MUJOCO_WITH_USD=True and expecting to drag and load usd files in the simulate.cc.
Here are some bugs I have met with.

1. The official documentation on [MuJuCo](https://mujoco.readthedocs.io/en/latest/OpenUSD/building.html) does not match the latest building pipeline, the document is still using **USD_DIR** to specify the self-built USD lib instead of the lastest **pxr_DIR** and does not mention that the user need to set MUJOCO_WITH_USD to True in order to build mujuco with usd.
2. There seem to be some issue on the **mjUSEUSD** variable since I didn't find where it is defined in the whole project but its defination is checked in many src files such as "simulate/main.cc". Even if I set MUJOCO_WITH_USD to True I still can't drag and load usd files in **simulate.cc**. The **simulate.cc** won't print OpenUSD version as it is assumed to. It will try to load a usd file as an xml and throw XML Error because **mjUSEUSD** is never defined.
3. According to the github update log there should be no need to manually set plugin info with `export PXR_PLUGINPATH_NAME=/usr/local/lib/mujocoUsd/resources/*/plugInfo.json`, the official documentation needs an update.

### Steps for reproduction

1. build the mujuco with usd using
```
cmake .. -DCMAKE_BUILD_TYPE=Release -DMUJOCO_WITH_USD=True
cmake --build . -j 30
sudo cmake --install .
```
2. run `simulate` and try drag and load a usd file, it will throw you some error with XML.

### 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.