This commit is contained in:
Bryson Jones 2025-04-05 09:28:01 -07:00 committed by GitHub
commit c6ec5b8e66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 94 additions and 3 deletions

View File

@ -181,6 +181,7 @@ available_robots = [
"koch_bimanual", "koch_bimanual",
"aloha", "aloha",
"so100", "so100",
"so100_bimanual",
"moss", "moss",
] ]

View File

@ -494,6 +494,93 @@ class So100RobotConfig(ManipulatorRobotConfig):
mock: bool = False mock: bool = False
@RobotConfig.register_subclass("so100_bimanual")
@dataclass
class So100BimanualRobotConfig(ManipulatorRobotConfig):
calibration_dir: str = ".cache/calibration/so100_bimanual"
# `max_relative_target` limits the magnitude of the relative positional target vector for safety purposes.
# Set this to a positive scalar to have the same value for all motors, or a list that is the same length as
# the number of motors in your follower arms.
max_relative_target: int | None = None
leader_arms: dict[str, MotorsBusConfig] = field(
default_factory=lambda: {
"left": FeetechMotorsBusConfig(
port="/dev/tty.usbmodem585A0085511",
motors={
# name: (index, model)
"shoulder_pan": [1, "sts3215"],
"shoulder_lift": [2, "sts3215"],
"elbow_flex": [3, "sts3215"],
"wrist_flex": [4, "sts3215"],
"wrist_roll": [5, "sts3215"],
"gripper": [6, "sts3215"],
},
),
"right": FeetechMotorsBusConfig(
port="/dev/tty.usbmodem575E0031751",
motors={
# name: (index, model)
"shoulder_pan": [1, "sts3215"],
"shoulder_lift": [2, "sts3215"],
"elbow_flex": [3, "sts3215"],
"wrist_flex": [4, "sts3215"],
"wrist_roll": [5, "sts3215"],
"gripper": [6, "sts3215"],
},
),
}
)
follower_arms: dict[str, MotorsBusConfig] = field(
default_factory=lambda: {
"left": FeetechMotorsBusConfig(
port="/dev/tty.usbmodem585A0076891",
motors={
# name: (index, model)
"shoulder_pan": [1, "sts3215"],
"shoulder_lift": [2, "sts3215"],
"elbow_flex": [3, "sts3215"],
"wrist_flex": [4, "sts3215"],
"wrist_roll": [5, "sts3215"],
"gripper": [6, "sts3215"],
},
),
"right": FeetechMotorsBusConfig(
port="/dev/tty.usbmodem575E0032081",
motors={
# name: (index, model)
"shoulder_pan": [1, "sts3215"],
"shoulder_lift": [2, "sts3215"],
"elbow_flex": [3, "sts3215"],
"wrist_flex": [4, "sts3215"],
"wrist_roll": [5, "sts3215"],
"gripper": [6, "sts3215"],
},
),
}
)
cameras: dict[str, CameraConfig] = field(
default_factory=lambda: {
"laptop": OpenCVCameraConfig(
camera_index=0,
fps=30,
width=640,
height=480,
),
"phone": OpenCVCameraConfig(
camera_index=1,
fps=30,
width=640,
height=480,
),
}
)
mock: bool = False
@RobotConfig.register_subclass("stretch") @RobotConfig.register_subclass("stretch")
@dataclass @dataclass
class StretchRobotConfig(RobotConfig): class StretchRobotConfig(RobotConfig):

View File

@ -243,7 +243,7 @@ class ManipulatorRobot:
if self.robot_type in ["koch", "koch_bimanual", "aloha"]: if self.robot_type in ["koch", "koch_bimanual", "aloha"]:
from lerobot.common.robot_devices.motors.dynamixel import TorqueMode from lerobot.common.robot_devices.motors.dynamixel import TorqueMode
elif self.robot_type in ["so100", "moss", "lekiwi"]: elif self.robot_type in ["so100", "so100_bimanual", "moss", "lekiwi"]:
from lerobot.common.robot_devices.motors.feetech import TorqueMode from lerobot.common.robot_devices.motors.feetech import TorqueMode
# We assume that at connection time, arms are in a rest position, and torque can # We assume that at connection time, arms are in a rest position, and torque can
@ -260,7 +260,7 @@ class ManipulatorRobot:
self.set_koch_robot_preset() self.set_koch_robot_preset()
elif self.robot_type == "aloha": elif self.robot_type == "aloha":
self.set_aloha_robot_preset() self.set_aloha_robot_preset()
elif self.robot_type in ["so100", "moss", "lekiwi"]: elif self.robot_type in ["so100", "so100_bimanual", "moss", "lekiwi"]:
self.set_so100_robot_preset() self.set_so100_robot_preset()
# Enable torque on all motors of the follower arms # Enable torque on all motors of the follower arms
@ -313,7 +313,7 @@ class ManipulatorRobot:
calibration = run_arm_calibration(arm, self.robot_type, name, arm_type) calibration = run_arm_calibration(arm, self.robot_type, name, arm_type)
elif self.robot_type in ["so100", "moss", "lekiwi"]: elif self.robot_type in ["so100", "so100_bimanual", "moss", "lekiwi"]:
from lerobot.common.robot_devices.robots.feetech_calibration import ( from lerobot.common.robot_devices.robots.feetech_calibration import (
run_arm_manual_calibration, run_arm_manual_calibration,
) )

View File

@ -22,6 +22,7 @@ from lerobot.common.robot_devices.robots.configs import (
ManipulatorRobotConfig, ManipulatorRobotConfig,
MossRobotConfig, MossRobotConfig,
RobotConfig, RobotConfig,
So100BimanualRobotConfig,
So100RobotConfig, So100RobotConfig,
StretchRobotConfig, StretchRobotConfig,
) )
@ -58,6 +59,8 @@ def make_robot_config(robot_type: str, **kwargs) -> RobotConfig:
return MossRobotConfig(**kwargs) return MossRobotConfig(**kwargs)
elif robot_type == "so100": elif robot_type == "so100":
return So100RobotConfig(**kwargs) return So100RobotConfig(**kwargs)
elif robot_type == "so100_bimanual":
return So100BimanualRobotConfig(**kwargs)
elif robot_type == "stretch": elif robot_type == "stretch":
return StretchRobotConfig(**kwargs) return StretchRobotConfig(**kwargs)
elif robot_type == "lekiwi": elif robot_type == "lekiwi":