fix: 完善 MuJoCo 退出与测试环境

This commit is contained in:
2026-08-04 13:58:35 +08:00
parent 9c47c94c79
commit 1fefae34e5
4 changed files with 42 additions and 4 deletions
@@ -181,7 +181,16 @@ class DualArmSimulator(Node):
if self._viewer is not None:
self._viewer.close()
# MuJoCo 在后台 daemon 线程释放 GLX;立即退出解释器会触发段错误。
time.sleep(0.1)
deadline = time.monotonic() + 0.1
while True:
remaining = deadline - time.monotonic()
if remaining <= 0.0:
break
try:
time.sleep(remaining)
break
except KeyboardInterrupt:
continue
self._viewer = None