Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging #463

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cache/calibration/koch/main_follower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"homing_offset": [2048, 3072, 3072, 3072, -3072, -2048], "drive_mode": [1, 1, 1, 1, 0, 0], "start_pos": [2033, 3036, 2965, 3157, 3075, 2002], "end_pos": [-1019, -2043, -2023, -2027, 4081, 2981], "calib_mode": ["DEGREE", "DEGREE", "DEGREE", "DEGREE", "DEGREE", "DEGREE"], "motor_names": ["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll", "gripper"]}
1 change: 1 addition & 0 deletions .cache/calibration/koch/main_leader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"homing_offset": [2048, 3072, -1024, -1024, -4096, -2048], "drive_mode": [1, 1, 0, 0, 0, 0], "start_pos": [2002, 3124, 1048, 955, 4136, 1948], "end_pos": [-921, -2029, 2112, 2002, 4967, 2694], "calib_mode": ["DEGREE", "DEGREE", "DEGREE", "DEGREE", "DEGREE", "DEGREE"], "motor_names": ["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll", "gripper"]}
5 changes: 5 additions & 0 deletions lerobot/common/robot_devices/cameras/opencv.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ def connect(self):
if platform.system() == "Linux":
# Linux uses ports for connecting to cameras
tmp_camera = cv2.VideoCapture(f"/dev/video{self.camera_index}")
elif platform.system() == "Windows":
# Windows needs to use CAP_DSHOW for fast camera access
tmp_camera = cv2.VideoCapture(self.camera_index, cv2.CAP_DSHOW)
else:
tmp_camera = cv2.VideoCapture(self.camera_index)

Expand All @@ -258,6 +261,8 @@ def connect(self):
# needs to be re-created.
if platform.system() == "Linux":
self.camera = cv2.VideoCapture(f"/dev/video{self.camera_index}")
elif platform.system() == "Windows":
self.camera = cv2.VideoCapture(self.camera_index, cv2.CAP_DSHOW)
else:
self.camera = cv2.VideoCapture(self.camera_index)

Expand Down
1 change: 1 addition & 0 deletions lerobot/common/robot_devices/robots/manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def connect(self):

# Connect the cameras
for name in self.cameras:
print(f"Connecting {name} camera.")
self.cameras[name].connect()

self.is_connected = True
Expand Down
16 changes: 8 additions & 8 deletions lerobot/configs/robot/koch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ max_relative_target: null
leader_arms:
main:
_target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus
port: /dev/tty.usbmodem575E0031751
port: COM7
motors:
# name: (index, model)
shoulder_pan: [1, "xl330-m077"]
Expand All @@ -23,7 +23,7 @@ leader_arms:
follower_arms:
main:
_target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus
port: /dev/tty.usbmodem575E0032081
port: COM6
motors:
# name: (index, model)
shoulder_pan: [1, "xl430-w250"]
Expand All @@ -35,17 +35,17 @@ follower_arms:

cameras:
laptop:
_target_: lerobot.common.robot_devices.cameras.opencv.OpenCVCamera
camera_index: 0
fps: 30
width: 640
height: 480
phone:
_target_: lerobot.common.robot_devices.cameras.opencv.OpenCVCamera
camera_index: 1
fps: 30
width: 640
height: 480
# phone:
# _target_: lerobot.common.robot_devices.cameras.opencv.OpenCVCamera
# camera_index: 1
# fps: 30
# width: 640
# height: 480

# ~ Koch specific settings ~
# Sets the leader arm in torque mode with the gripper motor set to this angle. This makes it possible
Expand Down
16 changes: 16 additions & 0 deletions lerobot/scripts/test_push.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from lerobot.common.datasets.lerobot_dataset import LeRobotDataset
from lerobot.scripts.push_dataset_to_hub import push_meta_data_to_hub, push_videos_to_hub, create_branch
from pathlib import Path

repo_id = 'bchandaka/acm_move_square'
root = 'data'

dataset = LeRobotDataset(repo_id, root=root)
dataset.hf_dataset.push_to_hub(repo_id, revision="main")
local_dir = Path('./data/bchandaka/acm_move_square')
meta_data_dir = local_dir / "meta_data"
videos_dir = local_dir / "videos"
push_meta_data_to_hub(repo_id, meta_data_dir, revision="main")
push_videos_to_hub(repo_id, videos_dir, revision="main")
create_branch(repo_id, repo_type="dataset", branch='v1.6')