From 639e77876da2d36df12ca5ab9ae194ea1f8c04c2 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Mon, 2 Oct 2023 04:59:59 -0700 Subject: [PATCH] Improved unpause behavior in simulate. PiperOrigin-RevId: 570030315 Change-Id: I5822f8686ba2fd7c5c59a9fa73fc29000a8406ec --- python/mujoco/viewer.py | 2 +- simulate/main.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mujoco/viewer.py b/python/mujoco/viewer.py index 48ad9405..61520240 100644 --- a/python/mujoco/viewer.py +++ b/python/mujoco/viewer.py @@ -300,7 +300,7 @@ def _physics_loop(simulate: _Simulate, loader: Optional[_InternalLoaderType]): # Run mj_forward, to update rendering and joint sliders. mujoco.mj_forward(m, d) - synccpu = time.time() + simulate.speed_changed = True def _launch_internal( diff --git a/simulate/main.cc b/simulate/main.cc index 5ccc3ee6..71aad17d 100644 --- a/simulate/main.cc +++ b/simulate/main.cc @@ -400,7 +400,7 @@ void PhysicsLoop(mj::Simulate& sim) { else { // run mj_forward, to update rendering and joint sliders mj_forward(m, d); - syncCPU = mj::Simulate::Clock::now(); + sim.speed_changed = true; } } } // release std::lock_guard