UM-ARM-Lab/pytorch_kinematics
Robot kinematics implemented in pytorch
What it solves
PyTorch Robot Kinematics provides a high-performance, differentiable framework for calculating robot kinematics. It solves the problem of performing forward kinematics (FK), Jacobian calculations, and inverse kinematics (IK) in a way that is parallelizable and compatible with PyTorch's autograd system, allowing these operations to be integrated directly into machine learning pipelines.
How it works
The library loads robot descriptions from standard formats like URDF, SDF, and MJCF. It implements kinematics operations using PyTorch tensors, enabling batch processing of multiple robot configurations simultaneously on CPU or GPU.
Key technical implementations include:
- Analytical Geometric Jacobian: Used for the backward pass of FK to speed up gradient computation by ~9x compared to standard autograd.
- Damped Least Squares: An iterative method used for Inverse Kinematics to avoid oscillations near singularities.
- torch.compile Support: The library is optimized for PyTorch 2.0+, allowing FK and Jacobian kernels to be compiled into optimized graphs for significant speedups.
Who it’s for
It is designed for robotics researchers and engineers who need to perform fast, differentiable kinematics calculations for trajectory optimization, robot learning, or collision checking (via integration with pytorch-volumetric).
Highlights
- Multi-format Support: Loads robot descriptions from URDF, SDF, and MJCF files.
- Parallel Execution: Batch processes joint values to compute transforms and Jacobians orders of magnitude faster than serial loops.
- Differentiable: Fully compatible with PyTorch autograd for gradient-based optimization.
- Optimized Performance: Leverages
torch.compilefor significant speedups in both FK and IK loops. - Standalone IK: Provides an IK solver that is not dependent on ROS.
Related
- Project
- Project
- Project
- Project
- Project