User Guide

Arm Retargeting

An xArm7 carrying an XHand in the interactive retargeting gallery

Map a tracked wrist to an xArm6 or xArm7 end effector. The arm solver uses RoboKit inverse kinematics with position, orientation, joint-limit, and smoothness terms.

How Retargeting Works

The source reports wrist poses in an ArmFrame. Calibration establishes the robot's home pose; inverse kinematics then maps relative wrist motion to a joint-position command for each arm.

Preview one arm

Complete Vision Pro setup, then run:

shell
uv run --extra vision-pro scripts/teleop/arm.py \
    visionpro_xarm7 --mode viser --device cpu \
    --source.ip <VISION_PRO_IP>

Open the Viser URL printed in the terminal. visionpro_xarm6 selects xArm6; visionpro_dual_xarm7 controls two independent arms.

Use the Python API

Build the rig's right-arm retargeter and pass it one ArmFrame per update:

python
from retargetingkit.configs.teleop.arm.visionpro_xarm7 import RIGHT_VISIONPRO_XARM7_CONFIG

retargeter = RIGHT_VISIONPRO_XARM7_CONFIG.retargeters["right"].build(device)

for frame in stream:  # ArmFrame: world-frame wrist [x, y, z, qw, qx, qy, qz]
    command = retargeter.solve(frame)
    qpos = command.qpos  # (7,), xArm7 joint positions

The first frame is the calibration origin, so it returns the home pose.

Retarget an arm and hand

Optimize the arm and fingers from each synchronized ArmHandFrame. The wrist pose is in world coordinates; hand keypoints are wrist-local. This example builds only the solvers and needs no tracking device or robot connection.

python
from retargetingkit.configs.teleop.arm_hand.visionpro_xarm7_xhand import RIGHT_VISIONPRO_XARM7_XHAND_CONFIG

config = RIGHT_VISIONPRO_XARM7_XHAND_CONFIG
arm = config.arm_retargeters["right"].build(device)
hand = config.hand_retargeters["right"].build(device)

for frame in stream:  # ArmHandFrame: synchronized wrist and finger poses
    arm_qpos = arm.solve(frame.arm).qpos  # (7,), xArm7 joints
    hand_qpos = hand.solve(frame.hand).qpos  # (12,), XHand joints

Calibration and motion

The first tracked wrist pose becomes the calibration origin and maps to the robot's configured home pose. Wrist movement is then applied relative to that origin.

Override for the right armEffectDefault
--retargeters.right.translation-scaleScale wrist translation1.5
--retargeters.right.ee-gainBlend each new end-effector pose with the previous pose1.0

A smaller gain smooths movement more. Use visionpro_xarm7 --help for all settings. Arm-hand rigs use the prefix --arm-retargeters.right instead.

Connect a robot

Use the xArm guide for SDK installation, network setup, and hardware mode. At startup, hardware mode moves each arm to its model-specific home pose.

To move fingers along with the wrist, choose a supported assembly on the Vision Pro page. Quest controller teleoperation has its own standalone workflow and button calibration.