The development of robotics is always closely related to mathematics. However, pure mathematical expressions can sometimes be boring and difficult to understand. This project aims to show the magic of mathematics through interesting robotics demonstrations.
We aim to select widely used and practical algorithms. For each algorithm, we strive to:
- Provide a readable Python implementation.
- Show a detailed mathematical proof.
- Minimize the use of third-party libraries to reveal the underlying mathematics.
- Install
libsuitesparse-devif you want to use the sparse solver.
sudo apt-get install -y libsuitesparse-dev- Install
mathR(this repository):
git clone https://github.com/scomup/MathematicalRobotics.git
cd MathematicalRobotics
pip3 install -e .Alternatively, install mathR directly from the git URL:
pip install -e git+https://github.com/scomup/MathematicalRobotics.git#egg=mathRThe Gauss-Newton method is a numerical optimization technique that is especially effective for solving non-linear least squares problems. We have implemented a pure Python library for this method.
Documentation Links:
We also provide some demos on Lie-group-based point matching using our library.
Lie Group Documentation Links:
python3 -m mathR.gauss_newton_method.demo_2dpython3 -m mathR.gauss_newton_method.demo_3dpython3 -m mathR.gauss_newton_method.demo_lineWe have developed a graph optimization library implemented in pure Python. Compared to well-known graph optimization libraries like g2o, gtsam, or ceres, our implementation is highly readable and ideal for studying purposes.
This demo solves a 2D point matching problem using the Gauss-Newton method.
python3 -m mathR.graph_optimization.demo_g2o_se2Dataset: sphere2500.g2o 1

This demo showcases the application of Gauss-Newton in 3D point matching problems.
python3 -m mathR.graph_optimization.demo_g2o_se3Dataset: manhattanOlson3500.g2o 1

This demo illustrates how the Gauss-Newton method can be applied to solve a simple linear regression problem
python3 -m mathR.gauss_newton_method.demo_lineFiltering techniques, such as the Extended Kalman Filter (EKF) and Particle Filter (PF), are essential tools in robotics for state estimation in the presence of noise and uncertainty.
Documentation Links:
This demo illustrates how the EKF can be used for GPS and odometry fuse problem.
python3 -m mathR.filter.demo_ekfThis demo illustrates how the PF can be used for GPS and odometry fuse problem.
python3 -m mathR.filter.demo_pfpython3 -m mathR.slam.demo_bundle_adjustmentDataset: Venice: problem-427-310384-pre 2
python3 -m mathR.robot_geometry.demo_p2line_matchingpython3 -m mathR.robot_geometry.demo_p2plane_matchingpython3 -m mathR.robot_geometry.demo_plane_cross_cubeFootnotes
-
Datasets are available in the open-source package Vertigo. ↩ ↩2
-
The datasets used in the demo are available in the project Bundle Adjustment in the Large. ↩







