Papers
Topics
Authors
Recent
Search
2000 character limit reached

Safer Trajectory Planning with CBF-guided Diffusion Model for Unmanned Aerial Vehicles

Published 19 Apr 2026 in cs.RO | (2604.17527v1)

Abstract: Safe and agile trajectory planning is essential for autonomous systems, especially during complex aerobatic maneuvers. Motivated by the recent success of diffusion models in generative tasks, this paper introduces AeroTrajGen, a novel framework for diffusion-based trajectory generation that incorporates control barrier function (CBF)-guided sampling during inference, specifically designed for unmanned aerial vehicles (UAVs). The proposed CBF-guided sampling addresses two critical challenges: (1) mitigating the inherent unpredictability and potential safety violations of diffusion models, and (2) reducing reliance on extensively safety-verified training data. During the reverse diffusion process, CBF-based guidance ensures collision-free trajectories by seamlessly integrating safety constraint gradients with the diffusion model's score function. The model features an obstacle-aware diffusion transformer architecture with multi-modal conditioning, including trajectory history, obstacles, maneuver styles, and goal, enabling the generation of smooth, highly agile trajectories across 14 distinct aerobatic maneuvers. Trained on a dataset of 2,000 expert demonstrations, AeroTrajGen is rigorously evaluated in simulation under multi-obstacle environments. Simulation results demonstrate that CBF-guided sampling reduces collision rates by 94.7% compared to unguided diffusion baselines, while preserving trajectory agility and diversity. Our code is open-sourced at https://github.com/RoboticsPolyu/CBF-DMP.

Summary

  • 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

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

Figure 2: Comparison of various safety probability functions for ฯƒ=0.5\sigma=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:

  • Collision rate reduction: The CBF-guided method achieves a 94.7% reduction in collision rate relative to unguided baselines. Using the logistic function with strong guidance (ฮณ=4000\gamma=4000) resulted in 0% collision rate, even in challenging multi-obstacle scenarios.
  • Safetyโ€“accuracy trade-off: Stronger guidance increases mean absolute error (trajectory deviation) while eradicating collisions. More moderate guidance yields the best balance between trajectory precision and safety, particularly in conjunction with the obstacle encoder. Figure 3

    Figure 3: Modulation of guidance strength during reverse diffusion, demonstrating the time-dependent application of safety enforcement.

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

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.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.