Skip to content

About

From-scratch implementations of core robotics algorithms (state estimation, SLAM, planning, control, kinematics) in Python and C++17, with derivations and tests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 robotics-algorithms

From-scratch implementations of core robotics algorithms in Python and C++17

Derived, implemented, and validated, one algorithm at a time.

C++17 Python

Progress: 1/11 completed


About

This repository is a structured study of the algorithms behind robot state estimation, mapping, planning, and control. Each algorithm lives in its own folder and is built twice:

Role
🐍 Python Reference implementation, used to work out the math and iterate quickly
⚙️ C++17 + Eigen Engineering implementation, built with CMake

Both implementations run on the same scenario data file and are checked against each other, so the C++ version is verified rather than assumed correct.


Roadmap

Legend: ✅ Done · 🚧 In progress · ⬜ Planned

📍 Localization

Algorithm Python C++ Docs
Extended Kalman Filter ✅ ✅ ✅
Unscented Kalman Filter 🚧 ✅ ⬜
Particle Filter ⬜ ⬜ ⬜

🗺️ SLAM

Algorithm Python C++ Docs
Graph-Based SLAM ⬜ ⬜ ⬜

🧭 Path Planning

Algorithm Python C++ Docs
A* ⬜ ⬜ ⬜
Hybrid A* ⬜ ⬜ ⬜
RRT / RRT* ⬜ ⬜ ⬜

🎯 Path Tracking & Control

Algorithm Python C++ Docs
Pure Pursuit / Stanley ⬜ ⬜ ⬜
LQR ⬜ ⬜ ⬜
Model Predictive Control ⬜ ⬜ ⬜

🦾 Manipulation

Algorithm Python C++ Docs
Numerical IK (Damped Least Squares) ⬜ ⬜ ⬜

Learning path

flowchart LR
    EKF[EKF] --> UKF[UKF]
    UKF --> PF[Particle Filter]
    EKF --> GS[Graph SLAM]
    AS[A*] --> HA[Hybrid A*]
    AS --> RRT[RRT / RRT*]
    PP[Pure Pursuit / Stanley] --> LQR[LQR]
    LQR --> MPC[MPC]
    IK[Numerical IK]
Loading

Approach

Right now, an algorithm is marked ✅ when it meets:

  1. Python reference runs on the shared scenario data.
  2. C++ implementation matches the Python output within tolerance on the same data.
  3. Documentation covers the derivation, assumptions, and measured results.

Formal automated tests (finite-difference Jacobian checks, NEES/NIS consistency, etc.) are planned as a later phase across the whole repo, once the conceptual implementations are further along it is not required per-algorithm for now.

Design rules applied throughout:

  • Shared data files, not shared seeds. NumPy and C++ random generators produce different streams, so each scenario is generated once and saved as CSV for both languages to read.
  • Algorithm code stays pure. Filters, planners, and controllers contain no plotting or file I/O. Demos handle that separately.
  • Measured results only. Every number reported comes from a run I can reproduce.

📁 Repository Structure

Each algorithm is a self-contained study, organized by area:

Click to expand
robotics-algorithms/
├── README.md
├── requirements.txt
├── CMakeLists.txt              # builds every algorithm for CI
├── .github/workflows/ci.yml
└── localization/
    └── ekf/
        ├── README.md           # derivation, assumptions, results
        ├── data/               # shared scenario CSVs
        ├── img/                # result plots
        ├── python/
        │   ├── ekf.py          # algorithm only
        │   ├── demo.py         # load data, run, plot
        │   └── gen_data.py     # generates scenario data
        └── cpp/
            ├── CMakeLists.txt  # standalone project
            ├── ekf.hpp / ekf.cpp
            └── demo.cpp

References

  • Thrun, Burgard & Fox, Probabilistic Robotics: localization and SLAM
  • Lynch & Park, Modern Robotics: kinematics, inverse kinematics, and control
  • LaValle, Planning Algorithms: search and sampling-based planning

Acknowledgments

The choice of algorithms and the simulation scenarios are inspired by PythonRobotics by Atsushi Sakai (MIT License). The implementations here are written independently.

License

MIT © P Pranav

About

From-scratch implementations of core robotics algorithms (state estimation, SLAM, planning, control, kinematics) in Python and C++17, with derivations and tests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages