[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2025-04-03 16:23:42 +00:00
parent 0e0ec90acb
commit ea9fa69435
1 changed files with 5 additions and 4 deletions
lerobot/common/robot_devices

View File

@ -26,9 +26,9 @@ from functools import cache
import cv2 import cv2
import torch import torch
import tqdm
from deepdiff import DeepDiff from deepdiff import DeepDiff
from termcolor import colored from termcolor import colored
import tqdm
from lerobot.common.datasets.image_writer import safe_stop_image_writer from lerobot.common.datasets.image_writer import safe_stop_image_writer
from lerobot.common.datasets.lerobot_dataset import LeRobotDataset from lerobot.common.datasets.lerobot_dataset import LeRobotDataset
@ -300,20 +300,21 @@ def reset_environment(robot, events, reset_time_s, fps):
start_loop_t = time.perf_counter() start_loop_t = time.perf_counter()
robot.teleop_step(record_data=False) robot.teleop_step(record_data=False)
timestamp = time.perf_counter() - start_vencod_t timestamp = time.perf_counter() - start_vencod_t
# Update progress bar every second # Update progress bar every second
current_second = int(timestamp) current_second = int(timestamp)
if current_second > last_update: if current_second > last_update:
pbar.update(current_second - last_update) pbar.update(current_second - last_update)
last_update = current_second last_update = current_second
if events["exit_early"]: if events["exit_early"]:
events["exit_early"] = False events["exit_early"] = False
break break
dt_s = time.perf_counter() - start_loop_t dt_s = time.perf_counter() - start_loop_t
busy_wait(1 / fps - dt_s) busy_wait(1 / fps - dt_s)
def stop_recording(robot, listener, display_cameras): def stop_recording(robot, listener, display_cameras):
robot.disconnect() robot.disconnect()