google-deepmind / google-deepmind/mujoco
Getting the GLFW context of "Simulate" in Python
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
### The feature, motivation and pitch
Hi, as a follow up to [#766](https://github.com/google-deepmind/mujoco/issues/766) (and also somewhat related to [#965](https://github.com/google-deepmind/mujoco/issues/965)):
I am running mujoco passive viewer via `mujoco.launch_passive` in python (which is a wrapper around mujoco `simulate.cc`). I would like to have access to the GLFW window/ mjrContext so that I can:
- run [mjr_figure](https://mujoco.readthedocs.io/en/stable/APIreference/APIfunctions.html#mjr-figure) to add custom 2D plots to the viewer, which requires access to the mjrContext
- add custom imgui overlays to the mujoco viewer by rendering to the same GLFW context/window
- create/render mjui (e.g. [mjui_render](https://mujoco.readthedocs.io/en/stable/APIreference/APIfunctions.html#mjui-render)) which requires access to mjrContext.
### Alternatives
Currently it seems like the workaround would either be to render everything else in a separately managed glfw window or copy and modify the launch_passive/simulate functionality so that we have access to this?
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.