SafeFlow: Safe Robot Motion Planning with Flow Matching via Control Barrier Functions
Xiaobing Dai, Zewen Yang, Dian Yu, Fangzhou Liu, Hamid Sadeghian, Sami Haddadin, Sandra Hirche
TL;DR
This work addresses the lack of formal safety guarantees in flow-based robot motion planning by introducing SafeFlow, a framework that couples flow matching with Flow Matching Barrier Functions (FMBF). SafeFlow augments the deterministic flow field with a minimal-norm safety term solved via a quadratic program to enforce safety constraints across the planning horizon, enabling training-free, real-time safety at test time. The authors extend to composite safety via Composite Flow Matching Barrier Functions (CFMBF) and a terminal safety filter to handle complex environments with multiple obstacles. Empirical evaluations on planar navigation and 7-DoF manipulation demonstrate that SafeFlow achieves provable safety (often 100%) while maintaining competitive distribution alignment and improved smoothness, outperforming state-of-the-art safety-aware generative planners. The results support SafeFlow as a practical, real-time, safety-guaranteed alternative for safe robotic motion planning in unseen and constrained environments.
Abstract
Recent advances in generative modeling have led to promising results in robot motion planning, particularly through diffusion and flow matching (FM)-based models that capture complex, multimodal trajectory distributions. However, these methods are typically trained offline and remain limited when faced with new environments with constraints, often lacking explicit mechanisms to ensure safety during deployment. In this work, safe flow matching (SafeFlow), a motion planning framework, is proposed for trajectory generation that integrates flow matching with safety guarantees. SafeFlow leverages our proposed flow matching barrier functions (FMBF) to ensure the planned trajectories remain within safe regions across the entire planning horizon. Crucially, our approach enables training-free, real-time safety enforcement at test time, eliminating the need for retraining. We evaluate SafeFlow on a diverse set of tasks, including planar robot navigation and 7-DoF manipulation, demonstrating superior safety and planning performance compared to state-of-the-art generative planners. Comprehensive resources are available on the project website: https://safeflowmatching.github.io.
