PyPose: A Library for Robot Learning with Physics-based Optimization

Chen Wang, Dasong Gao, Kuan Xu, Junyi Geng, Yaoyu Hu, Yuheng Qiu, Bowen Li, Fan Yang, Brady G. Moon, Abhinav Pandey, Aryan, Jiahe Xu, Tianhao Wu, Haonan He, Daning Huang, Zhongqiang Ren, Shibo Zhao, Taimeng Fu, Pranay Reddy, Xiao Lin, Wenshan Wang, Jingnan Shi, Rajat Talak, Kun Cao, Yi Du, Han Wang, Huai Yu, Shanzhao Wang, Siyu Chen, Ananth Kashyap, Rohan Bandaru, Karthik Dantu, Jiajun Wu, Lihua Xie, Luca Carlone, Marco Hutter, Sebastian A. SchererCVPR 2022

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:

  1. 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.
  2. Second-Order Optimizers: Implements methods like Levenberg-Marquardt (LM) natively in PyTorch, which are essential for the fast convergence required in geometric robotics problems.
  3. FastTriggs Corrector: A stable version of the Triggs correction for robust kernels, allowing optimizers to handle sensor outliers using only first-order derivatives.
  4. Parallelized Gradients: Utilizes PyTorch's vmap to 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.

GPU performance comparison showing PyPose achieving significant speedups for Lie group operations.

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.
CPU performance comparison illustrating PyPose's efficiency in handling complex geometric functions.

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

BibTeX
@inproceedings{wang2022pypose,
  author = {Chen Wang and Dasong Gao and Kuan Xu and Junyi Geng and Yaoyu Hu and Yuheng Qiu and Bowen Li and Fan Yang and Brady G. Moon and Abhinav Pandey and Aryan and Jiahe Xu and Tianhao Wu and Haonan He and Daning Huang and Zhongqiang Ren and Shibo Zhao and Taimeng Fu and Pranay Reddy and Xiao Lin and Wenshan Wang and Jingnan Shi and Rajat Talak and Kun Cao and Yi Du and Han Wang and Huai Yu and Shanzhao Wang and Siyu Chen and Ananth Kashyap and Rohan Bandaru and Karthik Dantu and Jiajun Wu and Lihua Xie and Luca Carlone and Marco Hutter and Sebastian A. Scherer},
  title = {{PyPose: A Library for Robot Learning with Physics-based Optimization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  url = {https://openreview.net/forum?id=1Li-iPiWgR},
}
Figure