Rename SO-100 classes
This commit is contained in:
@@ -1,4 +1,2 @@
|
|||||||
from .configuration_so100 import SO100RobotConfig
|
from .config_so100_follower import SO100FollowerConfig
|
||||||
from .robot_so100 import SO100Robot
|
from .so100_follower import SO100Follower
|
||||||
|
|
||||||
__all__ = ["SO100RobotConfig", "SO100Robot"]
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ from lerobot.common.cameras import CameraConfig
|
|||||||
from ..config import RobotConfig
|
from ..config import RobotConfig
|
||||||
|
|
||||||
|
|
||||||
@RobotConfig.register_subclass("so100")
|
@RobotConfig.register_subclass("so100_follower")
|
||||||
@dataclass
|
@dataclass
|
||||||
class SO100RobotConfig(RobotConfig):
|
class SO100FollowerConfig(RobotConfig):
|
||||||
# Port to connect to the robot
|
# Port to connect to the arm
|
||||||
port: str
|
port: str
|
||||||
|
|
||||||
disable_torque_on_disconnect: bool = True
|
disable_torque_on_disconnect: bool = True
|
||||||
@@ -29,20 +29,20 @@ from lerobot.common.motors.feetech import (
|
|||||||
|
|
||||||
from ..robot import Robot
|
from ..robot import Robot
|
||||||
from ..utils import ensure_safe_goal_position
|
from ..utils import ensure_safe_goal_position
|
||||||
from .configuration_so100 import SO100RobotConfig
|
from .config_so100_follower import SO100FollowerConfig
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SO100Robot(Robot):
|
class SO100Follower(Robot):
|
||||||
"""
|
"""
|
||||||
[SO-100 Follower Arm](https://github.com/TheRobotStudio/SO-ARM100) designed by TheRobotStudio
|
[SO-100 Follower Arm](https://github.com/TheRobotStudio/SO-ARM100) designed by TheRobotStudio
|
||||||
"""
|
"""
|
||||||
|
|
||||||
config_class = SO100RobotConfig
|
config_class = SO100FollowerConfig
|
||||||
name = "so100"
|
name = "so100_follower"
|
||||||
|
|
||||||
def __init__(self, config: SO100RobotConfig):
|
def __init__(self, config: SO100FollowerConfig):
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
self.config = config
|
self.config = config
|
||||||
self.arm = FeetechMotorsBus(
|
self.arm = FeetechMotorsBus(
|
||||||
@@ -211,9 +211,7 @@ class SO100Robot(Robot):
|
|||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
if not self.is_connected:
|
if not self.is_connected:
|
||||||
raise DeviceNotConnectedError(
|
raise DeviceNotConnectedError(f"{self} is not connected.")
|
||||||
"ManipulatorRobot is not connected. You need to run `robot.connect()` before disconnecting."
|
|
||||||
)
|
|
||||||
|
|
||||||
self.arm.disconnect(self.config.disable_torque_on_disconnect)
|
self.arm.disconnect(self.config.disable_torque_on_disconnect)
|
||||||
for cam in self.cameras.values():
|
for cam in self.cameras.values():
|
||||||
@@ -40,10 +40,10 @@ def make_robot_config(robot_type: str, **kwargs) -> RobotConfig:
|
|||||||
from .moss.configuration_moss import MossRobotConfig
|
from .moss.configuration_moss import MossRobotConfig
|
||||||
|
|
||||||
return MossRobotConfig(**kwargs)
|
return MossRobotConfig(**kwargs)
|
||||||
elif robot_type == "so100":
|
elif robot_type == "so100_leader":
|
||||||
from .so100.configuration_so100 import SO100RobotConfig
|
from .so100.config_so100_follower import SO100FollowerConfig
|
||||||
|
|
||||||
return SO100RobotConfig(**kwargs)
|
return SO100FollowerConfig(**kwargs)
|
||||||
elif robot_type == "stretch":
|
elif robot_type == "stretch":
|
||||||
from .stretch3.configuration_stretch3 import Stretch3RobotConfig
|
from .stretch3.configuration_stretch3 import Stretch3RobotConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
from .configuration_so100 import SO100TeleopConfig
|
from .config_so100_leader import SO100LeaderConfig
|
||||||
from .teleop_so100 import SO100Teleop
|
from .so100_leader import SO100Leader
|
||||||
|
|
||||||
__all__ = ["SO100TeleopConfig", "SO100Teleop"]
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ from dataclasses import dataclass
|
|||||||
from ..config import TeleoperatorConfig
|
from ..config import TeleoperatorConfig
|
||||||
|
|
||||||
|
|
||||||
@TeleoperatorConfig.register_subclass("so100")
|
@TeleoperatorConfig.register_subclass("so100_leader")
|
||||||
@dataclass
|
@dataclass
|
||||||
class SO100TeleopConfig(TeleoperatorConfig):
|
class SO100LeaderConfig(TeleoperatorConfig):
|
||||||
# Port to connect to the teloperator
|
# Port to connect to the arm
|
||||||
port: str
|
port: str
|
||||||
@@ -25,20 +25,20 @@ from lerobot.common.motors.feetech import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from ..teleoperator import Teleoperator
|
from ..teleoperator import Teleoperator
|
||||||
from .configuration_so100 import SO100TeleopConfig
|
from .config_so100_leader import SO100LeaderConfig
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SO100Teleop(Teleoperator):
|
class SO100Leader(Teleoperator):
|
||||||
"""
|
"""
|
||||||
[SO-100 Leader Arm](https://github.com/TheRobotStudio/SO-ARM100) designed by TheRobotStudio
|
[SO-100 Leader Arm](https://github.com/TheRobotStudio/SO-ARM100) designed by TheRobotStudio
|
||||||
"""
|
"""
|
||||||
|
|
||||||
config_class = SO100TeleopConfig
|
config_class = SO100LeaderConfig
|
||||||
name = "so100"
|
name = "so100_leader"
|
||||||
|
|
||||||
def __init__(self, config: SO100TeleopConfig):
|
def __init__(self, config: SO100LeaderConfig):
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
self.config = config
|
self.config = config
|
||||||
self.arm = FeetechMotorsBus(
|
self.arm = FeetechMotorsBus(
|
||||||
@@ -136,9 +136,7 @@ class SO100Teleop(Teleoperator):
|
|||||||
|
|
||||||
def disconnect(self) -> None:
|
def disconnect(self) -> None:
|
||||||
if not self.is_connected:
|
if not self.is_connected:
|
||||||
raise DeviceNotConnectedError(
|
DeviceNotConnectedError(f"{self} is not connected.")
|
||||||
"ManipulatorRobot is not connected. You need to run `robot.connect()` before disconnecting."
|
|
||||||
)
|
|
||||||
|
|
||||||
self.arm.disconnect()
|
self.arm.disconnect()
|
||||||
logger.info(f"{self} disconnected.")
|
logger.info(f"{self} disconnected.")
|
||||||
Reference in New Issue
Block a user