This repository provides a Python implementation of the Model Predictive Coverage Control (MPCC) framework — a control strategy that enables a group of agents (e.g., robots or drones) to cooperatively cover an environment while optimizing for control effort and system dynamics. The implementation follows the structure and algorithms described in the paper:
Carron, A., & Zeilinger, M. N. (2020). Model Predictive Coverage Control. IFAC-PapersOnLine, 53(2), 6107–6112. https://doi.org/10.1016/j.ifacol.2020.12.1686
The paper presents a receding‐horizon (MPC) approach for multi‐agent coverage control that explicitly accounts for nonlinear agent dynamics and polytopic state and input constraints. It uses a tracking‐MPC formulation where each agent tracks the centroid of its Voronoi region, with a terminal cost and terminal set design that ensure convergence to a centroidal Voronoi configuration under certain assumptions.
The approach uses:
- Algorithm 1 - MPC Coverage Control: Computes optimal control inputs for all agents by solving an MPC problem that drives each agent toward the centroid of its Voronoi region while satisfying dynamic and constraint limits.
- Algorithm 2 - MPC with LQR Terminal Cost: Extends Algorithm 1 by incorporating an LQR-based terminal cost and terminal set, ensuring asymptotic convergence and closed-loop stability of the coverage configuration.
This implementation includes both algorithms for experimentation and comparison.
mpcc/
│
├── mpcc_code.py # Full monolithic version of the code (legacy/unorganized)
│
├── requirements.txt # List of required libraries
│
├── mpcc/ # Organized, modular implementation
│ ├── algorithm1_only.py # Implementation of Algorithm 1
│ ├── algorithm1_and_2.py # Implementation of both Algorithm 1 and Algorithm 2
│ ├── dynamic_model.py # Define your system dynamics here
│ ├── coverage_cost.py # Define the coverage cost here
│ ├── phi_uniform
│ └── ... (other helper files)
│
└── README.md # Project documentationgit clone https://github.com/OjasW/model-predictive-coverage-control.git
cd model-predictive-coverage-controlpip install -r requirements.txt # numpy, scipy, matplotlib, casadi, shapelyModify mpcc/dynamic_model.py to describe your system’s dynamics. You can also modify system parameters directly in the algorithm files
To run Algorithm 1 only:
python mpcc/algorithm1_only.pyTo run both Algorithm 1 and 2
python mpcc/algorithm1_and_2.py- mpcc_code.py is a single-file legacy version of the entire codebase.
- It contains the same logic but is not modular and not recommended for modification.
- The modular version inside the mpcc/ folder is cleaner and easier to extend.
- You can modify simulation parameters (like initial positions, weights Q and R, or horizon length N) directly inside the algorithm files.
- Ojas Wani - https://github.com/OjasW