Closed surgura closed 2 years ago
You mean after you close your program and then restart it? Or close the viewer programmatically and then reopen it?
The latter. Excuse me, I should have included a minimal example. Running mujoco viewer's sample.py
multiple times within the same python script leads to a black window the second time on my machine:
import mujoco
import mujoco_viewer
while True:
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
# create the viewer object
viewer = mujoco_viewer.MujocoViewer(model, data)
# simulate and render
for _ in range(100):
mujoco.mj_step(model, data)
viewer.render()
# close
viewer.close()
Hi @surgura Thanks for the minimal example.
I could reproduce the problem, and it seems to have happened because mujoco context wasn't being freed (only made available after mujoco 2.1.2) Could you retry after updating mujoco-python-viewer? This will also update your mujoco to 2.1.5
Definitely working now. Thank you very much for the quick effort!
Nice!
Whenever I run a simulation, close it, and restart a second one the window only shows a black screen. Do other people have this issue as well?