google-deepmind / google-deepmind/mujoco

Save XML on Managed Viewer Fails

Open
#2,728 1 comment 0 reactions 0 assignees View on GitHub
enhancement
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

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.