ACE Journal

Safe Exploration via Control Barrier Functions for Legged Robots

Abstract

Legged robots operating in unstructured environments need to explore terrain whose properties - slope, friction coefficient, step height - are not known in advance. Reinforcement learning agents trained entirely in simulation may handle nominal terrain well but fail catastrophically when they encounter conditions that push the robot toward a fall. Control barrier functions (CBFs) provide a formal mechanism for constraining exploration within a certified safe set, ensuring that the robot’s state never violates hard limits on lean angle, support polygon margin, or joint velocity - even when the learning-derived controller is uncertain about what to do. The combination of learned locomotion policies with CBF-based safety filters is an increasingly active approach to deploying legged robots in unfamiliar real-world conditions.

Control Barrier Functions - Formal Background

A control barrier function h(x) assigns a scalar value to each robot state x such that h(x) greater than or equal to 0 defines the safe set. The CBF condition requires that the time derivative of h along any feasible trajectory remain non-negative when h approaches zero - that is, the controller must always point the system back toward the safe interior when the boundary is near. When the robot dynamics are affine in the control input, enforcing the CBF condition reduces to a convex constraint that can be incorporated into a quadratic program (QP) solved in real time.

Ames and colleagues at Caltech have developed the CBF-QP framework systematically over the past decade, and the legged locomotion community has adopted it primarily for adding safety constraints on top of model predictive control (MPC) and reinforcement learning policies. The key appeal is modularity: the safety filter sits between the nominal controller’s output and the actuator commands, minimally modifying the commanded action to satisfy the CBF constraint rather than re-solving the full planning problem.

Defining Safe Sets for Legged Systems

Choosing appropriate barrier functions for quadrupeds and bipeds is non-trivial because safety in legged locomotion is multi-dimensional and dynamically coupled. Relevant safe sets include bounds on the angular momentum of the torso (preventing tipping), constraints on foot placement relative to measured step geometry, and limits on joint torques that prevent hardware damage.

Research from MIT’s Biomimetic Robotics Lab has explored composite barrier functions that combine individual constraints multiplicatively, ensuring that the intersection of multiple safe sets is handled correctly even when constraints are conflicting at the boundary. Their work on the Mini Cheetah platform demonstrated real-time CBF enforcement at 1 kHz joint control rates on hardware, covering stair descent and sloped surface traversal with terrain properties estimated on-the-fly via a proprioceptive terrain estimator.

Integration with Learned Locomotion Policies

The most studied deployment pattern pairs a pre-trained locomotion policy - often trained via curriculum RL in IsaacGym or MuJoCo - with a CBF safety filter that corrects actions at runtime. The policy is allowed to explore novel terrain, including configurations it may not have seen during training, while the CBF filter guarantees that no explored action causes the robot to leave the safe set.

A practical complication is that the CBF requires a dynamics model, and real legged systems have uncertain dynamics - foot contact timing, ground compliance, and actuator friction all deviate from simulation. Adaptive CBF methods that update the barrier function’s parameters in response to observed prediction error are an active research direction, with results from Stanford and from the Swiss AI Lab IDSIA showing that adaptive filters maintain safety guarantees under model uncertainty without being overly conservative on terrain that the nominal model predicts well.

Remaining Open Problems

Compositional safety - certifying safety when multiple robots share the same space and their safe sets interact - is largely unsolved for high-DoF legged systems. The computational cost of the QP scales with the number of active constraints, and dense constraint sets from terrain mapping can strain real-time solve budgets. Hardware-accelerated QP solvers such as OSQP running on FPGA fabric are being evaluated as one route to higher constraint counts without sacrificing update rate.