Open
Description
Intro
MuJoCo advanced user
My setup
MuJoCo 3.2.4, mac os
What's happening? What did you expect?
Repeated calls to update textures window.update_texture(tex.id)
blocks window.is_running()
bug.mov
cc @saran-t
Steps for reproduction
- Run the code below.
- close the viewer()
- execution hangs without exit
Minimal model for reproduction
import time
from mujoco import viewer
XML = r"""
<mujoco>
<asset>
<texture name="tex_rgb" builtin="gradient" type="2d" mark="edge" height="480" width="640" rgb1=".3 .4 .5"/>
<material name="tex_rgb" reflectance="0.05" texture="tex_rgb" texrepeat="1 1" texuniform="false"/>
</asset>
<worldbody>
<geom type="plane" size="5 5 2" rgba="1 1 1 1" material="tex_rgb"/>
</worldbody>
</mujoco>
"""
mj_model = mujoco.MjModel.from_xml_string(XML)
mj_data = mujoco.MjData(mj_model)
tex = mj_model.tex("tex_rgb")
window = viewer.launch_passive(
mj_model,
mj_data,
show_left_ui=False,
show_right_ui=False,
)
while window.is_running():
mujoco.mj_step(mj_model, mj_data)
window.update_texture(tex.id)
window.sync()
time.sleep(mj_model.opt.timestep)
print("Clean Exit")
Code required for reproduction
See above
Confirmations
- I searched the latest documentation thoroughly before posting.
- I searched previous Issues and Discussions, I am certain this has not been raised before.