From 4fcb9fc2f3df37c477482a946cc0f94543866574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Caron?= Date: Wed, 26 Mar 2025 11:05:38 +0100 Subject: [PATCH 1/3] Add Ability Hand MJCF description --- CHANGELOG.md | 1 + README.md | 3 +- robot_descriptions/_descriptions.py | 1 + .../ability_hand_mj_description.py | 32 +++++++++++++++++++ .../allegro_hand_mj_description.py | 2 ++ 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 robot_descriptions/ability_hand_mj_description.py diff --git a/CHANGELOG.md b/CHANGELOG.md index bf9a9f87..21765b63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ### Added +- Description: Ability Hand (MJCF) - Description: Ability Hand (URDF) - Description: Apptronik Apollo (MJCF) diff --git a/README.md b/README.md index a8869aa6..905f57f7 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,8 @@ The DOF column denotes the number of actuated degrees of freedom. | Name | Robot | Maker | Format | License | |----------------------------------|-----------------------|----------------------------|------------|---------| -| `ability_hand_description` | Ability Hand | PSYONIC, Inc. | URDF | MIT | +| `ability_hand_description` | Ability Hand | PSYONIC, Inc. | URDF | [MIT](https://github.com/psyonicinc/ability-hand-api/blob/89407424edfc22faceaedcd7c3ea2b7947cbbb2c/LICENSE) | +| `ability_hand_mj_description` | Ability Hand | PSYONIC, Inc. | MJCF | [MIT](https://github.com/psyonicinc/ability-hand-api/blob/89407424edfc22faceaedcd7c3ea2b7947cbbb2c/LICENSE) | | `allegro_hand_description` | Allegro Hand | Wonik Robotics | URDF | [BSD](https://github.com/RobotLocomotion/models/blob/5c027ea961473cb558da30e1a749272a8a9fa3eb/allegro_hand_description/LICENSE.TXT) | | `allegro_hand_mj_description` | Allegro Hand | Wonik Robotics | MJCF | [BSD-2-Clause](https://github.com/google-deepmind/mujoco_menagerie/blob/main/wonik_allegro/LICENSE) | | `barrett_hand_description` | BarrettHand | Barrett Technology | URDF | [BSD](https://github.com/jhu-lcsr-attic/bhand_model/blob/937f4186d6458bd682a7dae825fb6f4efe56ec69/manifest.xml) | diff --git a/robot_descriptions/_descriptions.py b/robot_descriptions/_descriptions.py index 7609143c..53044a2b 100644 --- a/robot_descriptions/_descriptions.py +++ b/robot_descriptions/_descriptions.py @@ -51,6 +51,7 @@ def has_urdf(self) -> bool: "a1_description": Description(Format.URDF), "a1_mj_description": Description(Format.MJCF), "ability_hand_description": Description(Format.URDF), + "ability_hand_mj_description": Description(Format.MJCF), "aliengo_description": Description(Format.URDF), "aliengo_mj_description": Description(Format.MJCF), "allegro_hand_description": Description(Format.URDF), diff --git a/robot_descriptions/ability_hand_mj_description.py b/robot_descriptions/ability_hand_mj_description.py new file mode 100644 index 00000000..a78729ca --- /dev/null +++ b/robot_descriptions/ability_hand_mj_description.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# SPDX-License-Identifier: Apache-2.0 + +"""Ability Hand MJCF description.""" + +from os import getenv as _getenv +from os import path as _path + +from ._cache import clone_to_cache as _clone_to_cache + +REPOSITORY_PATH: str = _clone_to_cache( + "ability-hand-api", + commit=_getenv("ROBOT_DESCRIPTION_COMMIT", None), +) + +PACKAGE_PATH: str = _path.join( + REPOSITORY_PATH, "python", "ah_simulators", "mujoco_xml", "hands" +) + +MJCF_PATH: str = _path.join(PACKAGE_PATH, "abh_left_large.xml") + +# Description-specific paths + +MJCF_PATH_LEFT_LARGE: str = _path.join(PACKAGE_PATH, "abh_left_large.xml") + +MJCF_PATH_LEFT_SMALL: str = _path.join(PACKAGE_PATH, "abh_left_small.xml") + +MJCF_PATH_RIGHT_LARGE: str = _path.join(PACKAGE_PATH, "abh_right_large.xml") + +MJCF_PATH_RIGHT_SMALL: str = _path.join(PACKAGE_PATH, "abh_right_small.xml") diff --git a/robot_descriptions/allegro_hand_mj_description.py b/robot_descriptions/allegro_hand_mj_description.py index aa7f0bc6..0e230e5f 100644 --- a/robot_descriptions/allegro_hand_mj_description.py +++ b/robot_descriptions/allegro_hand_mj_description.py @@ -19,6 +19,8 @@ MJCF_PATH: str = _path.join(PACKAGE_PATH, "right_hand.xml") +# Description-specific paths + MJCF_PATH_LEFT: str = _path.join(PACKAGE_PATH, "left_hand.xml") MJCF_PATH_RIGHT = MJCF_PATH From 268c2b19ea1133e929528b17bafcc209184a6a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Caron?= Date: Wed, 26 Mar 2025 11:14:41 +0100 Subject: [PATCH 2/3] Fix scene path for Ability Hand MJCF description --- robot_descriptions/ability_hand_mj_description.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/robot_descriptions/ability_hand_mj_description.py b/robot_descriptions/ability_hand_mj_description.py index a78729ca..52c37e36 100644 --- a/robot_descriptions/ability_hand_mj_description.py +++ b/robot_descriptions/ability_hand_mj_description.py @@ -16,17 +16,17 @@ ) PACKAGE_PATH: str = _path.join( - REPOSITORY_PATH, "python", "ah_simulators", "mujoco_xml", "hands" + REPOSITORY_PATH, "python", "ah_simulators", "mujoco_xml" ) -MJCF_PATH: str = _path.join(PACKAGE_PATH, "abh_left_large.xml") +MJCF_PATH: str = _path.join(PACKAGE_PATH, "scene.xml") # Description-specific paths -MJCF_PATH_LEFT_LARGE: str = _path.join(PACKAGE_PATH, "abh_left_large.xml") +MJCF_PATH_LEFT_LARGE: str = _path.join(PACKAGE_PATH, "hands", "abh_left_large.xml") -MJCF_PATH_LEFT_SMALL: str = _path.join(PACKAGE_PATH, "abh_left_small.xml") +MJCF_PATH_LEFT_SMALL: str = _path.join(PACKAGE_PATH, "hands", "abh_left_small.xml") -MJCF_PATH_RIGHT_LARGE: str = _path.join(PACKAGE_PATH, "abh_right_large.xml") +MJCF_PATH_RIGHT_LARGE: str = _path.join(PACKAGE_PATH, "hands", "abh_right_large.xml") -MJCF_PATH_RIGHT_SMALL: str = _path.join(PACKAGE_PATH, "abh_right_small.xml") +MJCF_PATH_RIGHT_SMALL: str = _path.join(PACKAGE_PATH, "hands", "abh_right_small.xml") From cdb57fd7ccc901f02ea06c137a9aa3a4a2be8f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Caron?= Date: Wed, 26 Mar 2025 11:51:04 +0100 Subject: [PATCH 3/3] Fix lint --- .../ability_hand_mj_description.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/robot_descriptions/ability_hand_mj_description.py b/robot_descriptions/ability_hand_mj_description.py index 52c37e36..e4281e7c 100644 --- a/robot_descriptions/ability_hand_mj_description.py +++ b/robot_descriptions/ability_hand_mj_description.py @@ -23,10 +23,18 @@ # Description-specific paths -MJCF_PATH_LEFT_LARGE: str = _path.join(PACKAGE_PATH, "hands", "abh_left_large.xml") +MJCF_PATH_LEFT_LARGE: str = _path.join( + PACKAGE_PATH, "hands", "abh_left_large.xml" +) -MJCF_PATH_LEFT_SMALL: str = _path.join(PACKAGE_PATH, "hands", "abh_left_small.xml") +MJCF_PATH_LEFT_SMALL: str = _path.join( + PACKAGE_PATH, "hands", "abh_left_small.xml" +) -MJCF_PATH_RIGHT_LARGE: str = _path.join(PACKAGE_PATH, "hands", "abh_right_large.xml") +MJCF_PATH_RIGHT_LARGE: str = _path.join( + PACKAGE_PATH, "hands", "abh_right_large.xml" +) -MJCF_PATH_RIGHT_SMALL: str = _path.join(PACKAGE_PATH, "hands", "abh_right_small.xml") +MJCF_PATH_RIGHT_SMALL: str = _path.join( + PACKAGE_PATH, "hands", "abh_right_small.xml" +)