Add files using upload-large-folder tool
Browse files- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-077.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-078.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-079.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-080.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-081.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-082.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-083.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-084.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-085.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-086.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-087.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-088.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-089.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-090.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-091.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-092.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-093.mp4 +3 -0
- lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-094.mp4 +3 -0
- lerobot/src/lerobot/teleoperators/so_leader/so101.md +1 -0
- lerobot/src/lerobot/teleoperators/so_leader/so_leader.py +160 -0
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-077.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1c1917358689182aeb8f08ce9c4fe0e2b846f99283939cf1e145217b7f3d0a4f
|
| 3 |
+
size 25611
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-078.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b6f33b623522fa88f52e88255ec3957a1fd9fe570881e9313e890f0a5c08c5a
|
| 3 |
+
size 25618
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-079.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1ea8f5d803fd20653face33552ec2bde821259c9f10d92da6fc786c7687f644
|
| 3 |
+
size 26072
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-080.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:82646b7be54633d7ba732a9e7d3cb4894c4f91bcc0e372ac90296b05c0cd3da3
|
| 3 |
+
size 25542
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-081.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b9cd85639f51735d2761d28185ed073273d004818fdb0f47038ff388f44ca552
|
| 3 |
+
size 26635
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-082.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e4639eb5c2387eb12d938857b5a7f9c1d4ba924bd97726df02af43371395435
|
| 3 |
+
size 25719
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-083.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b877d503fa6c6b31cf2f5e933e4524cfb6a73d616f9deebb49688f0dc2d4af3
|
| 3 |
+
size 26427
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-084.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a883f17af7c5d505560004fe23f695764d97bb016eab6aff23baf111fc55cafe
|
| 3 |
+
size 24959
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-085.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a93a23ad5fb00b234b9036df0af5dd52165d02725c486824ab477b7a223030e
|
| 3 |
+
size 26209
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-086.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85bd5186b2d140c6af8a46311cd5351a87cef278dbe8d7a47add60192167b1a4
|
| 3 |
+
size 26066
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-087.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a4e346f9390ce276286d78a524715457aac21c93ffb90991fb82fb79ccdd72c
|
| 3 |
+
size 25374
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-088.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ee8253dac6436181d7320dd651879fc21e900c8e6efd10b310bad6f45e13c48
|
| 3 |
+
size 25278
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-089.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d612d9e44ad9045844494ddfd5630f57b421ca61b5f25711241ac12fc0650ad
|
| 3 |
+
size 26645
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-090.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f94a7c5ac07ccb69aa0aa1bd8ed13f11abdb9b00c6d756ccf5a8224c56568447
|
| 3 |
+
size 26105
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-091.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e8c97c34c7609a0a9b73a71d914230a43d2defd017cca2a93e1571fc44c1e70
|
| 3 |
+
size 26275
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-092.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2fefdc7083973aebe39678fb19ca62a56d689d9e43e4a2525162d289e4fac210
|
| 3 |
+
size 25721
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-093.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:83dfdd042348d16259149b9b4ad9f7adb5d9e1f6c6fc8425e0d7492771753e0d
|
| 3 |
+
size 25979
|
lerobot/dataset/session_20260116_163348/videos/observation.masks.CameraLeft/chunk-002/file-094.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:51be7dcf85c7a2c3346ff000e4fd9b004bd0e7d05230551e13227d0387bf9205
|
| 3 |
+
size 26287
|
lerobot/src/lerobot/teleoperators/so_leader/so101.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
../../../../docs/source/so101.mdx
|
lerobot/src/lerobot/teleoperators/so_leader/so_leader.py
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# !/usr/bin/env python
|
| 2 |
+
|
| 3 |
+
# Copyright 2026 The HuggingFace Inc. team. All rights reserved.
|
| 4 |
+
#
|
| 5 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
# you may not use this file except in compliance with the License.
|
| 7 |
+
# You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
|
| 17 |
+
import logging
|
| 18 |
+
import time
|
| 19 |
+
from typing import TypeAlias
|
| 20 |
+
|
| 21 |
+
from lerobot.motors import Motor, MotorCalibration, MotorNormMode
|
| 22 |
+
from lerobot.motors.feetech import (
|
| 23 |
+
FeetechMotorsBus,
|
| 24 |
+
OperatingMode,
|
| 25 |
+
)
|
| 26 |
+
from lerobot.utils.decorators import check_if_already_connected, check_if_not_connected
|
| 27 |
+
|
| 28 |
+
from ..teleoperator import Teleoperator
|
| 29 |
+
from .config_so_leader import SOLeaderTeleopConfig
|
| 30 |
+
|
| 31 |
+
logger = logging.getLogger(__name__)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
class SOLeader(Teleoperator):
|
| 35 |
+
"""Generic SO leader base for SO-100/101/10X teleoperators."""
|
| 36 |
+
|
| 37 |
+
config_class = SOLeaderTeleopConfig
|
| 38 |
+
name = "so_leader"
|
| 39 |
+
|
| 40 |
+
def __init__(self, config: SOLeaderTeleopConfig):
|
| 41 |
+
super().__init__(config)
|
| 42 |
+
self.config = config
|
| 43 |
+
norm_mode_body = MotorNormMode.DEGREES if config.use_degrees else MotorNormMode.RANGE_M100_100
|
| 44 |
+
self.bus = FeetechMotorsBus(
|
| 45 |
+
port=self.config.port,
|
| 46 |
+
motors={
|
| 47 |
+
"shoulder_pan": Motor(1, "sts3215", norm_mode_body),
|
| 48 |
+
"shoulder_lift": Motor(2, "sts3215", norm_mode_body),
|
| 49 |
+
"elbow_flex": Motor(3, "sts3215", norm_mode_body),
|
| 50 |
+
"wrist_flex": Motor(4, "sts3215", norm_mode_body),
|
| 51 |
+
"wrist_roll": Motor(5, "sts3215", norm_mode_body),
|
| 52 |
+
"gripper": Motor(6, "sts3215", MotorNormMode.RANGE_0_100),
|
| 53 |
+
},
|
| 54 |
+
calibration=self.calibration,
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
@property
|
| 58 |
+
def action_features(self) -> dict[str, type]:
|
| 59 |
+
return {f"{motor}.pos": float for motor in self.bus.motors}
|
| 60 |
+
|
| 61 |
+
@property
|
| 62 |
+
def feedback_features(self) -> dict[str, type]:
|
| 63 |
+
return {}
|
| 64 |
+
|
| 65 |
+
@property
|
| 66 |
+
def is_connected(self) -> bool:
|
| 67 |
+
return self.bus.is_connected
|
| 68 |
+
|
| 69 |
+
@check_if_already_connected
|
| 70 |
+
def connect(self, calibrate: bool = True) -> None:
|
| 71 |
+
self.bus.connect()
|
| 72 |
+
if not self.is_calibrated and calibrate:
|
| 73 |
+
logger.info(
|
| 74 |
+
"Mismatch between calibration values in the motor and the calibration file or no calibration file found"
|
| 75 |
+
)
|
| 76 |
+
self.calibrate()
|
| 77 |
+
|
| 78 |
+
self.configure()
|
| 79 |
+
logger.info(f"{self} connected.")
|
| 80 |
+
|
| 81 |
+
@property
|
| 82 |
+
def is_calibrated(self) -> bool:
|
| 83 |
+
return self.bus.is_calibrated
|
| 84 |
+
|
| 85 |
+
def calibrate(self) -> None:
|
| 86 |
+
if self.calibration:
|
| 87 |
+
# Calibration file exists, ask user whether to use it or run new calibration
|
| 88 |
+
user_input = input(
|
| 89 |
+
f"Press ENTER to use provided calibration file associated with the id {self.id}, or type 'c' and press ENTER to run calibration: "
|
| 90 |
+
)
|
| 91 |
+
if user_input.strip().lower() != "c":
|
| 92 |
+
logger.info(f"Writing calibration file associated with the id {self.id} to the motors")
|
| 93 |
+
self.bus.write_calibration(self.calibration)
|
| 94 |
+
return
|
| 95 |
+
|
| 96 |
+
logger.info(f"\nRunning calibration of {self}")
|
| 97 |
+
self.bus.disable_torque()
|
| 98 |
+
for motor in self.bus.motors:
|
| 99 |
+
self.bus.write("Operating_Mode", motor, OperatingMode.POSITION.value)
|
| 100 |
+
|
| 101 |
+
input(f"Move {self} to the middle of its range of motion and press ENTER....")
|
| 102 |
+
homing_offsets = self.bus.set_half_turn_homings()
|
| 103 |
+
|
| 104 |
+
full_turn_motor = "wrist_roll"
|
| 105 |
+
unknown_range_motors = [motor for motor in self.bus.motors if motor != full_turn_motor]
|
| 106 |
+
print(
|
| 107 |
+
f"Move all joints except '{full_turn_motor}' sequentially through their "
|
| 108 |
+
"entire ranges of motion.\nRecording positions. Press ENTER to stop..."
|
| 109 |
+
)
|
| 110 |
+
range_mins, range_maxes = self.bus.record_ranges_of_motion(unknown_range_motors)
|
| 111 |
+
range_mins[full_turn_motor] = 0
|
| 112 |
+
range_maxes[full_turn_motor] = 4095
|
| 113 |
+
|
| 114 |
+
self.calibration = {}
|
| 115 |
+
for motor, m in self.bus.motors.items():
|
| 116 |
+
self.calibration[motor] = MotorCalibration(
|
| 117 |
+
id=m.id,
|
| 118 |
+
drive_mode=0,
|
| 119 |
+
homing_offset=homing_offsets[motor],
|
| 120 |
+
range_min=range_mins[motor],
|
| 121 |
+
range_max=range_maxes[motor],
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
self.bus.write_calibration(self.calibration)
|
| 125 |
+
self._save_calibration()
|
| 126 |
+
print(f"Calibration saved to {self.calibration_fpath}")
|
| 127 |
+
|
| 128 |
+
def configure(self) -> None:
|
| 129 |
+
self.bus.disable_torque()
|
| 130 |
+
self.bus.configure_motors()
|
| 131 |
+
for motor in self.bus.motors:
|
| 132 |
+
self.bus.write("Operating_Mode", motor, OperatingMode.POSITION.value)
|
| 133 |
+
|
| 134 |
+
def setup_motors(self) -> None:
|
| 135 |
+
for motor in reversed(self.bus.motors):
|
| 136 |
+
input(f"Connect the controller board to the '{motor}' motor only and press enter.")
|
| 137 |
+
self.bus.setup_motor(motor)
|
| 138 |
+
print(f"'{motor}' motor id set to {self.bus.motors[motor].id}")
|
| 139 |
+
|
| 140 |
+
@check_if_not_connected
|
| 141 |
+
def get_action(self) -> dict[str, float]:
|
| 142 |
+
start = time.perf_counter()
|
| 143 |
+
action = self.bus.sync_read("Present_Position")
|
| 144 |
+
action = {f"{motor}.pos": val for motor, val in action.items()}
|
| 145 |
+
dt_ms = (time.perf_counter() - start) * 1e3
|
| 146 |
+
logger.debug(f"{self} read action: {dt_ms:.1f}ms")
|
| 147 |
+
return action
|
| 148 |
+
|
| 149 |
+
def send_feedback(self, feedback: dict[str, float]) -> None:
|
| 150 |
+
# TODO: Implement force feedback
|
| 151 |
+
raise NotImplementedError
|
| 152 |
+
|
| 153 |
+
@check_if_not_connected
|
| 154 |
+
def disconnect(self) -> None:
|
| 155 |
+
self.bus.disconnect()
|
| 156 |
+
logger.info(f"{self} disconnected.")
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
SO100Leader: TypeAlias = SOLeader
|
| 160 |
+
SO101Leader: TypeAlias = SOLeader
|