Skip to content

Commit

Permalink
Handle fps=None in control_loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadene committed Oct 14, 2024
1 parent 94c3a48 commit 99414f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lerobot/common/robot_devices/control_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 99414f3

Please sign in to comment.