mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-26 05:59:52 +00:00
28 lines
591 B
Python
28 lines
591 B
Python
import abc
|
|
from dataclasses import dataclass
|
|
|
|
import draccus
|
|
|
|
|
|
@dataclass
|
|
class MotorsBusConfig(draccus.ChoiceRegistry, abc.ABC):
|
|
@property
|
|
def type(self) -> str:
|
|
return self.get_choice_name(self.__class__)
|
|
|
|
|
|
@MotorsBusConfig.register_subclass("dynamixel")
|
|
@dataclass
|
|
class DynamixelMotorsBusConfig(MotorsBusConfig):
|
|
port: str
|
|
motors: dict[str, tuple[int, str]]
|
|
mock: bool = False
|
|
|
|
|
|
@MotorsBusConfig.register_subclass("feetech")
|
|
@dataclass
|
|
class FeetechMotorsBusConfig(MotorsBusConfig):
|
|
port: str
|
|
motors: dict[str, tuple[int, str]]
|
|
mock: bool = False
|