google-deepmind / google-deepmind/mujoco
Save XML on Managed Viewer Fails
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
### My setup
* Tested on a bunch of MuJoCo versions, (3.3.3 and below).
* Python 3.11
* MacOS and Linux
### What's happening? What did you expect?
When trying to save an XML after launching the managed viewer from python, the saved XML will be empty and the following error will be written to std upon exit: `Save XML error: No XML model loaded%`.
### Steps for reproduction
1. Run the below code, it will open up simulate.
2. Hit `Save xml`
### Minimal model for reproduction
_No response_
### Code required for reproduction
```python
import mujoco
import mujoco.viewer
spec = mujoco.MjSpec()
mujoco.viewer.launch(spec.compile())
```
### 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.