PyPose: A Library for Robot Learning with Physics-based Optimization
Abstract
Modern robotics often faces a disconnect between deep learning (DL) for perception and physics-based optimization for control and planning. PyPose is a PyTorch-based library designed to bridge this gap by integrating manifold-aware data structures and efficient second-order optimizers directly into the DL ecosystem. By leveraging quaternions for Lie groups and parallelized gradient computation, PyPose enables end-to-end differentiable robotic systems that are up to 40x faster than existing state-of-the-art Python libraries.
Introduction: Bridging the Divide
Robotics research is currently split between two paradigms: Deep Learning, which provides powerful perceptual capabilities but struggles with generalization, and Physics-based Optimization, which generalizes well through physical laws but often requires manual tuning and lacks semantic integration. Treating these as decoupled "black boxes" limits the potential for truly intelligent, adaptive robots. PyPose addresses this by making physics and optimization steps fully differentiable, allowing for joint training of perception and physical reasoning.
Technical Innovations
PyPose introduces several key features to enable efficient, manifold-aware computation:
- LieTensor: A specialized subclass of PyTorch Tensors for Lie groups (e.g., 3D rotations). It ensures numerical stability via Taylor expansions and uses quaternions to maintain efficiency on curved manifolds.
- Second-Order Optimizers: Implements methods like Levenberg-Marquardt (LM) natively in PyTorch, which are essential for the fast convergence required in geometric robotics problems.
- FastTriggs Corrector: A stable version of the Triggs correction for robust kernels, allowing optimizers to handle sensor outliers using only first-order derivatives.
- Parallelized Gradients: Utilizes PyTorch's
vmapto compute Jacobians in parallel, significantly reducing computation time for complex robotic models.
Experimental Evaluation
The library was benchmarked across diverse tasks including SLAM (TartanAir), planning (Matterport3D), and odometry (KITTI, EuRoC).
Key Results: Performance and Accuracy
PyPose demonstrates substantial performance gains over competitors like Theseus and LieTorch. It achieves up to 42.9x speedup on GPU and 37.9x on CPU for dense Jacobian calculations compared to the Theseus library.
Beyond raw speed, PyPose delivers tangible improvements in robotic task performance:
- SLAM Accuracy: Improved mean matching accuracy by over 43% in self-supervised SLAM tasks on the TartanAir dataset.
- Planning Efficiency: Planning policies were 3x faster than traditional frameworks.
- Optimization Performance: The LM optimizer reached convergence significantly faster than standard DL optimizers like Adam or SGD.
Discussion and Future Work
While PyPose offers a significant leap in performance for Python-based robotics libraries, it is still maturing. Current limitations include slightly lower performance compared to specialized C++ libraries like GTSAM for pure optimization and a lack of support for sparse block tensors. Future development will focus on these areas and expanding support for constrained optimization.
Summary updated