mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-22 12:09:42 +00:00
Import joints dict from classes
This commit is contained in:
@@ -15,4 +15,11 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from .configuration_reachy2 import Reachy2RobotConfig
|
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,
|
||||||
|
)
|
||||||
|
|||||||
@@ -15,4 +15,11 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from .config_reachy2_teleoperator import Reachy2TeleoperatorConfig
|
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,
|
||||||
|
)
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ class Reachy2Teleoperator(Teleoperator):
|
|||||||
return {**joint_action, **vel_action}
|
return {**joint_action, **vel_action}
|
||||||
|
|
||||||
def send_feedback(self, feedback: dict[str, float]) -> None:
|
def send_feedback(self, feedback: dict[str, float]) -> None:
|
||||||
# TODO(rcadene, aliberts): Implement force feedback
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def disconnect(self) -> None:
|
def disconnect(self) -> None:
|
||||||
|
|||||||
@@ -20,39 +20,21 @@ import numpy as np
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from lerobot.robots.reachy2 import (
|
from lerobot.robots.reachy2 import (
|
||||||
|
REACHY2_ANTENNAS_JOINTS,
|
||||||
|
REACHY2_L_ARM_JOINTS,
|
||||||
|
REACHY2_NECK_JOINTS,
|
||||||
|
REACHY2_R_ARM_JOINTS,
|
||||||
|
REACHY2_VEL,
|
||||||
Reachy2Robot,
|
Reachy2Robot,
|
||||||
Reachy2RobotConfig,
|
Reachy2RobotConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
# {lerobot_keys: reachy2_sdk_keys}
|
# {lerobot_keys: reachy2_sdk_keys}
|
||||||
REACHY2_JOINTS = {
|
REACHY2_JOINTS = {
|
||||||
"neck_yaw.pos": "head.neck.yaw",
|
**REACHY2_NECK_JOINTS,
|
||||||
"neck_pitch.pos": "head.neck.pitch",
|
**REACHY2_ANTENNAS_JOINTS,
|
||||||
"neck_roll.pos": "head.neck.roll",
|
**REACHY2_R_ARM_JOINTS,
|
||||||
"l_antenna.pos": "head.l_antenna",
|
**REACHY2_L_ARM_JOINTS,
|
||||||
"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",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PARAMS = [
|
PARAMS = [
|
||||||
|
|||||||
@@ -19,39 +19,21 @@ from unittest.mock import MagicMock, patch
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from lerobot.teleoperators.reachy2_teleoperator import (
|
from lerobot.teleoperators.reachy2_teleoperator import (
|
||||||
|
REACHY2_ANTENNAS_JOINTS,
|
||||||
|
REACHY2_L_ARM_JOINTS,
|
||||||
|
REACHY2_NECK_JOINTS,
|
||||||
|
REACHY2_R_ARM_JOINTS,
|
||||||
|
REACHY2_VEL,
|
||||||
Reachy2Teleoperator,
|
Reachy2Teleoperator,
|
||||||
Reachy2TeleoperatorConfig,
|
Reachy2TeleoperatorConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
# {lerobot_keys: reachy2_sdk_keys}
|
# {lerobot_keys: reachy2_sdk_keys}
|
||||||
REACHY2_JOINTS = {
|
REACHY2_JOINTS = {
|
||||||
"neck_yaw.pos": "head.neck.yaw",
|
**REACHY2_NECK_JOINTS,
|
||||||
"neck_pitch.pos": "head.neck.pitch",
|
**REACHY2_ANTENNAS_JOINTS,
|
||||||
"neck_roll.pos": "head.neck.roll",
|
**REACHY2_R_ARM_JOINTS,
|
||||||
"l_antenna.pos": "head.l_antenna",
|
**REACHY2_L_ARM_JOINTS,
|
||||||
"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",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PARAMS = [
|
PARAMS = [
|
||||||
|
|||||||
Reference in New Issue
Block a user