Model Predictive Control with discrete-time Control Barrier Functions
The MPC-CBF optimization problem is given by:
$$
\begin{aligned}
\min_{u_{t:t+N-1|t}} \quad & \frac{1}{2} \tilde{x}_N^T Q_x \tilde{x}_N+\sum_{k=0}^{N-1} \frac{1}{2} \tilde{x}_k^T Q_x \tilde{x}_k+\frac{1}{2} u_k^T Q_u u_k\\
\text{s.t.} \quad
& x_{t+k+1|t}=x_{t+k|t}+f\left(x_{t+k|t}, u_{t+k|t}\right) \cdot T_s, \quad k=0, \ldots, N-1,\\
& x_{\min} \leq x_{t+k|t} \leq x_{\max}, \quad k=0, \ldots, N-1,\\
& u_{\min} \leq u_{t+k|t} \leq u_{\max}, \quad k=0, \ldots, N-1, \\
& x_{t|t}=x_t, \\
& \Delta h\left(x_{t+k|t}, u_{t+k|t}\right) \geq-\gamma h\left(x_{t+k|t}\right), \quad k=0, \ldots, N-1 \\
\end{aligned}
$$
where
$$
\tilde{x}k=x {des,k} - x_{k}
$$
Gazebo simulation with turtlebot3
To use this project, install it locally via:
git clone https://github.com/phatcvo/MPC-CBF.git
The dependencies can be installed by running:
pip install -r requirements.txt
The controller configuration can be changed through the config.py .
To execute the code, run: