Giter VIP home page Giter VIP logo

mpc-cbf's Introduction

mpc-cbf

Model Predictive Control with discrete-time Control Barrier Functions (MPC-CBF) for a wheeled mobile robot.

The MPC-CBF optimization problem is given by:

$$\begin{aligned} \min_{u_{t: t+N-1 \mid 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\\\ \textrm{s.t.} \quad & x_{t+k+1 \mid t}=x_{t+k \mid t}+f\left(x_{t+k \mid t}, u_{t+k \mid t}\right) \cdot T_s, \quad k=0, . ., N-1,\\\ & x_{\min } \leq x_{t+k \mid t} \leq x_{\max }, \quad k=0, \ldots, N-1,\\\ & u_{\min } \leq u_{t+k \mid t} \leq u_{\max }, \quad k=0, \ldots, N-1, \\\ & x_{t \mid t}=x_t, \\\ & \Delta h\left(x_{t+k \mid t}, u_{t+k \mid t}\right) \geq-\gamma h\left(x_{t+k \mid t}\right), \quad k=0, \ldots, N-1 \\\ \end{aligned}$$

where $\tilde{x}_k=x_{des,k} - x_{k}$.

Results

Scenario 1

Path comparison for different values of γ for MPC-CBF and with MPC-DC


Path comparison

MPC-CBF


Robot path


Trajectories

Scenario 3


Robot path


CBF values

Scenario 4


Robot path


CBF values


Trajectories

Scenario 5


Robot path

Scenario 6


Robot path


CBF values

Gazebo simulation with turtlebot3

Installation

To use this project, install it locally via:

git clone https://github.com/elena-ecn/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:

python3 main.py

License

The contents of this repository are covered under the MIT License.

References

mpc-cbf's People

Contributors

elena-ecn avatar

Stargazers

Ahmad Hamdan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.