Skip to content

joonlee16/combinatorial_cbf

Repository files navigation

Combinatorial Control Barrier Functions (CBFs)

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.

Features

  • 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.

In this repo,

You will find a simulation implementation of a mutli-agent patrolling problem, where 11 agents are to patrol around two L-shaped regions $L_1$ and $L_2$. To ensure robust monitoring against sensor errors, agent failures, and other uncertainties, we require at least four agents to remain within each region $L_1$ and $L_2$ at all times. We encode this requirement using combinatorial CBFs. This allows at most three agents to be outside both regions simultaneously.

Inside the repo,

  • config.py - Contains simulation parameters such as agent count, desired trajectories, and region definitions
  • multi_agent_patrol_main.py - Main script to run the multi-agent patrolling simulation
  • controller.py - Initializes and constructs the CBF-QP controller
  • L-shape.py - Defines and implements the L-shaped regions
  • simulation.py - Script for executing the multi-agent patrolling simulation
  • helper.py - Utilities for animation, visualization, and plotting of simulation results
  • requirements.txt - Lists all Python dependencies needed to run the code

How to Use

  • Install the dependencies: pip install -r requirements.txt
  • Run multi_agent_patrol_main.py

Simulation Animation

sim_animation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages