Added crop_dataset_roi.py that allows you to load a lerobotdataset -> crop its images -> create a new lerobot dataset with the cropped and resized images.

Co-authored-by: Adil Zouitine <adilzouitinegm@gmail.com>
This commit is contained in:
Michel Aractingi
2025-02-03 17:48:35 +00:00
committed by AdilZouitine
parent 179ee3b1f6
commit 87c7eca582
3 changed files with 267 additions and 149 deletions

View File

@@ -315,7 +315,9 @@ def reset_environment(robot, events, reset_time_s, fps):
def reset_follower_position(robot: Robot, target_position):
current_position = robot.follower_arms["main"].read("Present_Position")
trajectory = torch.from_numpy(np.linspace(current_position, target_position, 30)) # NOTE: 30 is just an aribtrary number
trajectory = torch.from_numpy(
np.linspace(current_position, target_position, 30)
) # NOTE: 30 is just an aribtrary number
for pose in trajectory:
robot.send_action(pose)
busy_wait(0.015)