Skip to content

Software

IKPy

From github.com/Phylliade/ikpy (opens in a new tab)

  • Robot arms and industry
  • Library
  • Apache-2.0

IKPy is a pure-Python library that computes inverse kinematics for robot arms, with kinematic chains built from URDF, MJCF, DH parameters or custom definitions.

Facts

GitHub stars
1,041read on 28 Nov 2026
Last update
10 Nov 2026Newest commit on master
Maintenance
Activea commit in the last 90 days
Difficulty
Beginner
Hardware it needs, as the project states it
Pure-Python library installed with pip; requires Python 3.10 or above and the numpy and scipy dependencies. The JAX backend needs the optional jax extra. Plotting needs matplotlib.

Checked on GitHub on 28 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit 95b289b (opens in a new tab), on 14 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Computes inverse kinematics in position, orientation, or both, for any robot described by a kinematic chain.
  • Imports kinematic chains from URDF files and MuJoCo MJCF files, and supports revolute and prismatic joints.
  • Includes pre-configured robots such as baxter and poppy-torso.
  • Plots the kinematic chain, so algorithms can be tested without a real robot or simulator.
  • Offers an optional JAX backend with analytical Jacobians for faster, more robust solving on chains with five or more joints.
  • Lets users define their own inverse kinematics methods through a developer API.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
Used by CamBot, HomeBot and Yertle.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
pip install ikpyWhere it comes from
Maintenance
Active, last commit on 10 Nov 2026.

Works with

3 robots on Robotheca

The robots on Robotheca that use it or can run it, each with how the link was found.

Use it

Copied word for word from the creator's own documentation; each block links to the lines it comes from.

Installation

   pip install ikpy

