Code for paper "Safety-Critical Control and Planning for Obstacle Avoidance between Polytopes with Control Barrier Functions"

Abstract: Obstacle avoidance between polytopes is a challenging topic for optimal control and optimization-based trajectory planning problems. Existing work either solves this problem through mixed-integer optimization, relying on simplification of system dynamics, or through model predictive control with dual variables using distance constraints, requiring long horizons for obstacle avoidance. In either case, the solution can only be applied as an offline planning algorithm. In this paper, we exploit the property that a smaller horizon is sufficient for obstacle avoidance by using discrete-time control barrier function (DCBF) constraints and we propose a novel optimization formulation with dual variables based on DCBFs to generate a collision-free dynamically-feasible trajectory. The proposed optimization formulation has lower computational complexity compared to existing work and can be used as a fast online algorithm for control and planning for general nonlinear dynamical systems. We validate our algorithm on different robot shapes using numerical simulations with a kinematic bicycle model, resulting in successful navigation through maze environments with polytopic obstacles.


This repo serves as a toolkit for testing different algorithm for control barrier functions.

Status: This repository is still under development, expecting new features/papers and a complete tutorial to explain it. Feel free to raise questions/suggestions through GitHub Issues, if you want to use the current version of this repository. Please watch and star for subscribing further updates which will be related to our latest preprints and published papers.


If you find this repository useful in your work, please consider citing following work:

  title={Safety-Critical Control and Planning for Obstacle Avoidance between Polytopes with Control Barrier Functions},
  author={Thirugnanam, Akshay and Zeng, Jun and Sreenath, Koushil},
  booktitle={2022 IEEE International Conference on Robotics and Automation (ICRA)},


  • Create your environment via conda env create -f environment.yml. The default conda environment name is cbf, and you could also choose that name with your own preferences by editing the .yml file.

Maze navigation with duality-based obstacle avoidance

This represents the implementation of the following paper:

  • A. Thirugnanam, J. Zeng, K. Sreenath. "Safety-Critical Control and Planning for Obstacle Avoidance between Polytopes with Control Barrier Functions." 2022 IEEE International Conference on Robotics and Automation (ICRA). [arXiv] [Video]

Run python models/ This simulates maze navigation (two maze setups) with duality-based obstacle avoidance (four robot shapes including rectangle, pentagon, triangle and l-shape) in the discrete-time domain. The animations and snapshots can be found in folder animations and figures. An example animation video can be generated as follows,



Jun Zeng, Akshay Thirugnanam.

Download Source Code

Download ZIP

Paper Preview

Aug 21, 2022