C++17 Inverse Kinematics Toolkit

Practical IK Solvers for 2D and 3D Chains

IKSolver combines CCD, FABRIK, and Jacobian methods with constraints, vector utilities, demos, and tests so you can prototype robotic motion fast.

Interactive IK Playground

Move the cursor (or touch) to reposition the target and compare CCD vs FABRIK behavior.

Chain Links Joints Target

Build And Test

make clean
make -B
make run-tests

SDL2 is only required for demo executables. Core library and tests do not require rendering.

Minimal Usage

IKChain2D chain({{0,0},{1,0},{2,0}});
Vector2 target(1.5, 0.5);
CCDResult r = CCDSolver::Solve(chain, target);
if (r == CCD_SUCCESS) {
  // use end effector
}

Use explicit comparisons with result enums for robust control flow.

System Structure

Math Layer

Vector2, Vector3, and MathUtils provide low-level geometry, numeric safety, and utility helpers.

Chain Layer

IKChain2D and IKChain3D own positional state, lengths, constraints, and forward kinematics.

Solver Layer

CCD, FABRIK, and Jacobian mutate chain state in place and return explicit outcome codes.

See README_TECHNICAL.md for implementation details and extension guidance.