diff --git a/lerobot/common/robots/so100/__init__.py b/lerobot/common/robots/so100/__init__.py index 81b064c4..087fd645 100644 --- a/lerobot/common/robots/so100/__init__.py +++ b/lerobot/common/robots/so100/__init__.py @@ -1,4 +1,2 @@ -from .configuration_so100 import SO100RobotConfig -from .robot_so100 import SO100Robot - -__all__ = ["SO100RobotConfig", "SO100Robot"] +from .config_so100_follower import SO100FollowerConfig +from .so100_follower import SO100Follower diff --git a/lerobot/common/robots/so100/configuration_so100.py b/lerobot/common/robots/so100/config_so100_follower.py similarity index 83% rename from lerobot/common/robots/so100/configuration_so100.py rename to lerobot/common/robots/so100/config_so100_follower.py index e6cb9c75..fc432222 100644 --- a/lerobot/common/robots/so100/configuration_so100.py +++ b/lerobot/common/robots/so100/config_so100_follower.py @@ -5,10 +5,10 @@ from lerobot.common.cameras import CameraConfig from ..config import RobotConfig -@RobotConfig.register_subclass("so100") +@RobotConfig.register_subclass("so100_follower") @dataclass -class SO100RobotConfig(RobotConfig): - # Port to connect to the robot +class SO100FollowerConfig(RobotConfig): + # Port to connect to the arm port: str disable_torque_on_disconnect: bool = True diff --git a/lerobot/common/robots/so100/robot_so100.py b/lerobot/common/robots/so100/so100_follower.py similarity index 95% rename from lerobot/common/robots/so100/robot_so100.py rename to lerobot/common/robots/so100/so100_follower.py index e7222a9d..13c5739b 100644 --- a/lerobot/common/robots/so100/robot_so100.py +++ b/lerobot/common/robots/so100/so100_follower.py @@ -29,20 +29,20 @@ from lerobot.common.motors.feetech import ( from ..robot import Robot from ..utils import ensure_safe_goal_position -from .configuration_so100 import SO100RobotConfig +from .config_so100_follower import SO100FollowerConfig logger = logging.getLogger(__name__) -class SO100Robot(Robot): +class SO100Follower(Robot): """ [SO-100 Follower Arm](https://github.com/TheRobotStudio/SO-ARM100) designed by TheRobotStudio """ - config_class = SO100RobotConfig - name = "so100" + config_class = SO100FollowerConfig + name = "so100_follower" - def __init__(self, config: SO100RobotConfig): + def __init__(self, config: SO100FollowerConfig): super().__init__(config) self.config = config self.arm = FeetechMotorsBus( @@ -211,9 +211,7 @@ class SO100Robot(Robot): def disconnect(self): if not self.is_connected: - raise DeviceNotConnectedError( - "ManipulatorRobot is not connected. You need to run `robot.connect()` before disconnecting." - ) + raise DeviceNotConnectedError(f"{self} is not connected.") self.arm.disconnect(self.config.disable_torque_on_disconnect) for cam in self.cameras.values(): diff --git a/lerobot/common/robots/utils.py b/lerobot/common/robots/utils.py index 7e538376..c8a06b67 100644 --- a/lerobot/common/robots/utils.py +++ b/lerobot/common/robots/utils.py @@ -40,10 +40,10 @@ def make_robot_config(robot_type: str, **kwargs) -> RobotConfig: from .moss.configuration_moss import MossRobotConfig return MossRobotConfig(**kwargs) - elif robot_type == "so100": - from .so100.configuration_so100 import SO100RobotConfig + elif robot_type == "so100_leader": + from .so100.config_so100_follower import SO100FollowerConfig - return SO100RobotConfig(**kwargs) + return SO100FollowerConfig(**kwargs) elif robot_type == "stretch": from .stretch3.configuration_stretch3 import Stretch3RobotConfig diff --git a/lerobot/common/teleoperators/so100/__init__.py b/lerobot/common/teleoperators/so100/__init__.py index a319b5bc..63c877e6 100644 --- a/lerobot/common/teleoperators/so100/__init__.py +++ b/lerobot/common/teleoperators/so100/__init__.py @@ -1,4 +1,2 @@ -from .configuration_so100 import SO100TeleopConfig -from .teleop_so100 import SO100Teleop - -__all__ = ["SO100TeleopConfig", "SO100Teleop"] +from .config_so100_leader import SO100LeaderConfig +from .so100_leader import SO100Leader diff --git a/lerobot/common/teleoperators/so100/configuration_so100.py b/lerobot/common/teleoperators/so100/config_so100_leader.py similarity index 84% rename from lerobot/common/teleoperators/so100/configuration_so100.py rename to lerobot/common/teleoperators/so100/config_so100_leader.py index a6a807e4..a97949b7 100644 --- a/lerobot/common/teleoperators/so100/configuration_so100.py +++ b/lerobot/common/teleoperators/so100/config_so100_leader.py @@ -19,8 +19,8 @@ from dataclasses import dataclass from ..config import TeleoperatorConfig -@TeleoperatorConfig.register_subclass("so100") +@TeleoperatorConfig.register_subclass("so100_leader") @dataclass -class SO100TeleopConfig(TeleoperatorConfig): - # Port to connect to the teloperator +class SO100LeaderConfig(TeleoperatorConfig): + # Port to connect to the arm port: str diff --git a/lerobot/common/teleoperators/so100/teleop_so100.py b/lerobot/common/teleoperators/so100/so100_leader.py similarity index 92% rename from lerobot/common/teleoperators/so100/teleop_so100.py rename to lerobot/common/teleoperators/so100/so100_leader.py index e42c48d3..f8f7239e 100644 --- a/lerobot/common/teleoperators/so100/teleop_so100.py +++ b/lerobot/common/teleoperators/so100/so100_leader.py @@ -25,20 +25,20 @@ from lerobot.common.motors.feetech import ( ) from ..teleoperator import Teleoperator -from .configuration_so100 import SO100TeleopConfig +from .config_so100_leader import SO100LeaderConfig logger = logging.getLogger(__name__) -class SO100Teleop(Teleoperator): +class SO100Leader(Teleoperator): """ [SO-100 Leader Arm](https://github.com/TheRobotStudio/SO-ARM100) designed by TheRobotStudio """ - config_class = SO100TeleopConfig - name = "so100" + config_class = SO100LeaderConfig + name = "so100_leader" - def __init__(self, config: SO100TeleopConfig): + def __init__(self, config: SO100LeaderConfig): super().__init__(config) self.config = config self.arm = FeetechMotorsBus( @@ -136,9 +136,7 @@ class SO100Teleop(Teleoperator): def disconnect(self) -> None: if not self.is_connected: - raise DeviceNotConnectedError( - "ManipulatorRobot is not connected. You need to run `robot.connect()` before disconnecting." - ) + DeviceNotConnectedError(f"{self} is not connected.") self.arm.disconnect() logger.info(f"{self} disconnected.")