mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-24 21:19:53 +00:00
fix(scripts): better prints teleop (#2538)
This commit is contained in:
@@ -170,12 +170,13 @@ def teleop_loop(
|
|||||||
# Display the final robot action that was sent
|
# Display the final robot action that was sent
|
||||||
for motor, value in robot_action_to_send.items():
|
for motor, value in robot_action_to_send.items():
|
||||||
print(f"{motor:<{display_len}} | {value:>7.2f}")
|
print(f"{motor:<{display_len}} | {value:>7.2f}")
|
||||||
move_cursor_up(len(robot_action_to_send) + 5)
|
move_cursor_up(len(robot_action_to_send) + 3)
|
||||||
|
|
||||||
dt_s = time.perf_counter() - loop_start
|
dt_s = time.perf_counter() - loop_start
|
||||||
precise_sleep(1 / fps - dt_s)
|
precise_sleep(1 / fps - dt_s)
|
||||||
loop_s = time.perf_counter() - loop_start
|
loop_s = time.perf_counter() - loop_start
|
||||||
print(f"\ntime: {loop_s * 1e3:.2f}ms ({1 / loop_s:.0f} Hz)")
|
print(f"Teleop loop time: {loop_s * 1e3:.2f}ms ({1 / loop_s:.0f} Hz)")
|
||||||
|
move_cursor_up(1)
|
||||||
|
|
||||||
if duration is not None and time.perf_counter() - start >= duration:
|
if duration is not None and time.perf_counter() - start >= duration:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user