
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots.
C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots based on Alternative Inverse Kinematic Solution of the UR5 Robotic Arm.
This project is still very experimental, the API will likely still change.
The main advantages of using analytic IK:
Warning: this repo uses the default DH-parameters for the UR robots. But every robot is slightly different and is factory-calibrated to provide very accurate DH parameters, which are also used by the robot controlbox. From a few tests we have run, using the default DH-parameters typically results in 1-2mm differences in the FK for a given joint configuration. See here for details. If you need very high precision, you might want to use your robot's DH-parameters for FK/IK.
pre-built wheels are availabe on PyPI and can be installed with pip:
pip install ur_analytic_ik
To install from source, see the Developer section.
Afterwards, you should be able to issue the FK and IK functions like this:
import numpy as np
from ur_analytic_ik import ur5e
eef_pose = np.identity(4)
X = np.array([-1.0, 0.0, 0.0])
Y = np.array([0.0, 1.0, 0.0])
Z = np.array([0.0, 0.0, -1.0])
top_down_orientation = np.column_stack([X, Y, Z])
translation = np.array([-0.2, -0.2, 0.2])
eef_pose[:3, :3] = top_down_orientation
eef_pose[:3, 3] = translation
solutions = ur5e.inverse_kinematics(eef_pose)
More examples:
import numpy as np
from ur_analytic_ik import ur3e
joints = np.zeros(6)
eef_pose = np.identity(4)
eef_pose[2, 3] = 0.4
tcp_transform = np.identity(4)
tcp_transform[2, 3] = 0.1
ur3e.forward_kinematics(0, 0, 0, 0, 0, 0)
ur3e.forward_kinematics(*joints)
tcp_pose = ur3e.forward_kinematics_with_tcp(*joints, tcp_transform)
joint_solutions = ur3e.inverse_kinematics(eef_pose)
joint_solutions = ur3e.inverse_kinematics_closest(eef_pose, *joints)
joint_solutions = ur3e.inverse_kinematics_with_tcp(eef_pose, tcp_transform)
joint_solutions = ur3e.inverse_kinematics_closest_with_tcp(eef_pose, tcp_transform, *joints)
This codebase uses nanobind to provide python bindings for the FK/IK functions.
python package building
This is the easiest option. It leverages scikit-build to create a python package and build the bindings. This flow is based on https://github.com/wjakob/nanobind_example
conda env create -f environment.yaml
pip install .
(this uses scikit-build to build the C++ from the top-level CMakelist.txt)C++ building
if you want to build the C++ code without building the bindings or creating a python package:
apt install libeigen3-dev
.Some linux users have eigen installed at /usr/include/eigen3 instead of /usr/include/Eigen. Symlink it:
sudo ln -sf /usr/include/eigen3/Eigen /usr/include/Eigen
sudo ln -sf /usr/include/eigen3/unsupported /usr/include/unsupported
cmake -S . -B
& cmake --build build
from the src/
dir../build/main
run pytest -v .
Tests are also automatically executed in github for each commit.
Wheels are built automatically for all PRs, you can check them on test PyPI.
pyproject.toml
file. We use semantic versioning. Use pre-releases if you want to test changes.git tag vX.Y.Z-...
git push --tag
, this will already trigger a build of the wheels on test PyPIAdding an IK function that returns the closest solution and accepts a TCP transform.
Reducing the amount of separate IK functions, e.g. replacing:
ur3e.inverse_kinematics_with_tcp(eef_pose)
# with
ur3e.inverse_kinematics(eef_pose, tcp=tcp_transform)
The same holds for functions ending with _closest()
.
Currently IK runs at about 10 μs / EEF pose on my laptop.
However, before I implemented the filtering of the solutions, it was closer to 3 μs.
Part of this is because I adapted the bindings in ur_analytic_ik_ext.cpp
to return vectors with the solutions.
ur_analytic_ik_ext.cpp
should be made much more readable.FAQs
C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots.
We found that ur-analytic-ik demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.