Verifying and synthesizing compatible Control Lyapunov Function (CLF) and Control Barrier Function (CBF) through Sum-of-Squares.
A quadrotor stabilized by our compatible CLF-CBF-QP controller, avoiding the ground obstacle, flying to the target from different initial states.
quadrotor_compatible_clf_cbf.mp4
- Verification and Synthesis of Compatible Control Lyapunov and Control Barrier Functions
Hongkai Dai*, Chuanrui Jiang*, Hongchao Zhang and Andrew Clark
IEEE Conference on Decision and Control (CDC), 2024
For a continuous-time control affine system
The Control Lyapunov Function (CLF)
where
The Control Barrier Function (CBF)
We say a CLF
We will certify and synthesize such compatible CLF and CBFs through Sum-of-Squares optimization.
Create a virtual environment.
$ python -m venv venv
$ source venv/bin/activate
Run
$ pip install -e .
to install the dependencies and the package. After the installation, please make sure that you can use Mosek solver. Please set the environment variable that points to the Mosek license as
export MOSEKLM_LICENSE_FILE=/path/to/mosek.lic
We formulate and solve the optimization problem using Drake. To get started with Drake, you can checkout its tutorials (on the Drake webpage, navigate to "Resources"->"Tutorials"). Drake hosts several tutorials on deepnote, and there is a section of tutorials on Mathematical Programming. You might want to pay special attention to "Sum-of-squares optimization" as we will use it in this project.
To maintain quality of the code, we suggest in each pull request, please do the followings
- Add unit tests. We use pytest framework.
- Format the code. You can run
to format each python code using
black ./
black
formatter.
Each pull request need to pass the CI before being merged. We also use reviewable to review the code.