From 6163daaaa4fa193d0e37468a94d90e07ef3c95ce Mon Sep 17 00:00:00 2001 From: Francesco Capuano <74058581+fracapuano@users.noreply.github.com> Date: Thu, 22 May 2025 21:37:21 +0200 Subject: [PATCH] Fix: emptying action queue between resets (#1117) --- lerobot/common/robot_devices/control_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lerobot/common/robot_devices/control_utils.py b/lerobot/common/robot_devices/control_utils.py index 76e264999..68f69487b 100644 --- a/lerobot/common/robot_devices/control_utils.py +++ b/lerobot/common/robot_devices/control_utils.py @@ -243,6 +243,11 @@ def control_loop( timestamp = 0 start_episode_t = time.perf_counter() + + # Controls starts, if policy is given it needs cleaning up + if policy is not None: + policy.reset() + while timestamp < control_time_s: start_loop_t = time.perf_counter()