pypose/pypose

A library for differentiable robotics on manifolds.

PyPose – Robotics‑focused library that blends deep learning with physics‑based optimisation

What it is – PyPose is a Python package built on top of PyTorch that provides Lie‑group mathematics, classic state‑estimation filters, and second‑order optimisation tools (Gauss‑Newton, Levenberg‑Marquardt, etc.) for robot‑learning pipelines. It is deliberately imperative (you write ordinary PyTorch code) while exposing robotics‑specific primitives such as SE(3) transforms, EKF/UKF filters, IMU pre‑integration, and bundle‑adjustment‑style sparse optimisation.

Key components

  • LieTensor: GPU‑accelerated tensors representing SO(3), SE(3), Sim(3), RxSO(3) and their algebras, with automatic differentiation support.
  • Modules: Ready‑made system models (LTI, LTV, NLS), filters (EKF, UKF, particle filter), a PnP solver, LQR controller, IMU pre‑integrator, etc.
  • Optimisers: Second‑order solvers (Gauss‑Newton, Levenberg‑Marquardt) plus strategies/schedulers for damping, trust‑region, and early‑stop handling.
  • Sparse Jacobian tracing (via psjac and sjac=True) enabling efficient bundle‑adjustment and pose‑graph optimisation on GPU.

Why it matters – Pure deep‑learning perception often struggles when the environment changes, while classic physics‑based optimisation is robust but hard to integrate with learned models. PyPose bridges the gap: you can embed differentiable Lie‑group operations inside a neural net, then refine the result with a second‑order optimiser that respects the underlying geometry.

Typical workflow

import torch, pypose as pp
# random SE(3) pose as a learnable parameter
pose = pp.Parameter(pp.randn_SE3())
# define a loss that uses the Lie‑group Log map
loss = (pose @ pp.randn_SE3()).Log().tensor().norm()
# optimise with Levenberg‑Marquardt
from pypose.optim import LM
opt = LM([pose], strategy=Constant(damping=1e-4))
opt.step(loss)

The example in the README shows a more complete case: a neural network whose output is a batch of SE(3) poses, refined by a LM optimiser, with optional sparse‑matrix solvers for large‑scale bundle adjustment.

Installation & docs – pip install pypose (or install from source after installing PyTorch). Full API docs, tutorials, and example scripts are hosted at https://pypose.org/docs.

Who should use it – Robotics researchers and engineers who need:

  • Differentiable pose representations.
  • Tight integration of perception networks with geometric optimisation.
  • High‑performance batch processing on CPU/GPU.
  • Classic state‑estimation filters that can be combined with learned components.

Citations – The library is accompanied by a CVPR 2023 paper and a 2026 IEEE‑T‑RO article on sparse bundle adjustment; users are asked to cite these when publishing results.

Related

  • Project
  • Project
  • Project
  • Project
  • Project