From README.md at 76852e9, line 243 (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 95b289b

Robotheca read the repository at three versions: the summary at e76c285, the facts and the README at 95b289b (read on 28 Nov 2026) and the install commands at 76852e9 (read on 6 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by @Phylliade, at commit 95b289b, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

IKPy

(opens in a new tab)

Image: DOI (opens in a new tab) (opens in a new tab)

demo

IKPy on the baxter robot

Demo

Live demos of what IKPy can do (click on the image below to see the video):

Image (opens in a new tab) (opens in a new tab) Image (opens in a new tab) (opens in a new tab)

Also, a presentation of IKPy: Presentation (opens in a new tab).

Features

With IKPy, you can:

  • Compute the Inverse Kinematics of every existing robot.
  • Compute the Inverse Kinematics in position, orientation (opens in a new tab), or both
  • Define your kinematic chain using arbitrary representations: DH (Denavit–Hartenberg), URDF, custom...
  • Automatically import a kinematic chain from a URDF file, a MuJoCo MJCF file or a BVH motion capture file.
  • Support for the URDF joint types revolute, continuous and prismatic
  • Use pre-configured robots, such as baxter (opens in a new tab) or the poppy-torso
  • IKPy is precise (up to 7 digits): the only limitation being your underlying model's precision, and fast: from 7 ms to 50 ms (depending on your precision) for a complete IK computation.
  • Plot your kinematic chain: no need to use a real robot (or a simulator) to test your algorithms!
  • Define your own Inverse Kinematics methods.
  • Utils to parse and analyze URDF files:

Picture: baxter_tree.png

Moreover, IKPy is a pure-Python library: the install is a matter of seconds, and no compiling is required.

JAX Backend (Experimental)

IKPy now includes an optional JAX backend for accelerated inverse kinematics using automatic differentiation.

Benefits
ScenarioSpeedup vs NumPy
Single target (complex chains)1.5-4x faster
Trajectory tracking (warm start)2-3x faster
Cold startMore robust (fewer local minima)

The JAX backend uses an analytical Jacobian computed via autodiff, which provides:

  • Faster convergence on difficult targets
  • Better robustness against local minima
  • Significant speedup on robots with 5+ joints
Motion capture (BVH) Support

IKPy also reads BVH (Biovision Hierarchy) motion capture files: any path of the skeleton becomes a chain, and the motion of the file can be replayed on it, frame by frame:

from ikpy.chain import Chain
from ikpy.bvh import BVH

# From the hips to the left hand; the path in between is found automatically
chain = Chain.from_bvh_file("walk.bvh", base="Hips", tip="LeftHand", scale=0.01)

trajectory, frame_time = BVH.get_bvh_motion("walk.bvh", base="Hips", tip="LeftHand", scale=0.01)
hand_frames = [chain.forward_kinematics(joints) for joints in trajectory]

Each channel of a joint becomes one link (Hips_Zrotation, Hips_Xrotation...), so the chain follows the exact rotation order of the file. BVH files do not specify their unit: use scale to convert them to meters. ikpy.bvh.BVH.get_joint_names lists the joints of a file.

A better solution: multi-start

The optimizer is local: it converges to the solution closest to its starting point, initial_position. When that lands in a poor local minimum, give several starting points instead of one, and the best solution is returned:

joints = chain.inverse_kinematics(target_position, target_orientation, orientation_mode="all", initial_position=20)

initial_position stays a single configuration in the usual case. An int draws that many starting points anywhere in the joint limits. A dict combines given points and drawn ones: {"points": [current_joints, home_joints], "n": 8, "seed": 0} starts from the two given configurations and 8 drawn points (n defaults to 0, so a dict with only points uses just those). A list of configurations, of shape (n_starts, n_links), gives the starting points themselves.

Active and held links

The active_links_mask of a chain tells, for each link, whether the inverse kinematics moves it (True) or holds it at a value (a number). A configuration given as initial_position mirrors it: a starting value for each active link, False for each held link, which takes the value of the mask:

chain = Chain.from_urdf_file("robot.urdf", active_links_mask=[0, 0.3, True, True, True, 0])
joints = chain.inverse_kinematics(target_position, initial_position=[False, False, 0.1, 0.5, -0.2, False])

A number given for a held link is replaced by the value of the mask, with a warning. False in the active_links_mask, an inactive link reading its value from the starting point, is deprecated.

Without an active_links_mask, every link is active except the fixed ones, held at 0. An active prismatic link must have bounds: one without, such as the position channels of a BVH skeleton, is held at 0 by default, and is an error if set to True. chain.links_mask gives the mask of a chain, to edit and give back:

chain = Chain.from_bvh_file("capture.bvh", base="Hips", tip="LeftHand")
mask = chain.links_mask  # the position of the hips is held
mask[4] = 0              # hold one more link
chain = Chain.from_bvh_file("capture.bvh", base="Hips", tip="LeftHand", active_links_mask=mask)

To get every distinct solution of a target rather than the best one (elbow up and elbow down, wrist flipped...), chain._inverse_kinematics_solutions_frame(frame, initial_position=20, max_error=1e-3) returns them sorted by error; it is kept out of the main API but documented for that use.

Moving along a trajectory

A single IK call jumps to the solution closest to its starting point, which can be far from where the robot is. To move from one pose to another, interpolate the frames and solve them in sequence: each step starts from the previous solution, so the joint motion stays continuous:

from ikpy.utils import geometry

start = chain.forward_kinematics(current_joints)
end = geometry.to_transformation_matrix(target_position, target_orientation)
frames = geometry.interpolate_frames(start, end, n_steps=50)   # straight line, constant-speed rotation

trajectory = chain.inverse_kinematics_trajectory_frame(frames, initial_position=current_joints, orientation_mode="all")
for joints in trajectory:   # one row per frame
    robot.move_to(joints)

inverse_kinematics_trajectory takes arrays of positions and orientations instead of frames. Any list of frames works, so waypoints computed by a path planner (to go around an obstacle, for example) are solved the same way. regularization_parameter pulls each step towards the previous one for smoother joint motion, at the price of some accuracy. An int or a dict as initial_position runs the multi-start on the first step, which picks the branch of solutions the trajectory then follows. A frame out of reach gets the closest configuration; check each step with the residual the solver minimizes:

from ikpy.inverse_kinematics import target_error
errors = [np.linalg.norm(target_error(chain, joints, frame, "all")) for joints, frame in zip(trajectory, frames)]
Orientation conversions

IKPy works with homogeneous matrices. To exchange orientations with ROS, Unity or Blender, ikpy.utils.geometry converts the rotation part of a frame to and from quaternions, roll-pitch-yaw and arbitrary Euler sequences:

from ikpy.utils import geometry

frame = chain.forward_kinematics(joints)
quaternion = geometry.rotation_matrix_to_quaternion(frame)            # (x, y, z, w), as in ROS and Unity
quaternion = geometry.rotation_matrix_to_quaternion(frame, scalar_first=True)  # (w, x, y, z), as in Blender
roll, pitch, yaw = geometry.rotation_matrix_to_rpy(frame)             # URDF convention

# And back, as an orientation target for the IK
target_orientation = geometry.quaternion_to_rotation_matrix(quaternion)
joints = chain.inverse_kinematics(target_position, target_orientation, orientation_mode="all")
Installation
pip install 'ikpy[jax]'
Usage
from ikpy.chain import Chain

# Load your robot
chain = Chain.from_urdf_file("my_robot.urdf")

# Use JAX backend for IK
result = chain.inverse_kinematics(
    target_position=[0.5, 0.2, 0.3],
    backend="jax"  # Use JAX instead of NumPy
)

# Trajectory tracking with warm start (recommended)
current_joints = None
for target in trajectory:
    result = chain.inverse_kinematics(
        target_position=target,
        initial_position=current_joints,
        backend="jax"
    )
    current_joints = result  # Use solution as next initial guess
Configuration

Two arguments bound the work of the optimizer, and they mean the same thing whichever backend and whichever optimizer you use:

chain.inverse_kinematics(
    target_position=target,
    optimizer_budget=10,  # Approximate number of evaluations allowed
    tol=1e-4,             # Convergence tolerance
)

optimizer_budget is a budget rather than a hard cap: an optimizer finishing a gradient estimation can overshoot it slightly. Use it to trade accuracy for speed in real-time loops.

Everything else goes through optimizer_kwargs, forwarded as-is to the SciPy optimizer in use (scipy.optimize.least_squares by default, scipy.optimize.minimize for optimizer="scalar"):

chain.inverse_kinematics(target_position=target, optimizer_kwargs={"loss": "soft_l1"})

The bounds are derived from the limits of the links, so they cannot be set there, and neither can an option that optimizer_budget or tol is already setting.

The JAX backend uses scipy.optimize.least_squares with an analytical Jacobian, and takes a few options of its own on top:

chain.inverse_kinematics(
    target_position=target,
    backend="jax",
    optimizer_budget=10,           # Same argument as above
    scipy_method='trf',            # 'trf', 'dogbox', or 'lm'
    scipy_x_scale='jac',           # Auto-scaling (default, recommended)
    use_analytical_jacobian=True,  # Set False for finite differences
)
When to use JAX vs NumPy
Use CaseRecommended Backend
Simple chains (≤4 joints), easy targetsNumPy
Complex chains (≥5 joints)JAX
Trajectory trackingJAX
Real-time controlJAX (after warmup)
One-off calculationsNumPy (no compilation overhead)

Note: The first JAX call includes JIT compilation overhead (~1-5s). Subsequent calls are fast.

Selecting a chain

A robot description is a tree. A chain is the path from a base element to a tip element, and that path is unique, so the two names are all it takes, in every format:

chain = Chain.from_urdf_file("baxter.urdf", base="base", tip="left_gripper", tip_offset=[0, 0, 0.1])
chain = Chain.from_mjcf_file("ur5e.xml", base="base", tip="wrist_3_link")
chain = Chain.from_bvh_file("walk.bvh", base="Hips", tip="LeftHand")

base defaults to the root of the file and tip to the only leaf below base; when the tree branches, the error lists the leaves to choose from. In a URDF, base and tip can name a link or a joint; when a link and a joint share a name, the name means the link, and {"name": "left_hand", "type": "joint"} says otherwise. tip_offset adds a fixed translation at the end of the chain, in the frame of its last joint, typically the tool center point.

The former base_elements, base_element_type and last_link_vector arguments still work with a DeprecationWarning, and will be removed in IKPy 5.0.

MuJoCo (MJCF) Support

In addition to URDF, IKPy can import kinematic chains directly from MuJoCo MJCF XML files:

from ikpy.chain import Chain

chain = Chain.from_mjcf_file("ur5e.xml", base="base", tip="wrist_3_link")

The parser supports MuJoCo compiler settings, default classes (including childclass inheritance), and provides helpers to inspect models (ikpy.mjcf.get_body_names, ikpy.mjcf.get_joint_names).

Installation

You have three options:

  1. From PyPI (recommended) - simply run:

    pip install ikpy
    

    If you intend to plot your robot, you can install the plotting dependencies (mainly matplotlib):

    pip install 'ikpy[plot]'
    

    If you want to use the JAX backend, install the JAX dependencies:

    pip install 'ikpy[jax]'
    
  2. From source - first download and extract the archive, then run:

    pip install ./
    

    NB: You must have the proper rights to execute this command

Quickstart

Follow this IPython notebook (opens in a new tab).

Guides and Tutorials

Go to the wiki (opens in a new tab). It should introduce you to the basic concepts of IKPy.

API Documentation

An extensive documentation of the API can be found here (opens in a new tab).

Dependencies and compatibility

Starting with IKPy v4, Python 3.10 or above is required. Starting with IKPy v3.1, only Python 3 is supported. For versions before v3.1, the library can work with both versions of Python (2.7 and 3.x).

In terms of dependencies, it requires numpy and scipy.

sympy is highly recommended, for fast hybrid computations, that's why it is installed by default.

matplotlib is optional: it is used to plot your models (in 3D).

Contributing

IKPy is designed to be easily customisable: you can add your own IK methods or robot representations (such as DH-Parameters) using a dedicated developer API (opens in a new tab).

Contributions are welcome: if you have an awesome patented (but also open-source!) IK method, don't hesitate to propose adding it to the library!

Links
  • If performance is your main concern, aversive++ has an inverse kinematics module (opens in a new tab) written in C++, which works the same way IKPy does.
Citation

If you use IKPy as part of a publication, please use the Bibtex below as a citation:

@software{Manceron_IKPy,
author = {Manceron, Pierre},
doi = {10.5281/zenodo.6551105},
license = {Apache-2.0},
title = {{IKPy}},
url = {https://github.com/Phylliade/ikpy}
}

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.