fix: 完善 MuJoCo 退出与测试环境
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user