Perceptive CBF-RL: How Robots Learn to Dodge Balls with Safe, Sensor-Driven Obstacle Avoidance

Perceptive CBF-RL fuses sensor-driven safety constraints with RL so robots can dodge dynamic obstacles safely.
Perceptive CBF-RL is an open-source robot safety project that uses a dodgeball scenario to validate the fusion of Control Barrier Functions (CBF) and Reinforcement Learning (RL). CBF provides mathematically provable safety guarantees, while RL learns flexible motion policies. The key innovation is "perceptive" CBFs — safety constraints built directly from sensor inputs without requiring full prior environment knowledge — making the system far more practical for real-world deployment. Released as paper, code, and interactive demo, the project lowers the barrier to understanding Safe RL and has strong transfer potential for home robotics, industrial collaboration, and autonomous driving.
When Robots Learn to Dodge Flying Balls
Imagine this: a biped or wheeled robot stands in the middle of a field while balls fly at it from every direction. The robot must sense incoming threats in real time, predict their trajectories, and dodge them with agility — this is exactly what the Robot Dodgeball project demonstrates.
Recently, an open-source research project called Perceptive CBF-RL caught attention on Reddit. The authors not only published an interactive online demo (demo page), but also released the full paper, source code, and project homepage (project page). Anyone can try it hands-on or reproduce the entire safe obstacle avoidance system from scratch.

What looks like a fun game on the surface actually tackles one of the most critical questions in robotics: how can a robot remain agile and flexible in dynamic, unpredictable environments while never violating safety constraints?
Core Technology: Perceptive Control Barrier Functions (CBF) Explained
The Basics of Control Barrier Functions
Control Barrier Functions (CBF) are a fundamental mathematical tool in robot safety control. The core idea is to define a "safe set" for the system and use mathematical constraints to ensure the system state always remains within that set. No matter how the control policy is optimized, CBFs act as a "safety guardrail" — preventing the robot from crossing dangerous boundaries, such as colliding with obstacles or getting hit by a flying ball.
Traditional CBFs typically rely on precise environmental modeling and require prior knowledge of obstacle positions and motion states. But in a real dodgeball scenario, balls arrive dynamically and the robot cannot obtain complete information in advance.
The Key Innovation: Making CBFs Perceptive
The innovation in this project lies in the "Perceptive" prefix. It means the robot no longer depends on externally provided, complete environment state information. Instead, it directly constructs safety constraints from its own sensor inputs. The robot uses its perception system to capture the position and motion trends of incoming balls in real time, dynamically computing safe boundaries to make evasion decisions.
This end-to-end design — going straight from perception to safety constraints — is far closer to real-world deployment conditions, where robots typically only "see" partial, noisy observations rather than perfect global information.
Combining Reinforcement Learning with Safety Constraints
Why Pair RL with CBF?
The "RL" in the project name signals the integration of Reinforcement Learning. This combination reflects an important trend in robot control research: using RL to learn flexible, high-performance motion policies while using CBF to guarantee their safety.
Pure reinforcement learning can produce complex, agile behavior, but lacks safety guarantees — dangerous actions may emerge during training or deployment. Pure CBF approaches are safe but tend to be overly conservative, limiting the robot's motion performance. Combining the two is precisely about achieving both performance and safety — two goals that often conflict.
Dodgeball: The Ideal Testbed for Dynamic Obstacle Avoidance
The dodgeball task is well-suited for validating this approach because it inherently demands a balance between "agile movement" and "collision avoidance." Ball trajectories are random, speeds vary, and the robot must close the perception–decision–action loop in an extremely short time. This tests both the responsiveness of the RL policy and the reliability of CBF constraints under dynamic threats.
If a robot can stably avoid obstacles in such a highly dynamic, multi-directional threat environment, the approach's potential for transfer to more practical scenarios — navigating crowds, industrial collaboration, autonomous driving — is strongly validated.
Open Science: Interactive, Reproducible, Accessible
The project deserves credit for its fully open approach. Beyond publishing the paper and GitHub code, the authors created an interactive online demo that lets anyone play a round of robot dodgeball and intuitively experience the algorithm in action.
This "paper + code + interactive demo" release model is becoming a best practice in robotics and AI research. It lowers the barrier to understanding, turning abstract mathematical constraints and control policies into something tangible and verifiable. It also greatly enhances reproducibility and research impact.
For researchers, the open-source code provides a ready foundation for further development. For learners, the interactive demo is an ideal entry point for understanding safe reinforcement learning concepts. For enthusiasts, it's simply a fun and educational tech experience.
Significance and Future Applications
"Robot dodgeball" may look like a playful demo, but the Safe Reinforcement Learning (Safe RL) direction it represents is a necessary path toward deploying robots in human environments.
Future robots will need to operate in worlds filled with uncertainty and dynamic obstacles — whether in homes, hospitals, factories, or on city streets. They must complete tasks efficiently while ensuring the safety of themselves and the people around them. The combination of Perceptive CBF and reinforcement learning offers a technical pathway that is both theoretically grounded and practically feasible.
From dodging virtual balls flying from all directions to safely navigating complex real-world environments in the future — this open-source project may well be a small but meaningful step in that direction. Readers who are curious can visit the project page and experience firsthand what it feels like to dodge alongside a robot.
Related articles

Catalyst: A Vision for an Enzyme-Like Testing Framework for AI Agents
A developer shared Catalyst on Reddit, an Enzyme-inspired framework for AI Agents, exploring why agents need observable, testable dev tools and the design philosophy behind them.

The Real Capability of AI Coding Agents: Best Models Complete Only 35% of Feature Development Tasks
The 'Agents on Rails' benchmark finds top AI models complete only 35% of feature development tasks. What this means for coding agents and developer teams.

How to Prevent Duplicate Refunds After an AI Agent Crashes: CellaFlow's Durable Execution Approach
How can AI agents avoid duplicate refunds after a crash without deadlocking workflows? CellaFlow uses durable execution, shared work identity, leases, and fencing to solve safety and liveness in multi-agent systems.