diff --git a/src/lerobot/teleoperators/openarms_mini/openarms_mini.py b/src/lerobot/teleoperators/openarms_mini/openarms_mini.py index d2b699049..e42706cf5 100644 --- a/src/lerobot/teleoperators/openarms_mini/openarms_mini.py +++ b/src/lerobot/teleoperators/openarms_mini/openarms_mini.py @@ -296,27 +296,22 @@ class OpenArmsMini(Teleoperator): right_motors_to_flip = ["joint_1", "joint_2", "joint_3", "joint_4", "joint_5"] left_motors_to_flip = ["joint_1", "joint_3", "joint_4", "joint_5", "joint_6", "joint_7"] - # Joint mapping: teleop joint -> robot joint (swap 6 and 7) - joint_map = {"joint_6": "joint_7", "joint_7": "joint_6"} - # Read positions from both arms right_positions = self.bus_right.sync_read("Present_Position") left_positions = self.bus_left.sync_read("Present_Position") - # Combine into single action dict with arm prefixes, flip and map joints + # Combine into single action dict with arm prefixes and flip specified motors action = {} for motor, val in right_positions.items(): - robot_joint = joint_map.get(motor, motor) if motor in right_motors_to_flip: - action[f"right_{robot_joint}.pos"] = -val + action[f"right_{motor}.pos"] = -val else: - action[f"right_{robot_joint}.pos"] = val + action[f"right_{motor}.pos"] = val for motor, val in left_positions.items(): - robot_joint = joint_map.get(motor, motor) if motor in left_motors_to_flip: - action[f"left_{robot_joint}.pos"] = -val + action[f"left_{motor}.pos"] = -val else: - action[f"left_{robot_joint}.pos"] = val + action[f"left_{motor}.pos"] = val dt_ms = (time.perf_counter() - start) * 1e3 logger.debug(f"{self} read action: {dt_ms:.1f}ms") @@ -333,9 +328,6 @@ class OpenArmsMini(Teleoperator): right_motors_to_flip = ["joint_1", "joint_2", "joint_3", "joint_4", "joint_5"] left_motors_to_flip = ["joint_1", "joint_3", "joint_4", "joint_5", "joint_6", "joint_7"] - # Joint mapping: robot joint -> teleop joint (swap 6 and 7) - joint_map = {"joint_6": "joint_7", "joint_7": "joint_6"} - # Split feedback by arm and flip motors as needed right_positions = {} left_positions = {} @@ -345,20 +337,16 @@ class OpenArmsMini(Teleoperator): motor_name = key.removesuffix(".pos") if motor_name.startswith("right_"): base_name = motor_name.removeprefix("right_") - # Apply joint mapping (swap 6↔7) - teleop_joint = joint_map.get(base_name, base_name) - if teleop_joint in right_motors_to_flip: - right_positions[teleop_joint] = -val + if base_name in right_motors_to_flip: + right_positions[base_name] = -val else: - right_positions[teleop_joint] = val + right_positions[base_name] = val elif motor_name.startswith("left_"): base_name = motor_name.removeprefix("left_") - # Apply joint mapping (swap 6↔7) - teleop_joint = joint_map.get(base_name, base_name) - if teleop_joint in left_motors_to_flip: - left_positions[teleop_joint] = -val + if base_name in left_motors_to_flip: + left_positions[base_name] = -val else: - left_positions[teleop_joint] = val + left_positions[base_name] = val # Write positions to both arms if right_positions: