This tutorial provides a critical review of the practical application of Control Barrier Functions (CBFs) in robotic safety. While the theoretical foundations of CBFs are well-established, I identify a recurring gap between the mathematical assumption of a safe controller's existence and its constructive realization in systems with input constraints. I highlight the distinction between candidate and valid CBFs by analyzing the interplay of system dynamics, actuation limits, and class-K functions. I further show that some purported demonstrations of safe robot policies or controllers are limited to passively safe systems, such as single integrators or kinematic manipulators, where safety is already inherited from the underlying physics and even naive geometric hard constraints suffice to prevent collisions. By revisiting simple low-dimensional examples, I show when CBF formulations provide valid safety guarantees and when they fail due to common misuses. I then provide practical guidelines for constructing realizable safety arguments for systems without such passive safety. A crowd-navigation simulation study further illustrates that CBF-derived reward shaping in reinforcement learning can improve empirical behavior without establishing formal safety. The goal of this tutorial is to bridge the gap between theoretical guarantees and actual implementation, supported by an open-source interactive web demonstration that visualizes these concepts intuitively.
Figures & tables
Fig. 1: https://cbf.taekyung.me : interactive web demonstration of the CBF Playground. The demo contrasts passively safe (driftless) systems (single integrator, kinematic manipulator), for which naive geometric constraints already prevent collisions, and a system with inertia (double integrator), where feasibility depends on actuation limits, velocity bounds, and class- K tuning.
Fig. 2: Snapshots of simulation trials. Red circles are obstacles and the green cross is the goal. Interested readers may evaluate the simulation framework via the provided live web demo.
System / constraint family
Col. Rate
Inf. Rate
Single Integrator: CBF ( α∈{1,…,5} )
0%
0%
Single Integrator: Naive hard constraint
0%
0%
3-DOF Manipulator: CBF ( α∈{1,…,5} )
0%
0%
3-DOF Manipulator: Naive hard constraint
0%
0%
TABLE I: Passively safe systems (100 trials each)
vmax (m/s)
Col. Rate
Inf. Rate
1.0
87%
0%
2.0
91%
0%
3.0
93%
0%
4.0
90%
0%
5.0
88%
0%
TABLE II: Double integrator with naive hard constraint (100 trials each)
α1=α2
vmax=1
vmax=2
vmax=3
vmax=4
vmax=5
Col.
Inf.
Col.
Inf.
Col.
Inf.
Col.
Inf.
Col.
Inf.
1.0
0
0
0
0
0
0
0
0
0
0
2.0
0
0
0
0
0
0
0
0
0
0
3.0
0
0
31
0
33
4
32
6
30
5
4.0
17
0
68
1
68
4
63
5
60
8
5.0
50
1
80
1
82
2
77
2
74
7
TABLE III: Double integrator: collision rate (%) / infeasibility rate (%) for different HOCBF gains
Fig. 3: Empirical success and collision rates versus crowd size. Base and CBF-RL are evaluated with and without the same inference-time CBF-QP over 500 held-out episodes per setting; “obstacles” denotes active dynamic obstacles. Success and collision are independently recorded.
Fig. 4: https://cbf.taekyung.me : interactive crowd-navigation demo for comparing the four deployment conditions.
As the number of autonomous robots continues to grow, safety becomes increasingly important. Control barrier functions (CBFs) provide a theoretically grounded framework for ensuring safety, but existing design methods often face limitations in effectiveness, scalability, or interpretability, and may result in overly conservative safe sets. In this paper, we propose VertexCBF, a framework for learning neural CBFs in a scalable, systematic, and explainable way. We approximate the stationary Hamilton--Jacobi value function using a neural network trained via a combination of physics-informed and sparsely supervised learning. By exploiting control-affine dynamics and a convex polytope control set, under which the Hamiltonian is maximized at the control vertices, we efficiently generate supervision points via GPU-parallel vertex-restricted tree search, while a residual architecture guarantees that the learned CBF is never larger than the specified constraint function. We evaluate the method on 15 systems and compare it against relevant baselines, showing that it reliably recovers large safe sets where the baselines are conservative or fail completely. In addition, we perform a hardware experiment in which a mobile robot safely avoids pedestrians using a neural CBF trained with our method.
Bojan Derajić, Sebastian Bernhard, Wolfgang Hönig
Technical University of Berlin, Germany · AUMOVIO, Germany · Technical University of Applied Sciences Augsburg, Germany +1
Reinforcement learning (RL), while powerful and expressive, can often prioritize performance at the expense of safety. Yet safety violations can lead to catastrophic outcomes in real-world deployments. Control Barrier Functions (CBFs) offer a principled method to enforce dynamic safety -- traditionally deployed online via safety filters. While the result is safe behavior, the fact that the RL policy does not have knowledge of the CBF can lead to conservative behaviors. This paper proposes CBF-RL, a framework for generating safe behaviors with RL by enforcing CBFs in training. CBF-RL has two key attributes: (1) minimally modifying a nominal RL policy to encode safety constraints via a CBF term, (2) and safety filtering of the policy rollouts in training. Theoretically, we prove that continuous-time safety filters can be deployed via closed-form expressions on discrete-time roll-outs. Practically, we demonstrate that CBF-RL internalizes the safety constraints in the learned policy -- both enforcing safer actions and biasing towards safer rewards -- enabling safe deployment without the need for an online safety filter. We validate our framework through ablation studies on navigation tasks and on the Unitree G1 humanoid robot, where CBF-RL enables safer exploration, faster convergence, and robust performance under uncertainty, enabling the humanoid robot to avoid obstacles and climb stairs safely in real-world settings without a runtime safety filter.
Control Barrier Functions (CBFs) can provide provable safety guarantees for dynamic systems. However, finding a valid CBF for a system of interest is often non-trivial, especially for systems with low computational resources, higher-order dynamics, and moving close to obstacles of complex shape. A common solution to this problem is to use a purely distance-based CBF. In this paper, we study Hyperplane CBFs (H-CBFs), where a hyperplane separates the agent from the obstacle. First, we note that the common distance-based CBF is a special case of an H-CBF where the hyperplane is a supporting hyperplane of the obstacle that is orthogonal to a line between the agent and the closest point of the obstacle. We then show that a less conservative CBF can be found by optimising over the orientation of the supporting hyperplane, in order to find the Least Restrictive Hyperplane CBF. This enables us to maintain the safety guarantees while allowing controls that are closer to the desired ones, especially when moving fast and passing close to obstacles. We illustrate the approach on a double integrator dynamical system with acceleration constraints, moving through a group of arbitrarily shaped static and moving obstacles, and show that the proposed approach reduces the average gap between desired and safe controls by an order of magnitude.
Mattias Trende, Petter Ögren
The authors are with the Robotics, Perception and Learning Lab., School of Electrical Engineering and Computer Science, Royal Institute of Technology (KTH), SE-100 44 Stockholm, Sweden