diff --git a/robosuite/models/assets/grippers/fourier_left_hand.xml b/robosuite/models/assets/grippers/fourier_left_hand.xml new file mode 100644 index 0000000000..c0edf99715 --- /dev/null +++ b/robosuite/models/assets/grippers/fourier_left_hand.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/robosuite/models/assets/grippers/fourier_right_hand.xml b/robosuite/models/assets/grippers/fourier_right_hand.xml new file mode 100644 index 0000000000..bf7fd3816e --- /dev/null +++ b/robosuite/models/assets/grippers/fourier_right_hand.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/robosuite/models/assets/grippers/inspire_left_hand.xml b/robosuite/models/assets/grippers/inspire_left_hand.xml index 97962695ab..e232285fdd 100644 --- a/robosuite/models/assets/grippers/inspire_left_hand.xml +++ b/robosuite/models/assets/grippers/inspire_left_hand.xml @@ -236,18 +236,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/robosuite/models/assets/grippers/inspire_right_hand.xml b/robosuite/models/assets/grippers/inspire_right_hand.xml index c9be5a7cfa..a508a3f566 100644 --- a/robosuite/models/assets/grippers/inspire_right_hand.xml +++ b/robosuite/models/assets/grippers/inspire_right_hand.xml @@ -233,18 +233,18 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_hand_base_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_hand_base_link.STL new file mode 100644 index 0000000000..875506ce79 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_hand_base_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_index_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_index_intermediate_link.STL new file mode 100644 index 0000000000..e7266f6782 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_index_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_index_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_index_proximal_link.STL new file mode 100644 index 0000000000..7b952e1931 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_index_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_middle_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_middle_intermediate_link.STL new file mode 100644 index 0000000000..4f6184caca Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_middle_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_middle_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_middle_proximal_link.STL new file mode 100644 index 0000000000..1ecd5042b1 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_middle_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_pinky_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_pinky_intermediate_link.STL new file mode 100644 index 0000000000..c3e4127450 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_pinky_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_pinky_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_pinky_proximal_link.STL new file mode 100644 index 0000000000..dfefe3f173 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_pinky_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_ring_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_ring_intermediate_link.STL new file mode 100644 index 0000000000..ba7ddf21a1 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_ring_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_ring_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_ring_proximal_link.STL new file mode 100644 index 0000000000..5c2cfcd616 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_ring_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_distal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_distal_link.STL new file mode 100644 index 0000000000..bdf42be8f8 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_distal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_proximal_base_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_proximal_base_link.STL new file mode 100644 index 0000000000..0115b791c8 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_proximal_base_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_proximal_link.STL new file mode 100644 index 0000000000..f89e6f585b Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/L_thumb_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_hand_base_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_hand_base_link.STL new file mode 100644 index 0000000000..3ec2a5fbf2 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_hand_base_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_index_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_index_intermediate_link.STL new file mode 100644 index 0000000000..cebf9d0988 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_index_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_index_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_index_proximal_link.STL new file mode 100644 index 0000000000..44e3bb20e5 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_index_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_middle_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_middle_intermediate_link.STL new file mode 100644 index 0000000000..64898855ec Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_middle_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_middle_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_middle_proximal_link.STL new file mode 100644 index 0000000000..00e05d2853 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_middle_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_pinky_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_pinky_intermediate_link.STL new file mode 100644 index 0000000000..89f636bc2c Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_pinky_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_pinky_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_pinky_proximal_link.STL new file mode 100644 index 0000000000..92d93fd35f Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_pinky_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_ring_intermediate_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_ring_intermediate_link.STL new file mode 100644 index 0000000000..c6d0862fc7 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_ring_intermediate_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_ring_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_ring_proximal_link.STL new file mode 100644 index 0000000000..93a6e15266 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_ring_proximal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_distal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_distal_link.STL new file mode 100644 index 0000000000..2c74cf031c Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_distal_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_proximal_base_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_proximal_base_link.STL new file mode 100644 index 0000000000..e48921672e Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_proximal_base_link.STL differ diff --git a/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_proximal_link.STL b/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_proximal_link.STL new file mode 100644 index 0000000000..2ac8ba37b8 Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/fourier_hands/R_thumb_proximal_link.STL differ diff --git a/robosuite/models/grippers/__init__.py b/robosuite/models/grippers/__init__.py index 24b817a9d0..56089af8f7 100644 --- a/robosuite/models/grippers/__init__.py +++ b/robosuite/models/grippers/__init__.py @@ -13,6 +13,7 @@ from .bd_gripper import BDGripper from .null_gripper import NullGripper from .inspire_hands import InspireLeftHand, InspireRightHand +from .fourier_hands import FourierLeftHand, FourierRightHand GRIPPER_MAPPING = { "RethinkGripper": RethinkGripper, @@ -27,6 +28,8 @@ "BDGripper": BDGripper, "InspireLeftHand": InspireLeftHand, "InspireRightHand": InspireRightHand, + "FourierLeftHand": FourierLeftHand, + "FourierRightHand": FourierRightHand, None: NullGripper, } diff --git a/robosuite/models/grippers/fourier_hands.py b/robosuite/models/grippers/fourier_hands.py new file mode 100644 index 0000000000..6a2a368d0f --- /dev/null +++ b/robosuite/models/grippers/fourier_hands.py @@ -0,0 +1,143 @@ +""" +Dexterous hands for GR1 robot. +""" +import numpy as np + +from robosuite.models.grippers.gripper_model import GripperModel +from robosuite.utils.mjcf_utils import xml_path_completion + + +class FourierLeftHand(GripperModel): + """ + Dexterous left hand of GR1 robot + + Args: + idn (int or str): Number or some other unique identification string for this gripper instance + """ + + def __init__(self, idn=0): + super().__init__(xml_path_completion("grippers/fourier_left_hand.xml"), idn=idn) + + def format_action(self, action): + # the more correct way is to add tag in the xml + # however the tag makes finger movement laggy, so manually copy the value for finger joints + # 0 is thumb rot, no copying. Thumb bend has 3 joints, so copy 3 times. Other fingers has 2 joints, so copy 2 times. + assert len(action) == self.dof + action = np.array(action) + indices = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5]) + return action[indices] + + @property + def init_qpos(self): + return np.array([0.0] * 11) + + @property + def speed(self): + return 0.15 + + @property + def dof(self): + return 6 + + @property + def _important_geoms(self): + return { + "left_finger": [ + "L_thumb_proximal_base_link_col", + "L_thumb_proximal_link_col", + "L_thumb_distal_link_col", + ], + "right_finger": [ + "L_index_proximal_link_col", + "L_index_intermediate_link_col", + "L_middle_proximal_link_col", + "L_middle_proximal_link_col", + "L_ring_proximal_link_col", + "L_ring_intermediate_link_col", + "L_pinky_proximal_link_col", + "L_pinky_intermediate_link_col", + ], + "left_fingerpad": [ + "L_thumb_proximal_base_link_col", + "L_thumb_proximal_link_col", + "L_thumb_distal_link_col", + ], + "right_fingerpad": [ + "L_index_proximal_link_col", + "L_index_intermediate_link_col", + "L_middle_proximal_link_col", + "L_middle_proximal_link_col", + "L_ring_proximal_link_col", + "L_ring_intermediate_link_col", + "L_pinky_proximal_link_col", + "L_pinky_intermediate_link_col", + ], + } + + +class FourierRightHand(GripperModel): + """ + Dexterous right hand of GR1 robot + + Args: + idn (int or str): Number or some other unique identification string for this gripper instance + """ + + def __init__(self, idn=0): + super().__init__(xml_path_completion("grippers/fourier_right_hand.xml"), idn=idn) + + def format_action(self, action): + # the more correct way is to add tag in the xml + # however the tag makes finger movement laggy, so manually copy the value for finger joints + # 0 is thumb rot, no copying. Thumb bend has 3 joints, so copy 3 times. Other fingers has 2 joints, so copy 2 times. + assert len(action) == self.dof + action = np.array(action) + indices = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5]) + return action[indices] + + @property + def init_qpos(self): + return np.array([0.0] * 11) + + @property + def speed(self): + return 0.15 + + @property + def dof(self): + return 6 + + @property + def _important_geoms(self): + return { + "left_finger": [ + "R_thumb_proximal_base_link_col", + "R_thumb_proximal_link_col", + "R_thumb_distal_link_col", + ], + "right_finger": [ + "R_index_proximal_link_col", + "R_index_intermediate_link_col", + "R_middle_proximal_link_col", + "R_middle_proximal_link_col", + "R_ring_proximal_link_col", + "R_ring_intermediate_link_col", + "R_pinky_proximal_link_col", + "R_pinky_intermediate_link_col", + ], + "left_fingerpad": [ + "R_thumb_proximal_base_link_col", + "R_thumb_proximal_link_col", + "R_thumb_distal_link_col", + ], + "right_fingerpad": [ + "R_index_proximal_link_col", + "R_index_intermediate_link_col", + "R_middle_proximal_link_col", + "R_middle_proximal_link_col", + "R_ring_proximal_link_col", + "R_ring_intermediate_link_col", + "R_pinky_proximal_link_col", + "R_pinky_intermediate_link_col", + ], + } diff --git a/robosuite/models/grippers/inspire_hands.py b/robosuite/models/grippers/inspire_hands.py index 26f61887ab..1484fe55ea 100644 --- a/robosuite/models/grippers/inspire_hands.py +++ b/robosuite/models/grippers/inspire_hands.py @@ -24,7 +24,7 @@ def format_action(self, action): # 0 is thumb rot, no copying. Thumb bend has 3 joints, so copy 3 times. Other fingers has 2 joints, so copy 2 times. assert len(action) == self.dof action = np.array(action) - indices = np.array([0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5]) + indices = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5]) return action[indices] @property @@ -94,7 +94,7 @@ def format_action(self, action): # 0 is thumb rot, no copying. Thumb bend has 3 joints, so copy 3 times. Other fingers has 2 joints, so copy 2 times. assert len(action) == self.dof action = np.array(action) - indices = np.array([0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5]) + indices = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5]) return action[indices] @property diff --git a/robosuite/models/robots/manipulators/gr1_robot.py b/robosuite/models/robots/manipulators/gr1_robot.py index 34035d2f98..ed6119cf90 100644 --- a/robosuite/models/robots/manipulators/gr1_robot.py +++ b/robosuite/models/robots/manipulators/gr1_robot.py @@ -30,7 +30,7 @@ def default_gripper(self): Returns: dict: Dictionary containing arm-specific gripper names """ - return {"right": "InspireRightHand", "left": "InspireLeftHand"} + return {"right": "FourierRightHand", "left": "FourierLeftHand"} @property def default_controller_config(self):