We propose a control framework which unifies the model predictive control and control barrier functions, where terminal cost function serves as control Lyapunov functions for stability. This is the reference implementation of our paper:
The 2D double integrator is assigned to reach the target position at origin while avoiding obstacles. We have three classes for different controllers: `DCLF_DCBF.m` (DCLF-DCBF), `MPC_CBF.m` (MPC-CBF) and `MPC_DC` (MPC-DC), respectively.
Moreover, to illustrate the performance among them, we have:
*`main.m`: Run DCLF-DCBF/MPC-CBF/MPC-DC respectively.
*`analysis_gamma.m`: Run analysis for different hyperparameter $\gamma$.
*`analysis_horizon.m`: Run analysis for different horizon.
We illustrate the performance between DCLF-DCBF/MPC-DC/MPC-CBF
We also provide the zipped version of precompiled .mex files for IPOPT in the folder `packages` in case you don't have it. Unzip that file and add those .mex files into your MATLAB path.