LeCAR-Lab / CoVO-MPC

Official implementation for the paper "CoVO-MPC: Theoretical Analysis of Sampling-based MPC and Optimal Covariance Design" accepted by L4DC 2024. CoVO-MPC is an optimal sampling-based MPC algorithm.
https://lecar-lab.github.io/CoVO-MPC/
Apache License 2.0
109 stars 7 forks source link
control drone mpc quadrotor sampling-methods zeroth-order-optimization

CoVO-MPC: CoVariance-Optimal MPC

[[Website]](https://lecar-lab.github.io/CoVO-MPC/) [[PDF]](https://drive.google.com/file/d/1u964n8BeQnZhwXpms7hJx8DNDYjwxTxy/view?usp=share_link) [[Arxiv]](https://arxiv.org/abs/2401.07369) [![Python Version](https://img.shields.io/badge/Python-3.10-blue.svg)](https://github.com/eureka-research/Eureka) [](https://github.com/google/jax) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Simulator | Hardware (Crazyflie) :-------------------------:|:-------------------------: ![output](https://github.com/LeCAR-Lab/CoVO-MPC/assets/60093981/50d11272-3a51-4ed5-b734-bca1b80a9ef5) | ![tracking_compare](https://github.com/LeCAR-Lab/CoVO-MPC/assets/60093981/b835403d-8f78-49e7-8ac7-d3b902429839)

:tada: News: CoVO-MPC is accepted by L4DC 2024.

Implementation of the novel sampling-based Model Predictive Control (MPC) algorithm, CoVariance-Optimal MPC (CoVO-MPC), developed through the research outlined in the associated paper. This new control algorithm is sought to outperform standard Model Predictive Path Integral Control (MPPI) by 43 to 54%.

Why CoVO-MPC?

Sampling-based MPC becomes prevalent in motion planning and model-based RL for its flexibility and parallizability. However, there is no convergence analysis to it, which leads to tune hyperparameters heuristically. For instance, MPPI use dynamic-agnostic isotropic Gaussian to sample trajectories, which leads to sub-optimal performance.

We first proves MPPI’s convergence and provide insights into optimal sampling covariance design. CoVO-MPC is proposed to optimize sampling covariance according to the optimization landscape to achieve optimal sampling distribution given certain dynamics.

MPPI CoVO-MPC
mppi_vis covo_vis

Installation

conda create -n jax python
conda activate jax
pip install -e .

Run CoVO-MPC

Run CoVO-MPC in the quadrotor environment (if you want to run other controllers, just replace covo-online with pid, mppi, etc. You can also change the task to tracking or hover):

cd quadjax/envs
# note: --noDR means no domain randomization, disable it if running a controller
python quadrotor.py --controller covo-online --task tracking_zigzag --mode render --disturb_type none --noDR 
# run CoVO-MPC offline approximation version
python quadrotor.py --controller covo-offline --task tracking_zigzag --mode render --disturb_type none --noDR 

This will generate tested state sequence state_seq.pkl and plot figure plot.png.

Reproduce the results in the CoVO-MPC paper:

cd quadjax/scripts
# main results
sh covo_quadrotor.sh
# ablation study for sampling number
sh covo_quadrotor_N.sh

Visualization

cd quadjax/scripts
python vis.py

This will visualize the results in quadjax/results/state_seq_.pkl with meshcat, which is generated by quadjax/envs/quadrotor.py.

Notes

Citation

If you find this repo useful for your research, please consider citing our paper:

@misc{yi2024covompc,
      title={CoVO-MPC: Theoretical Analysis of Sampling-based MPC and Optimal Covariance Design}, 
      author={Zeji Yi and Chaoyi Pan and Guanqi He and Guannan Qu and Guanya Shi},
      year={2024},
      eprint={2401.07369},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}