This repository contains the code from "HJCD-IK: GPU-Accelerated Inverse Kinematics through Batched Hybrid Jacobian Coordinate Descent"
- NVIDIA GPU + CUDA Toolkit 12.x
- Python ≥ 3.9
- CMake ≥ 3.23
- Visual Studio 2022 (Windows) or GCC/Clang (Linux)
git clone https://github.com/A2R-Lab/HJCD-IK.git
cd HJCD-IKHJCD-IK relies on GRiD, a GPU-accelerated library for rigid body dynamics and analytical gradients.
(Linux)
chmod +x scripts/bootstrap.sh
./scripts/bootstrap.shNote: may need to run dos2unix scripts/bootstrap.sh before ./scripts/bootstrap.sh first
(Windows)
.\scripts\bootstrap_windows.batYou can install hjcdik with pip on Python ≥ 3.9:
python -m pip install -e .At installation, HJCD-IK creates a new GRiD header file for the Franka Panda Arm and sets panda_grasptarget_hand as its end-effector flange. To use a different robot, you must first create a new grid.cuh header file using:
python scripts/generate_grid.py <PATH_TO_URDF> -t <FIXED_TARGET_NAME>PATH_TO_URDF: the path to the new robot URDF fileFIXED_TARGET_NAME: the name of the robot end-effector flange (e.g. Franka:panda_grasptarget_hand)- Note: GRiD prints out possible fixed joint names found (if any) during code generation
To run IK benchmark, use:
python benchmark/ik_benchmark.py --skip-grid-codegenwhich performs IK using the Panda Arm with batches of 1, 10, 100, 1000, 2000. Results are written to a results.yml.
--num-targets <int>- How many target poses to sample. Default:
100
- How many target poses to sample. Default:
--batches "<list>"- Batch sizes to test (comma or space separated). Default:
"1,10,100,1000,2000"
- Batch sizes to test (comma or space separated). Default:
--num-solutions <int>- How many IK solutions to return per call. Default:
1
- How many IK solutions to return per call. Default:
--yaml-out <path>- Output result file. Default:
results.yml
- Output result file. Default:
--urdf <path>- URDF path used if running GRiD codegen. Default:
include/test_urdf/panda.urdf
- URDF path used if running GRiD codegen. Default:
--grid-target <FIXED_TARGET_NAME>- The name of the robot end-effector flange offset
--skip-grid-codegen- Skips creating GRiD header file and immediately runs benchmarks. Default: off
--seed <int>- Seed for target sampling. Default:
0
- Seed for target sampling. Default:
- Custom batches/targets/solutions, out file name:
python benchmark/ik_benchmark.py \
--batches "1,32,256,2048" \
--num-targets 250 \
--num-solutions 4 \
--yaml-out results.yml \
--skip-grid-codegen- To generate a new GRiD header on a different robot, run:
python benchmark/ik_benchmark.py --urdf include/test_urdf/fetch.urdfTo run collision-free benchmark on the MotionBenchMaker dataset, run:
python benchmark/ik_benchmark.py --skip-grid-codegen --collision-free --problems-json tests/mb_problems.json --problem-set bookshelf_thin_panda--collision-free- Enable collision filter on solutions.
--problems-json <path>- Path to json problem file for collision-free benchmarking.
--problem-set <str>- Problem set within json file to run benchmarking.
--problem-idx <int>- Run collision-free benchmarking on specific problem index within problem set.
Collision environments are specified in the Motion Benchmarker-style JSON problem format. Each problem contains a goal_pose, start configuration, world_frame, and an optional obstacles field. Examples of environments can be found in the tests folder.
Obstacles are grouped by primitive type. Currently only cuboid and cylinder primitives are supported.
Cuboids are specified under obstacles.cuboid:
"cuboid": {
"cube_robot_stand": {
"dims": [0.30, 0.25, 0.80],
"pose": [-0.05, 0.00, -0.40, 1, 0, 0, 0]
}
}Each cuboid requires:
dims:[x, y, z]sides lengths in meterspose:[x, y, z, qw, qx, qy, qz]in the problem'sworld_frame
Cylinders are specificed under obstacles.cylinder:
"cylinder": {
"goal_post": {
"radius": 0.035,
"height": 0.24,
"pose": [0.35, 0.15, 0.12, 1, 0, 0, 0]
}
}Each cylinder requires:
radius: cylinder radius in metersheight: cylinder height in meterspose:[x, y, z, qw, qx, qy, qz]in the problem'sworld_frame
- HJCD-IK currently only supports robots using revolute, prismatic, and fixed joints without any closed kinematic loops.
- Collision-Free support is currently limited to the Franka Panda and Fetch Arms with support for additional and custom robots coming soon!
Please cite HCJD-IK if you found this work useful:
@article{yasutake2025hjcd,
title={HJCD-IK: GPU-Accelerated Inverse Kinematics through Batched Hybrid Jacobian Coordinate Descent},
author={Yasutake, Cael and Kingston, Zachary and Plancher, Brian},
journal={arXiv preprint arXiv:2510.07514},
year={2025}
}