This repository provides a simulation implementation of Combinatorial Control Barrier Functions (CBFs) for enforcing logical and combinatorial safety constraints in control systems. The framework generalizes traditional AND/OR compositions and addresses p-choose-r safety, where at least r out of p safety conditions must hold. It also allows enforcement of nested safety requirements without suffering from a blow-up in the number of combinations of safety constraints to consider. Furthermore, our approach allows the system to operate on the exact safe set without introducing any conservatism through smooth approximation.
- Enforces p-choose-r safety requirements using exactly p constraints, where at least r out of p safety requirements must hold.
- Handles hierarchical logical safety specifications without increasing the number of constraints
- Uses the true safe set defined by the combinatorial logic, avoiding conservative approximations like softmin/softmax.
You will find a simulation implementation of a mutli-agent patrolling problem, where 11 agents are to patrol around two L-shaped regions
config.py- Contains simulation parameters such as agent count, desired trajectories, and region definitionsmulti_agent_patrol_main.py- Main script to run the multi-agent patrolling simulationcontroller.py- Initializes and constructs the CBF-QP controllerL-shape.py- Defines and implements the L-shaped regionssimulation.py- Script for executing the multi-agent patrolling simulationhelper.py- Utilities for animation, visualization, and plotting of simulation resultsrequirements.txt- Lists all Python dependencies needed to run the code
- Install the dependencies:
pip install -r requirements.txt - Run
multi_agent_patrol_main.py
