- The paper presents AeroTrajGen, a diffusion-based framework that integrates CBF safety constraints directly into UAV trajectory planning.
- It employs an obstacle-aware transformer trained on 2,000 expert demonstrations, achieving up to a 94.7% reduction in collision rates.
- The framework generates 14 aerobatic styles with a tunable safetyโaccuracy trade-off, ensuring zero collisions under strong CBF guidance.
CBF-Guided Diffusion for Safe UAV Trajectory Generation
Introduction
This paper presents AeroTrajGen, a diffusion-based trajectory planning framework that incorporates control barrier function (CBF) guidance during inference for unmanned aerial vehicles (UAVs). The motivation stems from the unreliability of conventional generative diffusion models in safety-critical domainsโparticularly their propensity to produce trajectories that violate safety constraints, such as collision-free guarantees in complex environments. AeroTrajGen addresses these deficiencies by integrating formal CBF-based safety constraints directly into the generative process, thereby drastically reducing collision rates while preserving maneuver complexity and trajectory diversity.
Methodology
The core of AeroTrajGen is an obstacle-aware diffusion transformer trained on 2,000 expert UAV maneuver demonstrations spanning 14 aerobatic styles. The model accepts four key modalities: historical trajectory, obstacle context, maneuver style, and target waypoint.
During inference, the generative trajectory is produced by a reverse denoising process. Critically, the reverse SDE is modified with an additional gradient term derived from a CBF-based safety criterion. This guidance steers sampling away from unsafe state regions by incorporating the gradient of a formal probability of safetyโoperationalized via three candidate functions (exponential barrier, normal CDF, and logistic) for the safety probability. The authors favor the logistic function for its balance of computational efficiency and smoothness.
Figure 1: The AeroTrajGen framework. Training learns from expert data; inference integrates CBF-based safety guidance into the diffusion process for generating safe trajectories.
The model architecture employs a transformer decoder with causal masking and an attention-based obstacle encoder. The multi-component loss balances trajectory reconstruction accuracy, obstacle avoidance, continuity, and acceleration smoothness.
CBF-guided sampling is operationalized via discrete-time updates: the safety gradient is computed for the predicted noise, and guidance strength is dynamically modulated to prioritize safety in early diffusion steps and allow for trajectory detail refinement in later steps. This enables the model to maintain high agility and trajectory fidelity while ensuring formal satisfaction of collision constraints.
Analysis of Safety Probability Functions
To implement the CBF-guided gradient, three formulations for the safety probability function were considered:
- Exponential Barrier: Fast, but not smooth or probabilistic.
- Normal CDF: Probabilistic and smooth, but computationally intensive.
- Logistic (Sigmoid): Smooth, computationally efficient, and with a practical probabilistic interpretation.
Experimental analysis showed that the logistic barrier delivers the best tradeoff for high-frequency online sampling, especially when barrier functions must be evaluated many times per diffusion step.
Figure 2: Comparison of various safety probability functions for ฯ=0.5. The logistic function balances smoothness and computational tractability.
Effect of CBF Guidance
Empirical evaluation in simulation environments with 3โ5 randomly placed spherical obstacles demonstrates the following:
Maneuver Diversity and Qualitative Trajectory Evaluation
AeroTrajGen successfully generates all 14 aerobatic maneuver styles while maintaining zero collision rates with robust CBF guidance. The system accommodates highly dynamic, multimodal maneuver requirementsโa critical capability for agile UAV navigation.
Figure 4: Examples of safe trajectory generation. Green: CBF-guided (no collision), red: unguided (collision), magenta: ground truth. Obstacles are red spheres.
Practical and Theoretical Implications
The integration of formal CBF constraints into diffusion-based generative modeling establishes a new pathway for safe, agile trajectory planning in robotics. Unlike approaches that enforce safety post hoc or require costly retraining with additional safety-verified data, this method embeds safety guarantees directly into the generation process, providing online, adaptive, and provable constraint adherence.
The trade-off between agility, precision, and conservativeness can be tuned via guidance strength and safety function selection. Although current results assume static, spherical obstacles with known geometry, the underlying CBF machinery can be extended to non-convex (potentially learned) barriers, partially observed settings, or moving obstacles given a more general CBF representation.
Limitations include lower style accuracy and trajectory smoothness under maximal safety enforcementโindicative of regularization pressures imposed by strong barrier guidance. Further, the system currently relies on extensive expert demonstrations for each maneuver; zero- or few-shot generalization to novel styles remains a challenge.
Future Directions
Opportunities for future research include:
- Generalizing CBF-guided diffusion to non-spherical, dynamic, or partially observable obstacle fields.
- Adaptive tuning of constraint weighting, possibly using risk-sensitive or dynamic guidance schedules tailored to task criticality.
- Extending to multi-agent scenarios with coupled safety constraints.
- Fusing perception-driven uncertainty propagation into the safety probability formulation for operation in open-world environments.
Conclusion
AeroTrajGen demonstrates that integrating control barrier functions into the diffusion-based generative trajectory planning process can drastically reduce collision rates for UAVs without sacrificing maneuver diversity or requiring restrictive, safety-verified training datasets. The CBF-guided approach offers a unified, practical, and theoretically sound solution to the primary bottleneck preventing diffusion models from safe deployment in robotics, particularly in challenging, high-dimensional, safety-critical flight regimes. Future work will investigate extensions to dynamic, uncertain, and interactive environments, closing the gap between expressive generation and formal safety in AI-guided robotics.