Rename SO-100 classes

This commit is contained in:
Simon Alibert 2025-04-03 08:14:35 +02:00
parent c0570b3003
commit 28cd3a6f3a
7 changed files with 25 additions and 33 deletions

View File

@ -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

View File

@ -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

View File

@ -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():

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.")