User Guide

Quickstart

Try it without installing

Run this to start the interactive IK gallery:

shell
uvx --from robokit python -m robokit.gallery.ik

Drag targets, switch robots, and adjust weights. Replace ik with any gallery below.

IK target tracking and robot switchingHumanoid tracking hand targets while balancingMotion planning around a shelf
ik Drag targets and tune IK weights.ik_legged Balance humanoids and quadrupeds.motion_plan Plan motions around obstacles.
Human motion retargeted to a G1 humanoidHumanoid moving a clothes stand with contact constraintsHand-object retargeting across DexMachina, GigaHands, and OakInk2
humanoid_retargeting Retarget human motion to humanoids.humanoid_retargeting_contact Retarget humanoids with object contacts.hand_retargeting_contact Retarget hands with object contacts.
XHand on an xArm7 replaying a captured hand motionKUKA iiwa arm moving through a smooth joint motionA ParaHome cutting-board clip retargeted whole-body
hand_retargeting Retarget hands onto any base, online or offline.robot_models Browse robots, collision spheres, and frames.full_body_retargeting Retarget whole-body human-object interaction.

Solve one IK problem

After installing, this is the whole program:

python
from robot_descriptions.loaders.yourdfpy import load_robot_description

from robokit.helpers.ik import IKSolver, presets
from robokit.robo import Robot

robot = Robot.load(load_robot_description("panda_description"))
ik = IKSolver(presets.basic, robot=robot, target_links="panda_hand")

T_world_target = [0.5, 0.2, 0.5, 0.0, 0.0, 1.0, 0.0]  # x, y, z, qw, qx, qy, qz
state = ik.solve_numpy(T_world_target)
print(state.q.numpy()[0])  # joint positions

IK uses the GPU when one is visible, else the CPU.

More examples

Galleries are interactive demos. For code to copy, open a runnable script below. Paths are relative to src/robokit/examples.

DirectoryScripts
ik01_basic.py, 02_smooth.py, 03_batch.py, 04_torch.py, 05_bimanual.py, 06_mobile.py, 07_mimic_joints.py, 08_collision.py, 09_self_collision.py, 10_humanoid.py, 11_manipulability.py, 12_heterogeneous_collision.py
motion_plan01_online_mppi.py, 02_offline_lbfgs.py, 03_offline_batch.py, 04_online_lbfgs.py, 05_q_goal.py, 06_heterogeneous.py
humanoid_retargeting01_online.py, 02_collision.py, 03_self_collision.py, 04_offline.py, 05_batch.py, 06_online_batch.py, 07_contact.py, 08_terrain.py, 09_alignment.py, 10_full_body.py, 11_full_body_batch.py
hand_retargeting01_online.py, 02_offline.py, 03_batch.py, 04_arm.py, 05_online_batch.py, 06_contact.py, 07_batch_contact.py
hand_eye_calibration01_sim_rgb.py, 02_sim_mounted.py, 03_sim_depth.py, 04_real_xarm.py, 05_sim_offsets.py, 06_sim_qpos.py
grasp01_basic.py, 02_annealed_gd.py
geom01_basic.py, 02_robot.py, 03_heterogeneous_batch.py, 04_lod.py
opt01_rosenbrock.py, 02_solvers.py, 03_multi_candidate.py, 04_curve_fit.py, 05_mpc_pendulum.py, 06_mpc_navigation.py, 07_ilqr_pendulum.py
sim_mpc01_sharpa_oakink.py, 02_xhand_arctic.py, 03_g1_climb.py, 04_g1_carry.py, 05_g1_amass.py, 06_leap_cube.py, 07_sharpa_pen.py, 08_sharpa_coin.py, 09_sharpa_cap.py, 10_wuji_cube.py, 11_h1_jog.py, 12_go2_jump.py, 13_fr3_push.py, 14_fr3_balance.py, 15_batch.py, 16_demo_repair.py, 18_g1_flip.py

Example usage:

shell
uv run src/robokit/examples/ik/01_basic.py