From 99414f356f05dfe069735326547cf6e813703efa Mon Sep 17 00:00:00 2001 From: Remi Cadene Date: Mon, 14 Oct 2024 15:54:25 +0200 Subject: [PATCH] Handle fps=None in control_loop --- lerobot/common/robot_devices/control_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lerobot/common/robot_devices/control_utils.py b/lerobot/common/robot_devices/control_utils.py index 3b880fd3e..9855fee11 100644 --- a/lerobot/common/robot_devices/control_utils.py +++ b/lerobot/common/robot_devices/control_utils.py @@ -279,8 +279,9 @@ def control_loop( cv2.imshow(key, cv2.cvtColor(observation[key].numpy(), cv2.COLOR_RGB2BGR)) cv2.waitKey(1) - dt_s = time.perf_counter() - start_loop_t - busy_wait(1 / fps - dt_s) + if fps is not None: + dt_s = time.perf_counter() - start_loop_t + busy_wait(1 / fps - dt_s) dt_s = time.perf_counter() - start_loop_t log_control_info(robot, dt_s, fps=fps)