Skip to content

Commit

Permalink
[add] add leap hand retargeting config
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqin committed Dec 21, 2023
1 parent f2d1218 commit 3aa3e1a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets
17 changes: 17 additions & 0 deletions dex_retargeting/configs/teleop/leap_hand_right.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
retargeting:
type: vector
urdf_path: leap_hand/leap_hand_right.urdf
wrist_link_name: "base"

# Target refers to the retargeting target, which is the robot hand
target_joint_names: null
target_origin_link_names: [ "base", "base", "base", "base" ]
target_task_link_names: [ "thumb_tip_head", "index_tip_head", "middle_tip_head", "ring_tip_head" ]
scaling_factor: 1.6

# Source refers to the retargeting input, which usually corresponds to the human hand
# The joint indices of human hand joint which corresponds to each link in the target_link_names
target_link_human_indices: [ [ 0, 0, 0, 0 ], [ 4, 8, 12, 16 ] ]

# A smaller alpha means stronger filtering, i.e. more smooth but also larger latency
low_pass_alpha: 0.2
12 changes: 12 additions & 0 deletions dex_retargeting/configs/teleop/leap_hand_right_dexpilot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
retargeting:
type: DexPilot
urdf_path: leap_hand/leap_hand_right.urdf
wrist_link_name: "base"

# Target refers to the retargeting target, which is the robot hand
target_joint_names: null
finger_tip_link_names: [ "thumb_tip_head", "index_tip_head", "middle_tip_head", "ring_tip_head" ]
scaling_factor: 1.6

# A smaller alpha means stronger filtering, i.e. more smooth but also larger latency
low_pass_alpha: 0.2
2 changes: 2 additions & 0 deletions dex_retargeting/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class RobotName(enum.Enum):
allegro = enum.auto()
shadow = enum.auto()
svh = enum.auto()
leap = enum.auto()


class RetargetingType(enum.Enum):
Expand All @@ -23,6 +24,7 @@ class HandType(enum.Enum):
RobotName.allegro: "allegro_hand",
RobotName.shadow: "shadow_hand",
RobotName.svh: "schunk_svh_hand",
RobotName.leap: "leap_hand",
}

ROBOT_NAMES = list(ROBOT_NAME_MAP.keys())
Expand Down
2 changes: 2 additions & 0 deletions example/vector_retargeting/render_robot_hand.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def render_by_sapien(
robot.set_pose(sapien.Pose([0, 0, -0.05]))
elif "dlr" in robot_file_name:
robot.set_pose(sapien.Pose([0, 0, -0.08]))
elif "leap" in robot_file_name:
robot.set_pose(sapien.Pose([0, 0, -0.1]))
else:
robot.set_pose(sapien.Pose([0, 0, 0.0]))

Expand Down

0 comments on commit 3aa3e1a

Please sign in to comment.