From a5518a678111a300002075e5e070ce7941618629 Mon Sep 17 00:00:00 2001 From: ydy0615 Date: Thu, 11 Dec 2025 21:34:12 +0800 Subject: [PATCH] feat: add double SO101 follower/leader support throughout the codebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Import and expose `so101_follower_double` (and corresponding leader) in examples, async inference, and scripts. - Extend `SUPPORTED_ROBOTS` to include `so101_follower_double`. - Update `make_robot_from_config` to handle the new robot type. - Adjust calibration, joint limit discovery, recording, and replay scripts to use the double variant where appropriate. This enhances compatibility with dual‑arm configurations. --- examples/backward_compatibility/replay.py | 1 + examples/rtc/eval_with_real_robot.py | 1 + src/lerobot/async_inference/constants.py | 2 +- src/lerobot/async_inference/robot_client.py | 1 + src/lerobot/robots/utils.py | 4 ++++ src/lerobot/scripts/lerobot_calibrate.py | 3 ++- src/lerobot/scripts/lerobot_find_joint_limits.py | 2 ++ src/lerobot/scripts/lerobot_record.py | 2 ++ src/lerobot/scripts/lerobot_replay.py | 1 + src/lerobot/scripts/lerobot_setup_motors.py | 2 ++ src/lerobot/scripts/lerobot_teleoperate.py | 2 ++ 11 files changed, 19 insertions(+), 2 deletions(-) diff --git a/examples/backward_compatibility/replay.py b/examples/backward_compatibility/replay.py index ed52a24..b0b160d 100644 --- a/examples/backward_compatibility/replay.py +++ b/examples/backward_compatibility/replay.py @@ -43,6 +43,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double, ) from lerobot.utils.constants import ACTION from lerobot.utils.robot_utils import precise_sleep diff --git a/examples/rtc/eval_with_real_robot.py b/examples/rtc/eval_with_real_robot.py index 6f05148..3aaf5bc 100644 --- a/examples/rtc/eval_with_real_robot.py +++ b/examples/rtc/eval_with_real_robot.py @@ -97,6 +97,7 @@ from lerobot.robots import ( # noqa: F401 koch_follower, so100_follower, so101_follower, + so101_follower_double, ) from lerobot.robots.utils import make_robot_from_config from lerobot.utils.constants import OBS_IMAGES diff --git a/src/lerobot/async_inference/constants.py b/src/lerobot/async_inference/constants.py index 1b1dac0..77acbb7 100644 --- a/src/lerobot/async_inference/constants.py +++ b/src/lerobot/async_inference/constants.py @@ -26,4 +26,4 @@ DEFAULT_OBS_QUEUE_TIMEOUT = 2 SUPPORTED_POLICIES = ["act", "smolvla", "diffusion", "tdmpc", "vqbet", "pi0", "pi05"] # TODO: Add all other robots -SUPPORTED_ROBOTS = ["so100_follower", "so101_follower", "bi_so100_follower"] +SUPPORTED_ROBOTS = ["so100_follower", "so101_follower", "so101_follower_double", "bi_so100_follower"] diff --git a/src/lerobot/async_inference/robot_client.py b/src/lerobot/async_inference/robot_client.py index f9d70a6..256d810 100644 --- a/src/lerobot/async_inference/robot_client.py +++ b/src/lerobot/async_inference/robot_client.py @@ -56,6 +56,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double, ) from lerobot.transport import ( services_pb2, # type: ignore diff --git a/src/lerobot/robots/utils.py b/src/lerobot/robots/utils.py index 4e80015..d7f35ef 100644 --- a/src/lerobot/robots/utils.py +++ b/src/lerobot/robots/utils.py @@ -36,6 +36,10 @@ def make_robot_from_config(config: RobotConfig) -> Robot: from .so101_follower import SO101Follower return SO101Follower(config) + elif config.type == "so101_follower_double": + from .so101_follower_double import SO101FollowerDouble + + return SO101FollowerDouble(config) elif config.type == "lekiwi": from .lekiwi import LeKiwi diff --git a/src/lerobot/scripts/lerobot_calibrate.py b/src/lerobot/scripts/lerobot_calibrate.py index 8247ec0..789303d 100644 --- a/src/lerobot/scripts/lerobot_calibrate.py +++ b/src/lerobot/scripts/lerobot_calibrate.py @@ -42,6 +42,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double, ) from lerobot.teleoperators import ( # noqa: F401 Teleoperator, @@ -50,7 +51,7 @@ from lerobot.teleoperators import ( # noqa: F401 koch_leader, make_teleoperator_from_config, so100_leader, - so101_leader, + so101_leader_double, ) from lerobot.utils.import_utils import register_third_party_plugins from lerobot.utils.utils import init_logging diff --git a/src/lerobot/scripts/lerobot_find_joint_limits.py b/src/lerobot/scripts/lerobot_find_joint_limits.py index 95fbd06..c35414c 100644 --- a/src/lerobot/scripts/lerobot_find_joint_limits.py +++ b/src/lerobot/scripts/lerobot_find_joint_limits.py @@ -48,6 +48,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double ) from lerobot.teleoperators import ( # noqa: F401 TeleoperatorConfig, @@ -56,6 +57,7 @@ from lerobot.teleoperators import ( # noqa: F401 make_teleoperator_from_config, so100_leader, so101_leader, + so101_leader_double ) from lerobot.utils.robot_utils import precise_sleep diff --git a/src/lerobot/scripts/lerobot_record.py b/src/lerobot/scripts/lerobot_record.py index 255e968..37dade4 100644 --- a/src/lerobot/scripts/lerobot_record.py +++ b/src/lerobot/scripts/lerobot_record.py @@ -99,6 +99,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double ) from lerobot.teleoperators import ( # noqa: F401 Teleoperator, @@ -109,6 +110,7 @@ from lerobot.teleoperators import ( # noqa: F401 make_teleoperator_from_config, so100_leader, so101_leader, + so101_leader_double ) from lerobot.teleoperators.keyboard.teleop_keyboard import KeyboardTeleop from lerobot.utils.constants import ACTION, OBS_STR diff --git a/src/lerobot/scripts/lerobot_replay.py b/src/lerobot/scripts/lerobot_replay.py index 52cb1d7..7ad48d4 100644 --- a/src/lerobot/scripts/lerobot_replay.py +++ b/src/lerobot/scripts/lerobot_replay.py @@ -60,6 +60,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double ) from lerobot.utils.constants import ACTION from lerobot.utils.import_utils import register_third_party_plugins diff --git a/src/lerobot/scripts/lerobot_setup_motors.py b/src/lerobot/scripts/lerobot_setup_motors.py index c1d256c..ab0603e 100644 --- a/src/lerobot/scripts/lerobot_setup_motors.py +++ b/src/lerobot/scripts/lerobot_setup_motors.py @@ -35,6 +35,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double ) from lerobot.teleoperators import ( # noqa: F401 TeleoperatorConfig, @@ -42,6 +43,7 @@ from lerobot.teleoperators import ( # noqa: F401 make_teleoperator_from_config, so100_leader, so101_leader, + so101_leader_double ) COMPATIBLE_DEVICES = [ diff --git a/src/lerobot/scripts/lerobot_teleoperate.py b/src/lerobot/scripts/lerobot_teleoperate.py index d83766b..3fe2e05 100644 --- a/src/lerobot/scripts/lerobot_teleoperate.py +++ b/src/lerobot/scripts/lerobot_teleoperate.py @@ -77,6 +77,7 @@ from lerobot.robots import ( # noqa: F401 make_robot_from_config, so100_follower, so101_follower, + so101_follower_double ) from lerobot.teleoperators import ( # noqa: F401 Teleoperator, @@ -89,6 +90,7 @@ from lerobot.teleoperators import ( # noqa: F401 make_teleoperator_from_config, so100_leader, so101_leader, + so101_leader_double ) from lerobot.utils.import_utils import register_third_party_plugins from lerobot.utils.robot_utils import precise_sleep