forked from tangger/lerobot
Fix arm joints order
This commit is contained in:
@@ -45,13 +45,13 @@ class HomonculusArm(Teleoperator):
|
|||||||
self.serial = serial.Serial(config.port, config.baud_rate, timeout=1)
|
self.serial = serial.Serial(config.port, config.baud_rate, timeout=1)
|
||||||
|
|
||||||
self.joints = {
|
self.joints = {
|
||||||
"wrist_roll": MotorNormMode.RANGE_M100_100,
|
|
||||||
"wrist_pitch": MotorNormMode.RANGE_M100_100,
|
|
||||||
"wrist_yaw": MotorNormMode.RANGE_M100_100,
|
|
||||||
"elbow_flex": MotorNormMode.RANGE_M100_100,
|
|
||||||
"shoulder_roll": MotorNormMode.RANGE_M100_100,
|
|
||||||
"shoulder_yaw": MotorNormMode.RANGE_M100_100,
|
|
||||||
"shoulder_pitch": MotorNormMode.RANGE_M100_100,
|
"shoulder_pitch": MotorNormMode.RANGE_M100_100,
|
||||||
|
"shoulder_yaw": MotorNormMode.RANGE_M100_100,
|
||||||
|
"shoulder_roll": MotorNormMode.RANGE_M100_100,
|
||||||
|
"elbow_flex": MotorNormMode.RANGE_M100_100,
|
||||||
|
"wrist_roll": MotorNormMode.RANGE_M100_100,
|
||||||
|
"wrist_yaw": MotorNormMode.RANGE_M100_100,
|
||||||
|
"wrist_pitch": MotorNormMode.RANGE_M100_100,
|
||||||
}
|
}
|
||||||
self.thread = threading.Thread(target=self._async_read, daemon=True, name=f"{self} _async_read")
|
self.thread = threading.Thread(target=self._async_read, daemon=True, name=f"{self} _async_read")
|
||||||
self._lock = threading.Lock()
|
self._lock = threading.Lock()
|
||||||
@@ -206,8 +206,13 @@ class HomonculusArm(Teleoperator):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
joint_angles = {
|
joint_angles = {
|
||||||
joint: int(pos)
|
"shoulder_pitch": int(raw_values[19]),
|
||||||
for joint, pos in zip(self.joints, raw_values[:2] + raw_values[16:], strict=True)
|
"shoulder_yaw": int(raw_values[18]),
|
||||||
|
"shoulder_roll": int(raw_values[20]),
|
||||||
|
"elbow_flex": int(raw_values[17]),
|
||||||
|
"wrist_roll": int(raw_values[16]),
|
||||||
|
"wrist_yaw": int(raw_values[1]),
|
||||||
|
"wrist_pitch": int(raw_values[0]),
|
||||||
}
|
}
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user