Co-authored-by: Remi <remi.cadene@huggingface.co> Co-authored-by: HUANG TZU-CHUN <137322177+tc-huang@users.noreply.github.com>
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
|