Add Motor in dxl robots
This commit is contained in:
@@ -21,7 +21,7 @@ import time
|
||||
import numpy as np
|
||||
|
||||
from lerobot.common.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError
|
||||
from lerobot.common.motors import TorqueMode
|
||||
from lerobot.common.motors import CalibrationMode, Motor, TorqueMode
|
||||
from lerobot.common.motors.dynamixel import (
|
||||
DynamixelMotorsBus,
|
||||
run_arm_calibration,
|
||||
@@ -49,12 +49,12 @@ class KochTeleop(Teleoperator):
|
||||
self.arm = DynamixelMotorsBus(
|
||||
port=self.config.port,
|
||||
motors={
|
||||
"shoulder_pan": (1, "xl330-m077"),
|
||||
"shoulder_lift": (2, "xl330-m077"),
|
||||
"elbow_flex": (3, "xl330-m077"),
|
||||
"wrist_flex": (4, "xl330-m077"),
|
||||
"wrist_roll": (5, "xl330-m077"),
|
||||
"gripper": (6, "xl330-m077"),
|
||||
"shoulder_pan": Motor(1, "xl330-m077", CalibrationMode.RANGE_M100_100),
|
||||
"shoulder_lift": Motor(2, "xl330-m077", CalibrationMode.RANGE_M100_100),
|
||||
"elbow_flex": Motor(3, "xl330-m077", CalibrationMode.RANGE_M100_100),
|
||||
"wrist_flex": Motor(4, "xl330-m077", CalibrationMode.RANGE_M100_100),
|
||||
"wrist_roll": Motor(5, "xl330-m077", CalibrationMode.RANGE_M100_100),
|
||||
"gripper": Motor(6, "xl330-m077", CalibrationMode.RANGE_0_100),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -36,14 +36,3 @@ class WidowXTeleopConfig(TeleoperatorConfig):
|
||||
# first try to teleoperate the grippers only (by commenting out the rest of the motors in this yaml),
|
||||
# then to gradually add more motors (by uncommenting), until you can teleoperate both arms fully
|
||||
max_relative_target: int | None = 5
|
||||
|
||||
# motors
|
||||
waist: tuple = (1, "xm430-w350")
|
||||
shoulder: tuple = (2, "xm430-w350")
|
||||
shoulder_shadow: tuple = (3, "xm430-w350")
|
||||
elbow: tuple = (4, "xm430-w350")
|
||||
elbow_shadow: tuple = (5, "xm430-w350")
|
||||
forearm_roll: tuple = (6, "xm430-w350")
|
||||
wrist_angle: tuple = (7, "xm430-w350")
|
||||
wrist_rotate: tuple = (8, "xl430-w250")
|
||||
gripper: tuple = (9, "xc430-w150")
|
||||
|
||||
@@ -21,7 +21,7 @@ import time
|
||||
import numpy as np
|
||||
|
||||
from lerobot.common.errors import DeviceAlreadyConnectedError, DeviceNotConnectedError
|
||||
from lerobot.common.motors import TorqueMode
|
||||
from lerobot.common.motors import CalibrationMode, Motor, TorqueMode
|
||||
from lerobot.common.motors.dynamixel import (
|
||||
DynamixelMotorsBus,
|
||||
run_arm_calibration,
|
||||
@@ -47,15 +47,15 @@ class WidowXTeleop(Teleoperator):
|
||||
self.arm = DynamixelMotorsBus(
|
||||
port=self.config.port,
|
||||
motors={
|
||||
"waist": config.waist,
|
||||
"shoulder": config.shoulder,
|
||||
"shoulder_shadow": config.shoulder_shadow,
|
||||
"elbow": config.elbow,
|
||||
"elbow_shadow": config.elbow_shadow,
|
||||
"forearm_roll": config.forearm_roll,
|
||||
"wrist_angle": config.wrist_angle,
|
||||
"wrist_rotate": config.wrist_rotate,
|
||||
"gripper": config.gripper,
|
||||
"waist": Motor(1, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"shoulder": Motor(2, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"shoulder_shadow": Motor(3, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"elbow": Motor(4, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"elbow_shadow": Motor(5, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"forearm_roll": Motor(6, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"wrist_angle": Motor(7, "xm430-w350", CalibrationMode.RANGE_M100_100),
|
||||
"wrist_rotate": Motor(8, "xl430-w250", CalibrationMode.RANGE_M100_100),
|
||||
"gripper": Motor(9, "xc430-w150", CalibrationMode.RANGE_0_100),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user