diff --git a/src/lerobot/robots/reachy2/__init__.py b/src/lerobot/robots/reachy2/__init__.py index c129bf755..1a38fd03b 100644 --- a/src/lerobot/robots/reachy2/__init__.py +++ b/src/lerobot/robots/reachy2/__init__.py @@ -15,4 +15,11 @@ # limitations under the License. from .configuration_reachy2 import Reachy2RobotConfig -from .robot_reachy2 import Reachy2Robot +from .robot_reachy2 import ( + REACHY2_ANTENNAS_JOINTS, + REACHY2_L_ARM_JOINTS, + REACHY2_NECK_JOINTS, + REACHY2_R_ARM_JOINTS, + REACHY2_VEL, + Reachy2Robot, +) diff --git a/src/lerobot/teleoperators/reachy2_teleoperator/__init__.py b/src/lerobot/teleoperators/reachy2_teleoperator/__init__.py index 2a911e179..a07a4a6cd 100644 --- a/src/lerobot/teleoperators/reachy2_teleoperator/__init__.py +++ b/src/lerobot/teleoperators/reachy2_teleoperator/__init__.py @@ -15,4 +15,11 @@ # limitations under the License. from .config_reachy2_teleoperator import Reachy2TeleoperatorConfig -from .reachy2_teleoperator import Reachy2Teleoperator +from .reachy2_teleoperator import ( + REACHY2_ANTENNAS_JOINTS, + REACHY2_L_ARM_JOINTS, + REACHY2_NECK_JOINTS, + REACHY2_R_ARM_JOINTS, + REACHY2_VEL, + Reachy2Teleoperator, +) diff --git a/src/lerobot/teleoperators/reachy2_teleoperator/reachy2_teleoperator.py b/src/lerobot/teleoperators/reachy2_teleoperator/reachy2_teleoperator.py index 245f2f6cc..5a427dd71 100644 --- a/src/lerobot/teleoperators/reachy2_teleoperator/reachy2_teleoperator.py +++ b/src/lerobot/teleoperators/reachy2_teleoperator/reachy2_teleoperator.py @@ -157,7 +157,6 @@ class Reachy2Teleoperator(Teleoperator): return {**joint_action, **vel_action} def send_feedback(self, feedback: dict[str, float]) -> None: - # TODO(rcadene, aliberts): Implement force feedback raise NotImplementedError def disconnect(self) -> None: diff --git a/tests/robots/test_reachy2.py b/tests/robots/test_reachy2.py index cd0513a19..c93fbeced 100644 --- a/tests/robots/test_reachy2.py +++ b/tests/robots/test_reachy2.py @@ -20,39 +20,21 @@ import numpy as np import pytest from lerobot.robots.reachy2 import ( + REACHY2_ANTENNAS_JOINTS, + REACHY2_L_ARM_JOINTS, + REACHY2_NECK_JOINTS, + REACHY2_R_ARM_JOINTS, + REACHY2_VEL, Reachy2Robot, Reachy2RobotConfig, ) # {lerobot_keys: reachy2_sdk_keys} REACHY2_JOINTS = { - "neck_yaw.pos": "head.neck.yaw", - "neck_pitch.pos": "head.neck.pitch", - "neck_roll.pos": "head.neck.roll", - "l_antenna.pos": "head.l_antenna", - "r_antenna.pos": "head.r_antenna", - "r_shoulder_pitch.pos": "r_arm.shoulder.pitch", - "r_shoulder_roll.pos": "r_arm.shoulder.roll", - "r_elbow_yaw.pos": "r_arm.elbow.yaw", - "r_elbow_pitch.pos": "r_arm.elbow.pitch", - "r_wrist_roll.pos": "r_arm.wrist.roll", - "r_wrist_pitch.pos": "r_arm.wrist.pitch", - "r_wrist_yaw.pos": "r_arm.wrist.yaw", - "r_gripper.pos": "r_arm.gripper", - "l_shoulder_pitch.pos": "l_arm.shoulder.pitch", - "l_shoulder_roll.pos": "l_arm.shoulder.roll", - "l_elbow_yaw.pos": "l_arm.elbow.yaw", - "l_elbow_pitch.pos": "l_arm.elbow.pitch", - "l_wrist_roll.pos": "l_arm.wrist.roll", - "l_wrist_pitch.pos": "l_arm.wrist.pitch", - "l_wrist_yaw.pos": "l_arm.wrist.yaw", - "l_gripper.pos": "l_arm.gripper", -} - -REACHY2_VEL = { - "mobile_base.vx": "vx", - "mobile_base.vy": "vy", - "mobile_base.vtheta": "vtheta", + **REACHY2_NECK_JOINTS, + **REACHY2_ANTENNAS_JOINTS, + **REACHY2_R_ARM_JOINTS, + **REACHY2_L_ARM_JOINTS, } PARAMS = [ diff --git a/tests/teleoperators/test_reachy2_teleoperator.py b/tests/teleoperators/test_reachy2_teleoperator.py index 69fc1df41..5130de87d 100644 --- a/tests/teleoperators/test_reachy2_teleoperator.py +++ b/tests/teleoperators/test_reachy2_teleoperator.py @@ -19,39 +19,21 @@ from unittest.mock import MagicMock, patch import pytest from lerobot.teleoperators.reachy2_teleoperator import ( + REACHY2_ANTENNAS_JOINTS, + REACHY2_L_ARM_JOINTS, + REACHY2_NECK_JOINTS, + REACHY2_R_ARM_JOINTS, + REACHY2_VEL, Reachy2Teleoperator, Reachy2TeleoperatorConfig, ) # {lerobot_keys: reachy2_sdk_keys} REACHY2_JOINTS = { - "neck_yaw.pos": "head.neck.yaw", - "neck_pitch.pos": "head.neck.pitch", - "neck_roll.pos": "head.neck.roll", - "l_antenna.pos": "head.l_antenna", - "r_antenna.pos": "head.r_antenna", - "r_shoulder_pitch.pos": "r_arm.shoulder.pitch", - "r_shoulder_roll.pos": "r_arm.shoulder.roll", - "r_elbow_yaw.pos": "r_arm.elbow.yaw", - "r_elbow_pitch.pos": "r_arm.elbow.pitch", - "r_wrist_roll.pos": "r_arm.wrist.roll", - "r_wrist_pitch.pos": "r_arm.wrist.pitch", - "r_wrist_yaw.pos": "r_arm.wrist.yaw", - "r_gripper.pos": "r_arm.gripper", - "l_shoulder_pitch.pos": "l_arm.shoulder.pitch", - "l_shoulder_roll.pos": "l_arm.shoulder.roll", - "l_elbow_yaw.pos": "l_arm.elbow.yaw", - "l_elbow_pitch.pos": "l_arm.elbow.pitch", - "l_wrist_roll.pos": "l_arm.wrist.roll", - "l_wrist_pitch.pos": "l_arm.wrist.pitch", - "l_wrist_yaw.pos": "l_arm.wrist.yaw", - "l_gripper.pos": "l_arm.gripper", -} - -REACHY2_VEL = { - "mobile_base.vx": "vx", - "mobile_base.vy": "vy", - "mobile_base.vtheta": "vtheta", + **REACHY2_NECK_JOINTS, + **REACHY2_ANTENNAS_JOINTS, + **REACHY2_R_ARM_JOINTS, + **REACHY2_L_ARM_JOINTS, } PARAMS = [