Control Barrier Functions (CBFs) are a powerful tool for ensuring robotic safety, but designing or learning valid CBFs for complex systems is a significant challenge. While Hamilton-Jacobi Reachability provides a formal method for synthesizing safe value functions, it scales poorly and is typically performed offline, limiting its applicability in dynamic environments. This paper bridges the gap between offline synthesis and online adaptation. We introduce refineCBF for refining an approximate CBF - whether analytically derived, learned, or even unsafe - via warm-started HJ reachability. We then present its computationally efficient successor, HJ-Patch, which accelerates this process through localized updates. Both methods guarantee the recovery of a safe value function and can ensure monotonic safety improvements during adaptation. Our experiments validate our framework's primary contribution: in-the-loop, real-time adaptation, in simulation (with detailed value function analysis) and on physical hardware. Our experiments on ground vehicles and quadcopters show that our framework can successfully adapt to sudden environmental changes, such as new obstacles and unmodeled wind disturbances, providing a practical path toward deploying formally guaranteed safety in real-world settings.
Figures & tables
Characterizes safety: H∩L=∅
Characterizes control invariance: ( 5 ) ∀x
Non-intrusive safety filter
Invalid CBF
✓
✗
✓ /\penalty ✗
Unsafe CBF
✗
✓
✓
Conservative (safe) CBF
✓
✓
✗
Desired (safe) CBF
✓
✓
✓
TABLE I : The 4 possible categories of CBFs and their properties.
Fig. 1 : Comparison of converged value functions for refineCBF , HJ-Patch , HJR, and jointCBF at a fixed robot orientation (see arrow) and velocity ( v=1.0 m/s) slice. (Left) The 0-level sets show that naively combining constraints (jointCBF) incorrectly merges the safe sets, creating an unsafe region between the obstacles. HJ-Patch and refineCBF both produce safe, comparable boundaries compared to the HJR baseline. (Right) The difference plots highlight that HJ-Patch ’s value function is a close match to the HJR solution, while refineCBF is more conservative (negative differences) and jointCBF is dangerously optimistic (large positive differences).
Fig. 2 : Online performance with limited-range obstacle detection. These plots show system behavior across 10 simulation rollouts where obstacles are discovered online. (Left) shows the trajectories for all methods (with dotted lines for trajectories post collision) for multiple rollouts. We additionally visualize the detection points based on the limited range of the sensor. (Right) visualizes the value function (with the safety boundary). These rollouts demonstrate the need for refinement, as HJR and jointCBF lead to collision. Additionally, when a GPU is not available, HJ-Patch ’s computational efficiency enables patching rapidly to provide safety, whereas refineCBF (CPU) fails.
refineCBF
refineCBF (CPU)
HJ-Patch (CPU)
jointCBFs
HJR
0/10
5/5
1/10
5/5
5/5
TABLE II : Quantiative measure ( ↓ better) of number of collisions of jackal simulation experiments for online adaptation. Experiments that constantly lead to collisions are only executed 5 times. These measures highlight the benefits of refineCBF and HJ-Patch .
Fig. 3 : Online adaptation and deadlock avoidance in a quadcopter navigation task. The quadcopter must navigate to a goal in a region initially occluded by an obstacle. (Left) Trajectories show refineCBF successfully discovering a path over the obstacle, progressively incorporating the newly seen free space (yellow) into the safe set, then iteratively incorporating this new information into its safe set. In contrast, the backupCBF method gets stuck in a deadlock, unable to find a path to the goal with its fixed backup policy. (Right) The value function confirms this behavior. refineCBF ’s value dips as it navigates the obstacle and unseen space boundary, and then recovers as the safe set expands. The backupCBF value drops and oscillates near the safety boundary (value=0), indicating a persistent deadlock. Further analysis on why refineCBF avoids deadlock is provided in Fig. 10(a) .
Fig. 4 : A snapshot of the Jackal hardware experiment. The robot detects the suddenly fallen obstacle blocking its path. The top-right inset shows the robot’s internal map at the moment of detection; the safe set (green) has not yet been updated to incorporate the new SDF map (black), highlighting the need for rapid, in-the-loop replanning to ensure safety.
Fig. 5 : Trajectory comparison for the Jackal hardware experiment. These plots show time snapshots of the system’s trajectory after the environment is altered at t=3.0s . The fully adaptive refineCBF (blue) successfully backtracks to find a new, safe path. The non-adaptive baseline (refineCBF (no online detection), orange) operates on a stale map, leading directly to a collision with the new obstacle.
Fig. 6 : Quadcopter hardware experiment with a previously occluded obstacle. Snapshot of the physical setup where a quadcopter navigates towards its goal (green circle). The circular obstacle is initially hidden from view by the blue block. The bottom-right inset shows the constraint and safe set at the moment the new obstacle is first detected; the safe set (green) has not yet been updated, highlighting the challenge for the real-time safety filter.
Fig. 7 : Trajectories from 10 hardware trials comparing adaptive and non-adaptive refineCBF . The quadcopter must navigate an environment with an unexpected obstacle (light gray circle) that only becomes visible after clearing the first obstacle. The fully adaptive refineCBF (blue) successfully avoids the new obstacle in all 10 trials. The non-adaptive baseline (refineCBF (no online detection), orange), operating under the optimistic assumption that unseen space is free, collides in every trial.
Fig. 8 : Hardware experiment with unmodeled aerodynamic disturbances. A snapshot of the quadcopter navigating through a narrow passage containing a fan (wind visualized with yellow streamlines). While the geometry of the passage is known, the aerodynamic disturbance produced by the fan’s and its interaction with the environment is not and must be detected and compensated for in real time.
Fig. 9 : Trajectories from 10 hardware trials with a dynamic disturbance. The quadcopter encounters a strong wind disturbance while flying between the two known obstacles. The safety value function is initialized as a CBF centered at the starting position with a small initially safe region. The adaptive refineCBF , which incorporates real-time disturbance changes, successfully compensates and navigates the passage in 9/10 trials. The baseline controller (orange), which assumes nominal dynamics, fails in every trial, consistently being pushed into the wall by the unexpected disturbance.
Fig. 10 : Safe set across the position space evaluated at the current velocities (arrow and slice highlight the velocities). A broad range of value function initializations are presented (conservative SDF (top), optimistic SDF (center), and conservative CBF guess (bottom)), in addition to a broad range of online changes. refineCBF (or safeadapt-refineCBF ) succeeds in all scenarios, highlighting the diversity of scenarios where it can be deployed. In addition, all experiments highlight that encoding safety through a value function over all states, not just positional states, is required in dynamic scenarios to preserve safety and maintain performance.
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
Safe navigation of autonomous robots remains one of the core challenges in the field, especially in dynamic and uncertain environments. One prevalent approach is safety filtering based on control barrier functions (CBFs), which are easy to deploy but difficult to design. Motivated by the shortcomings of existing learning- and model-based methods, we propose a simple yet effective neural CBF design method for safe robot navigation in dynamic environments. We employ the idea of a composite CBF, where multiple neural CBFs are combined into a single CBF. Individual CBFs are trained using data generated offline via the Hamilton-Jacobi reachability framework to approximate the optimal safe set for single moving obstacles. Additionally, we use a residual neural architecture, ensuring that the estimated safe set does not intersect with the corresponding failure set. The method is extensively evaluated in simulation experiments for a ground robot and a quadrotor, comparing it against several baseline methods. The proposed method improves success rates by up to 18% over the strongest baseline, while maintaining comparable or lower path lengths and motion times. The method is also demonstrated in hardware experiments for both types of robots.
Bojan Derajić, Sebastian Bernhard, Wolfgang Hönig
Technical University of Berlin, Germany · AUMOVIO, Germany · Robotics Institute Germany (RIG), Germany
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.