π KQ-LMPC is the fastest open-source Koopman MPC controller for quadrotors: zero training data, fully explainable, hardware-proven SE(3) control.
β‘ Real-time convex MPC (<10 ms) β’ β Stability guarantees β’ π§ PX4/ROS2 ready
kq_lmpc_quadrotor β A **hardware-ready Python package** for **Koopman-based Linear Model Predictive Control (LMPC)**. Built for **real-time flight**, powered by **analytical Koopman lifting** (no neural networks, no learning phase).
β First hardware-validated Koopman MPC on SE(3) β Convex QP (<10 ms solve time) via acados β PX4/ROS2/MAVSDK compatible : deploy to drones easily
|
|
|
β
Analytical Koopman lifting with generalizable observables
Β Β Β Β β No neural networks, no training, no data fitting required
β
Data-free Koopman-lifted LTI + LPV models
Β Β Β Β β Derived directly from SE(3) quadrotor dynamics using Lie algebra structure
β
Real-time Linear MPC (LMPC)
Β Β Β Β β Solved as a single convex QP termed KQ-LMPC
Β Β Β Β β < 10 ms solve time on Jetson NX / embedded hardware
β
Trajectory tracking on SE(3)
Β Β Β Β β Provable controllability in lifted Koopman space
β
Closed-loop robustness guarantees
Β Β Β Β β Input-to-state practical stability (I-ISpS)
β
Hardware-ready integration
Β Β Β Β β Works with PX4 Offboard Mode, ROS2, MAVSDK, MAVROS
β
Drop-in MPC module
Β Β Β Β β for both KQ-LMPC, NMPC with acados on Python.
Real-time control of agile aerial robots is still dominated by slow NMPC or black-box learning-based controllers. One is too computationally heavy, the other is unsafe without guarantees.
KQ-LMPC bridges this gap by enabling convex MPC for nonlinear quadrotor dynamics using Koopman operator theory. This means:
β
Real-time feasibility (<10 ms solve time)
β
Explainable, physics-grounded control
β
Robustness guarantees (I-ISpS)
β
Ready for PX4/ROS2 deployment
This work is based on:
Rajkumar, S.M., Yang, C., Gu, Y., Cheng, S., Hovakimyan, N. and Goswami, D., 2025. Real-Time Linear MPC for Quadrotors on SE (3): An Analytical Koopman-Based Realization. IEEE Robotics and Automation Letters, 10(12), pp.13018-13025.
[ArXiv] β’ [Video Demos]
If you use this repository, please cite us π
@article{rajkumar2025real,
title={Real-Time Linear MPC for Quadrotors on SE (3): An Analytical Koopman-Based Realization},
author={Rajkumar, Santosh Mohan and Yang, Chengyu and Gu, Yuliang and Cheng, Sheng and Hovakimyan, Naira and Goswami, Debdipta},
journal={IEEE Robotics and Automation Letters},
volume={10},
number={12},
pages={13018--13025},
year={2025},
publisher={Institute of Electrical and Electronics Engineers Inc.}
}*Virtual environment recommended
Install from PyPI (recommended):
pip install kq-lmpc-quadrotorInstall from source
git clone https://github.com/santoshrajkumar/kq-lmpc-quadrotor.git
cd kq-lmpc-quadrotor
pip install -e .from kq_lmpc_quadrotor import lqr_demo
lqr_demo()- This package relies on acados for fast Model Predictive Control (MPC).
- You must configure acados + Python interface before running MPC examples.
- Recommended that you install acados and configure, before installing the package if you are going to use MPC.
- Koopman Lifting and LQR will work without acados installation
- Quick Setup Checklist
- Install acados β
- Enable Python interface β
- Export
ACADOS_SOURCE_DIRβ - Set library paths:
- Linux:
LD_LIBRARY_PATH - macOS:
DYLD_LIBRARY_PATH
- Linux:
- π Install acados: https://docs.acados.org/installation/index.html
- π acados Python Interface: https://docs.acados.org/python_interface/index.html
- π» OS Support: Linux/macOS (Not tested on Windows)
from kq_lmpc_quadrotor import kqlmpc_demo
kqlmpc_demo()- Python 3.10 β’ Ubuntu 22.04 β’ AMD Ryzen 3 PRO CPU
- Metrics: Mean solve time (ΞΌβ), Worst-case solve time (tα΅₯), and Tracking RMSE (πβ).
- Prediction horizon Tβ β {0.8, 1.4, 2.0, 2.8} s across 4 tasks.
- 4 Benchmark Tasks:
- Task 1 : Follow a Line and Hover
- Task 2 : Follow a vertically moving helical path.
- Task 3 : Follow a lemniscate trajectory
- Task 4 : Follow a knot trajectory.
Tracking RMSE (m) comparison
- β 2β4Γ faster mean computation time than NMPC
- β Lower worst-case latency β more reliable for real-time flight
- β Competitive tracking accuracy
- β Scales efficiently with larger prediction horizons
π v2.0 (Coming Soon)
π§ Complete PX4 Offboard control pipeline for hardware
π§ Full Gazebo SITL + PX4 integration demos
π§ Flight-ready example configs
If you find this project useful, please β star the repo and follow β your support drives development!
