Update DynamixelMotorsBus signature
This commit is contained in:
parent
731fb6ebaf
commit
c7dfd32b43
|
@ -8,7 +8,6 @@ from copy import deepcopy
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import tqdm
|
import tqdm
|
||||||
|
|
||||||
from lerobot.common.motors.configs import DynamixelMotorsBusConfig
|
|
||||||
from lerobot.common.utils.robot_utils import RobotDeviceAlreadyConnectedError, RobotDeviceNotConnectedError
|
from lerobot.common.utils.robot_utils import RobotDeviceAlreadyConnectedError, RobotDeviceNotConnectedError
|
||||||
from lerobot.common.utils.utils import capture_timestamp_utc
|
from lerobot.common.utils.utils import capture_timestamp_utc
|
||||||
|
|
||||||
|
@ -274,11 +273,10 @@ class DynamixelMotorsBus:
|
||||||
motor_index = 6
|
motor_index = 6
|
||||||
motor_model = "xl330-m288"
|
motor_model = "xl330-m288"
|
||||||
|
|
||||||
config = DynamixelMotorsBusConfig(
|
motors_bus = DynamixelMotorsBus(
|
||||||
port="/dev/tty.usbmodem575E0031751",
|
port="/dev/tty.usbmodem575E0031751",
|
||||||
motors={motor_name: (motor_index, motor_model)},
|
motors={motor_name: (motor_index, motor_model)},
|
||||||
)
|
)
|
||||||
motors_bus = DynamixelMotorsBus(config)
|
|
||||||
motors_bus.connect()
|
motors_bus.connect()
|
||||||
|
|
||||||
position = motors_bus.read("Present_Position")
|
position = motors_bus.read("Present_Position")
|
||||||
|
@ -294,11 +292,13 @@ class DynamixelMotorsBus:
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
config: DynamixelMotorsBusConfig,
|
port: str,
|
||||||
|
motors: dict[str, tuple[int, str]],
|
||||||
|
mock: bool = False,
|
||||||
):
|
):
|
||||||
self.port = config.port
|
self.port = port
|
||||||
self.motors = config.motors
|
self.motors = motors
|
||||||
self.mock = config.mock
|
self.mock = mock
|
||||||
|
|
||||||
self.model_ctrl_table = deepcopy(MODEL_CONTROL_TABLE)
|
self.model_ctrl_table = deepcopy(MODEL_CONTROL_TABLE)
|
||||||
self.model_resolution = deepcopy(MODEL_RESOLUTION)
|
self.model_resolution = deepcopy(MODEL_RESOLUTION)
|
||||||
|
|
Loading…
Reference in New Issue