Dex Retargeting
raw JSON → 0.5.0 verified Sat May 09 auth: no python
Dex Retargeting is a Python library for retargeting hand poses from human hand models to dexterous robot hands. It supports multiple retargeting methods (e.g., keypoint-based, joint angle mapping) and is designed for use in robot learning and teleoperation. Version 0.5.0 has a nightly release cadence, with active development. Requires Python >=3.7, <3.13.
pip install dex-retargeting Common errors
error ModuleNotFoundError: No module named 'dex_retargeting' ↓
cause Package not installed or misspelled.
fix
Run
pip install dex-retargeting (note the hyphen, not underscore). error AttributeError: module 'dex_retargeting' has no attribute 'PoseRetargeting' ↓
cause Attempted to import PoseRetargeting from root of package.
fix
Use
from dex_retargeting.retargeting import PoseRetargeting instead. error ValueError: Unknown robot name 'panda' ↓
cause Specified robot name not in the list of supported robots.
fix
Check supported robot names: 'allegro', 'shadowhand', 'barrett', etc. See docs.
Warnings
gotcha The retarget function expects source poses in a specific joint order (MANO convention). Using incorrect ordering will silently produce wrong results. ↓
fix Ensure your input joints follow the MANO hand joint ordering (21 joints in specific order). Refer to the model documentation.
deprecated The 'robot_name' parameter in retarget() is deprecated in favor of passing a robot config object in future versions. Current version still supports string names, but will be removed. ↓
fix Use a robot configuration object: `from dex_retargeting.robot_config import get_robot_config; robot_cfg = get_robot_config('allegro'); robot_joints = retarget(source_pose, robot_cfg)`
breaking Python 3.13 and above are not supported due to <3.13 constraint. ↓
fix Use Python 3.7-3.12.
Imports
- PoseRetargeting wrong
from dex_retargeting import PoseRetargetingcorrectfrom dex_retargeting.retargeting import PoseRetargeting - retarget
from dex_retargeting.retargeting import retarget
Quickstart
import numpy as np
from dex_retargeting.retargeting import retarget
# Example: retarget a single hand pose
source_pose = np.random.rand(21, 3) # MANO hand joints
robot_joints = retarget(source_pose, robot_name='allegro')
print(robot_joints)