---
title: 'AeroTrajGen: Diffusion UAV Trajectory Planning'
url: https://www.emergentmind.com/topics/aerotrajgen
type: topic
---

# AeroTrajGen: Diffusion UAV Trajectory Planning

AeroTrajGen is a diffusion-based trajectory generation framework for unmanned aerial vehicles that combines an obstacle-aware diffusion transformer with control barrier function-guided sampling to generate safe, smooth, and highly agile trajectories for aerobatic flight in cluttered environments [2604.17527]. It is presented as a hybrid learned planning and generation method: a conditional diffusion model learns a distribution over expert trajectories, while inference is shaped online by safety gradients derived from control barrier functions. The framework is conditioned on trajectory history, target waypoint, maneuver style, and obstacle information, and is evaluated in simulation rather than as a fully certified closed-loop flight system [2604.17527].

## 1. Operational setting and scope

AeroTrajGen is formulated for a hard version of UAV trajectory planning in which a vehicle must generate future trajectories for complex aerobatic maneuvers while avoiding obstacles and preserving maneuver richness. The motivating claim is that aerobatic motion is strongly multimodal: for a given history, goal, and maneuver command, there are many plausible futures, including aggressive attitude changes, loops, and style-specific geometric patterns. The paper positions classical planners and trajectory optimizers as effective at constraint enforcement but limited in modeling high-dimensional multimodality, while unconstrained generative models are described as unsafe in safety-critical settings because they may collide with obstacles or behave unpredictably under distribution shift [2604.17527].

The framework is intended for conditional online generation from recent state history, a target waypoint, a maneuver command, and obstacle geometry. The paper does not present a receding-horizon closed-loop replanning stack in detail, but it states that the model is meant to generate trajectories online given current history, target, maneuver, and obstacles. Its experiments are conducted in simulated multi-obstacle environments with static spherical obstacles, so the demonstrated scope is short-horizon UAV trajectory generation under known obstacle geometry rather than air-traffic-scale trajectory synthesis or certified flight management [2604.17527].

The maneuver vocabulary is discrete and explicit. The 14 listed maneuver classes are power loop, barrel roll, split S, Immelmann, wall ride, figure eight, star, half moon, sphinx, clover, spiral inward, spiral outward, spiral vertical up, and spiral vertical down. Maneuver style is encoded categorically and used as a conditioning signal rather than inferred implicitly from data [2604.17527].

## 2. Trajectory representation and conditional architecture

The generated object is a trajectory sequence
$$
\mathbf{x}\in\mathbb{R}^{N\times D},
$$
with the architecture description using \(N=80\) and \(D=10\), corresponding to 8 seconds at 10 Hz and a 10-dimensional state per timestep described as speed, 3D position, and 3D attitude. The paper also states, however, that the implementation section uses sequence length 60 and history length 20, corresponding to a 6-second future horizon at 10 Hz plus 2 seconds of history. This discrepancy is part of the published description and is not resolved within the paper [2604.17527].

The denoiser backbone is a transformer decoder with causal masking. A noisy trajectory sample \(\mathbf{x}_t\) is projected into latent space, augmented with positional encoding, and fused with conditioning embeddings before decoding:
$$
\mathbf{h}=\mathrm{TransformerDecoder}(\mathbf{x}_t+\mathbf{e}_{\mathrm{cond}},\mathbf{M}),
$$
where \(\mathbf{M}\) is a causal mask. Conditioning is multimodal. The paper lists a diffusion timestep \(t\), a target waypoint \(\mathbf{p}_t\in\mathbb{R}^3\), a one-hot maneuver vector \(\mathbf{a}\in\mathbb{R}^{14}\), and obstacle context encoded by an attention-based obstacle encoder. It also explains that trajectory history is concatenated with the noisy future segment and jointly encoded with continuous positional encoding, so history is an explicit conditioning modality even though it is described separately from the four conditioning channels [2604.17527].

The architecture includes continuity enforcement between history and generated future. The output corresponding to the future segment is supervised, and the paper states that continuity loss penalizes jumps between the last history state and the first predicted future state. It also reports a multi-component loss of the form
$$
\mathcal{L} = \lambda_{\mathrm{pos}}\mathcal{L}_{\mathrm{pos}} + \lambda_{\mathrm{vel}}\mathcal{L}_{\mathrm{vel}} + \lambda_{\mathrm{obs}}\mathcal{L}_{\mathrm{obs}} + \lambda_{\mathrm{cont}}\mathcal{L}_{\mathrm{cont}} + \lambda_{\mathrm{acc}}\mathcal{L}_{\mathrm{acc}} + \mathcal{L}_{\mathrm{att}},
$$
with implementation weights \(\lambda_{\mathrm{pos}}=1.0\), \(\lambda_{\mathrm{vel}}=1.0\) with the note that velocity loss is disabled in the current configuration, \(\lambda_{\mathrm{obs}}=1.0\), \(\lambda_{\mathrm{cont}}=5.0\), and \(\lambda_{\mathrm{acc}}=1.0\). Position loss receives a \(\times 5\) weighting at the final timestep. The paper identifies the roles of these terms as position accuracy, velocity accuracy, obstacle avoidance, continuity with history, acceleration smoothness, and attitude consistency [2604.17527].

## 3. Diffusion formulation

AeroTrajGen uses a DDPM-style conditional denoiser. In discrete form, the forward process is
$$
q(\mathbf{x}_t\mid \mathbf{x}_{t-1}) = \mathcal{N}\!\left( \mathbf{x}_t;\sqrt{1-\beta_t}\mathbf{x}_{t-1},\beta_t\mathbf{I} \right),
$$
with
$$
\alpha_t=1-\beta_t,\qquad \bar{\alpha}_t=\prod_{s=1}^{t}\alpha_s,
$$
and therefore
$$
\mathbf{x}_t = \sqrt{\bar{\alpha}_t}\mathbf{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon}, \qquad \boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I}).
$$
The reverse conditional is written as
$$
p_\theta(\mathbf{x}_{t-1}\mid \mathbf{x}_t) = \mathcal{N}\!\big( \mathbf{x}_{t-1}; \boldsymbol{\mu}_\theta(\mathbf{x}_t,t), \boldsymbol{\Sigma}_\theta(\mathbf{x}_t,t) \big),
$$
and the training objective is the standard noise-prediction loss
$$
\mathcal{L}(\theta) = \mathbb{E}_{t,\mathbf{x}_0,\boldsymbol{\epsilon}} \left[ \left\| \boldsymbol{\epsilon}-\boldsymbol{\epsilon}_\theta(\mathbf{x}_t,t) \right\|^2 \right].
$$
The paper also states the score-noise relation in the form
$$
\boldsymbol{\epsilon}_\theta(\mathbf{x}_t,t) = -\sqrt{1-\bar{\alpha}_t}\,\nabla_{\mathbf{x}_t}\log q(\mathbf{x}_t),
$$
and uses this identity when introducing safety guidance [2604.17527].

A continuous-time presentation is given as well. The forward SDE is
$$
\mathrm{d}\mathbf{x}_t=f(\mathbf{x}_t,t)\,\mathrm{d}t+g(t)\,\mathrm{d}w_t,\qquad 
f(\mathbf{x}_t,t)=-\beta(t)\mathbf{x}_t,\qquad g(t)=\sqrt{2\beta(t)},
$$
and the reverse-time SDE is
$$
\mathrm{d}\mathbf{x}_t= \left[ -\beta(t)\mathbf{x}_t - 2\beta(t)\nabla_x \log p_t(\mathbf{x}_t) \right]\mathrm{d}t + \sqrt{2\beta(t)}\,\mathrm{d}\widetilde{w}_t.
$$
The paper’s intended sampling rule is the standard DDPM mean update with learned noise prediction, although the typeset discrete reverse-update equation is malformed in the source text [2604.17527].

## 4. CBF-guided safety mechanism

The distinctive feature of AeroTrajGen is that safety enters the reverse diffusion process as an additive guidance term. The paper defines a constrained conditional distribution
$$
p_t(\mathbf{x}_t\mid \mathcal{C}) = \frac{ p_t(\mathbf{x}_t)\,p_s(\mathcal{C}\mid \mathbf{x}_t) }{ Z_t },
$$
so that
$$
\nabla_x \log p_t(\mathbf{x}_t\mid \mathcal{C}) = \nabla_x \log p_t(\mathbf{x}_t) + \nabla_x \log p_s(\mathcal{C}\mid \mathbf{x}_t).
$$
This yields a guided reverse process in which the learned score is augmented by a safety gradient rather than replaced by a hard feasibility projection [2604.17527].

Obstacle avoidance is modeled with spherical control barrier functions. For obstacle center \(\mathbf{c}\in\mathbb{R}^3\), radius \(r>0\), and position \(\mathbf{p}\), the barrier is
$$
h(\mathbf{x}) = (\mathbf{p}-\mathbf{c})^\top(\mathbf{p}-\mathbf{c})-r^2,
$$
with safe set
$$
\mathcal{C} = \{\mathbf{x}\in\mathbb{R}^n : h(\mathbf{x})\ge 0\}.
$$
The paper reviews the discrete-time CBF condition
$$
h(F(\mathbf{x}_k,\mathbf{u}_k)) \ge (1-\gamma)h(\mathbf{x}_k), \qquad \gamma\in(0,1],
$$
and for obstacle avoidance derives
$$
\begin{aligned}
h^v(\mathbf{x}_k,\mathbf{c}) &= \gamma(\mathbf{p}_k-\mathbf{c})^\top(\mathbf{p}_k-\mathbf{c}) -\gamma r^2 \\
&\quad +2\Delta t(\mathbf{p}_k-\mathbf{c})^\top \mathbf{v}_k +(\Delta t)^2 \mathbf{v}_k^\top \mathbf{v}_k \ge 0.
\end{aligned}
$$
Safety-probability surrogates are then built from \(h^v\), including
$$
P_1(\mathbf{x}_t,\mathbf{c}) = \exp\!\left( -\frac{\max(0,-h^v(\mathbf{x}_t,\mathbf{c}))}{\sigma} \right),
$$
and
$$
P_{\mathrm{Logistic}}(\mathbf{x}_t,\mathbf{c}) = \frac{1}{1+\exp\!\left(-\frac{h^v(\mathbf{x}_t,\mathbf{c})}{\sigma}\right)}.
$$
The resulting guidance is inserted into the denoiser through
$$
\epsilon_{\mathrm{guided}} = \epsilon_\theta(\mathbf{x}_t,t) - \sqrt{1-\bar{\alpha}_t}\,\nabla_x\log p_s(\mathcal{C}\mid \mathbf{x}_t),
$$
or equivalently, in the implementation-oriented form using barrier energy \(V=-\log P_{\mathrm{safe}}\),
$$
\epsilon_{\mathrm{guided}} = \epsilon_{\mathrm{pred}} + \gamma_t \nabla_{\mathbf{x}}V \,\sqrt{1-\bar{\alpha}_t}.
$$
For multiple obstacles over a full trajectory, the paper also defines
$$
V(\mathbf{x}) = \sum_{\tau=1}^{N}\sum_{i=1}^{M} \max\bigl(0,-h(\mathbf{x}_\tau,\mathbf{c}_i)\bigr)^2.
$$
Guidance is scheduled over diffusion steps with a decaying weight; the implementation uses
$$
\gamma(t) = \gamma_{\max} \left(1-\frac{t}{t_{\mathrm{start}}}\right)^\alpha \mathbf{1}_{\{t\le t_{\mathrm{start}}\}},
$$
with reported values \(\gamma_{\max}=2000.0\) or \(4000.0\), \(t_{\mathrm{start}}=30\), and \(\alpha=2.0\) [2604.17527].

The paper is careful not to claim a strict end-to-end safety proof for the full stochastic sampler. Its strongest formal statements apply to the DCBF condition itself; the overall method uses the induced barrier gradient as soft guidance during denoising. A plausible implication is that AeroTrajGen should be read as CBF-inspired safety shaping rather than as a projection-based or certificate-based safe planner [2604.17527].

## 5. Training data and empirical evaluation

The training set is described as 2,000 expert demonstrations covering the 14 maneuver styles, while a later implementation note reports “training trajectories: 3,000 (augmented from 2,000 base trajectories).” The optimization configuration is reported as 100 diffusion steps, sequence length 60, history length 20, latent dimension 128, 4 transformer layers, 4 attention heads, dropout 0.1, batch size 32, learning rate \(10^{-4}\), and 100 epochs [2604.17527].

Evaluation is conducted in a custom Python simulation environment with 3–5 randomly placed spherical obstacles of radius 0.5–2.0 m and a safety margin equal to 20% of obstacle radius. A trajectory is counted as successful only if three conditions hold simultaneously: collision-free motion,
$$
\|\mathbf{p}(t)-\mathbf{c}_o\|_2 \ge r_o \quad \forall t,\forall o,
$$
maximum position error relative to ground truth below 2 m,
$$
\max_t \|\mathbf{p}_{\mathrm{pred}}(t)-\mathbf{p}_{\mathrm{gt}}(t)\|_2 < 2.0\ \mathrm{m},
$$
and final target error below 1 m,
$$
\|\mathbf{p}_{\mathrm{pred}}(T)-\mathbf{p}_{\mathrm{target}}\|_2 < 1.0\ \mathrm{m}.
$$
The reported metrics also include collision rate, mean trajectory error or mean absolute error, minimum obstacle distance, success rate, RMSE on position and velocity, acceleration variance, style accuracy, and inference time, although the paper’s tables do not report every metric uniformly [2604.17527].

The clearest ablation compares unguided diffusion and several guidance configurations. With the obstacle encoder present, the unguided model has a 12.0% collision rate, mean AE 1.641 m, minimum distance 0.537 m, and success 29.5%; Config A, which adds exponential-barrier guidance with \(\gamma=2000\), reduces collision rate to 2.0% with mean AE 1.685 m, minimum distance 0.550 m, and success 31.5%. Without the obstacle encoder, the unguided model is reported as extremely unsafe, with 99.0% collision rate and 1.0% success. Adding guidance improves this progressively: Config B with \(\gamma=2000\) gives 46.5% collision and 47.5% success; a stronger variant with \(\gamma=4000\) gives 8.5% collision and 67.0% success; Config C, using the logistic safety function with strong guidance, reaches 0.0% collision, mean AE 0.982 m, minimum distance 0.665 m, and success 42.0% [2604.17527].

The paper also reports scenario-level safety results for Config C. In 3-obstacle scenarios, unguided collision rate is 23.4% with average minimum distance \(-0.42\) m and 187 safety violations out of 800; in 5-obstacle scenarios, unguided collision rate is 96.0% with average minimum distance \(-0.40\) m and 480/500 violations. Config C achieves 0.0% collision in both cases, with average minimum distances 0.89 m and 0.66 m respectively and zero safety violations on 200 test trajectories each [2604.17527].

These safety gains come with a measurable fidelity trade-off. For Config C, position RMSE worsens from 0.47 m to 1.19 m, velocity RMSE from 0.31 to 0.78, acceleration variance from 0.12 to 0.24, and style accuracy from 94.0% to 68.0%. The paper interprets this as the central trade-off of the method: stronger barrier guidance improves clearance and collision metrics, but can distort the nominal expert maneuver, particularly for harder styles such as sphinx and figure eight [2604.17527].

The abstract and conclusion state that CBF-guided sampling reduces collision rates by 94.7% compared with unguided diffusion baselines, but the detailed tables also include 12.0% to 2.0% and 96.0% to 0.0% comparisons. The exact aggregation behind the 94.7% figure is therefore not specified in the paper’s detailed results [2604.17527].

## 6. Position in the literature and limitations

AeroTrajGen occupies a distinct niche within trajectory-generation research. It addresses short-horizon, agile UAV motion planning with online safety shaping, whereas airport and ATM trajectory models typically operate at a different scale and with different assumptions. Low-rank Gaussian mixture models learned from terminal-airspace surveillance data focus on airport-specific approach and departure distributions [1810.09568]. Procedure-conditioned GMMs model deviations from STARs and approach procedures and extend to pairwise traffic generation [2303.09981]. Cross-airport generative models for landing trajectories emphasize transfer learning between data-rich and data-scarce airports, with diffusion models performing best under low-shot adaptation [2511.04155]. AirTrafficGen, by contrast, is an LLM-based ATC scenario generator that produces strategic traffic intent on a graph representation rather than continuous kinematic trajectories [2508.02269]. AeroTrajGen is also distinct from AeroTraj, whose trajectory problem is SLAM-safe coverage planning for drone-mounted LiDAR rather than generative aerobatic flight [2104.08634].

The limitations reported or implied in the AeroTrajGen paper are substantial. The obstacle model is restricted to static known spheres; dynamic obstacles, partial observability, and arbitrary geometry are identified as future work. The method does not provide a formal end-to-end safety guarantee for the stochastic denoising process. Several implementation details are missing or inconsistent, including contradictory sequence-length statements, incomplete reporting of optimizer and data splits, and malformed equations in parts of the text. The strongest empirical configuration improves safety at a cost in position fidelity, smoothness, and style accuracy. For these reasons, AeroTrajGen is best understood as a strong empirical step toward safer generative UAV planning rather than a complete certified planning solution [2604.17527].

Source: https://www.emergentmind.com/topics/aerotrajgen