Repository for Paper "Analyzing Key Objectives in Human-to-Robot Retargeting for Dexterous Manipulation".
In this repository, we provide:

Ubuntu 22.04.
To use ros2 with conda, the python version of the virtual env must be consistent with the system python. In addition, install Pinocchio when creating the virtual env.
shell
# e.g., ubuntu 22.04
conda create -n <your_env_name> -c conda-forge python=3.10.12 pinocchio
Install PyTorch.
Install:
bash
pip install numpy
pip install mujoco
pip install nlopt
pip install pynput
pip install opencv-python
pip install mediapipe # for RGB-based hand detection
pip install avp_stream # for Vision-Pro
Install ROS2 Humble.
ROS2 dependencies:
shell
sudo apt-get install python3-colcon-common-extensions
sudo apt-get install ros-humble-xacro
sudo apt-get install ros-humble-robot-state-publisher
sudo apt-get install ros-humble-joint-state-publisher
sudo apt-get install ros-humble-joint-state-publisher-gui
Clone this repo: git clone --recurse-submodules https://github.com/Mingrui-Yu/retargeting.git
(Only for Leap Hand Hardware) Dependence of Leap Hand hardware: refer to here.
Build the ROS2 workspace:
cd ws_ros2
colcon build --symlink-install
# launch the rviz
cd ws_ros2
source install/setup.bash
ros2 launch retargeting_benchmark rviz_vis_paxini.py
# launch the retargeting module
cd retargeting
source ws_ros2/install/setup.bash
python ws_ros2/src/retargeting_benchmark/src/main_robot_teleoperation.py
If you want to do some customized development, such as adding new robots, please follow these instructions.
Place the robot file (.xacro) in src/my_robot_descriptioin/urdf/. (We recommend xacro since it supports convenient combination of arms, hands, and fingertip tactile sensors.)
Convert from .xacro to .urdf:
```bash cd ws_ros2 source install/setup.bash
# e.g. xacro src/my_robot_description/urdf/panda_leap_tac3d.xacro > src/my_robot_description/urdf/panda_leap_tac3d.urdf ```
bash
cd retarget_benchmark
ln -s ws_ros2/src/my_robot_description/urdf/panda_leap_tac3d.urdf assets/panda_leap_tac3d.urdf
python ws_ros2/src/retargeting_benchmark/src/main_robot_file_process.py
Write the Rviz launch file according to the following examples:
# e.g.,
ros2 launch my_robot_description vis_panda_leap_tac3d.py
ros2 launch my_robot_description vis_panda_leap_paxini.py
Notice: The following hardware setup may only work on the Panda arm + Leap Hand in our lab.
unlock robot arm at 192.168.52.3/desk/ and activate FCI;
Driver on Franka Control PC:
```shell ssh robotics@192.168.52.5
cd franka_emika_panda/ws_ros2/ source install/setup.bash
ros2 launch franka_bringup low_level_joint_impedance_controller.launch.py arm_id:=fer robot_ip:=192.168.52.3 ```
conda activate <env>
ros2 launch leap_hand leap_bringup.py
Real prepare:
franka_joint_states_freq_reduce
shell
conda activate <env>
ros2 launch retargeting_benchmark real_prepare.py
$ claude mcp add retargeting \
-- python -m otcore.mcp_server <graph>