---
title: 'StableUASim: UAV & Underwater Simulation'
url: https://www.emergentmind.com/topics/stableuasim
type: topic
---

# StableUASim: UAV & Underwater Simulation

StableUASim is the name of two independent high-fidelity simulation frameworks originating from distinct research communities: (1) a stochastic simulator for testing GNSS-denied navigation in fixed-wing UAVs [2102.00883], and (2) a conditional diffusion-based surrogate generator for underwater acoustic channels [2511.18078]. Both platforms are designed for rigorous, quantitative evaluation of data-driven algorithms in safety-critical environments and are characterized by full-stochastic module design, physically realistic models, and metrics for assessing estimator performance or channel realism. What follows is a technical summary of both frameworks―their architecture, mathematical formalisms, workflows, and extensibility.

## 1. Core System Architectures

### 1.1. Fixed-Wing UAV GNSS-Denied Simulation ([2102.00883])

StableUASim is organized as a modular C++ framework with six core components:

- **Earth/environment:** Provides stochastic models of gravity, atmosphere, wind, turbulence, and magnetic field.
- **Aircraft:** Encodes deterministic mass, inertia, six-DOF aerodynamics, and propulsion characteristics.
- **Flight dynamics integrator:** Solves the 6-DOF Newton-Euler state ODE via a Lie-group Runge-Kutta method (500 Hz, unit-quaternion normalization).
- **Sensors:** Models IMU, magnetometer, air data, GNSS, and camera with seedable Gauss-Markov noise/bias/random-walk and run-to-run stochastic perturbations.
- **Guidance & Control:** Implements guidance logic and a four-PID-loop autopilot (50 Hz, setpoint ramping).
- **Navigation:** Uses a user-supplied plugin conforming to a NavigationBase interface for estimator development and evaluation.
- **Monte-Carlo manager:** Manages reproducible random seed allocation, scenario synthesis, and metrics collection.

The primary information flow is:

```
x₀ → [Flight Dynamics + Earth + Aircraft] → xˢ (truth) → Sensors → x̃ (noisy) → Navigation → x̂ (estimate) → Guidance → δ (commands) → Dynamics
```

### 1.2. Underwater Acoustic Channel Surrogate ([2511.18078])

StableUASim is implemented as a two-stage conditional latent diffusion pipeline:

- **LSTM Autoencoder:** Compresses each time-varying impulse response (TVIR, $X \in \mathbb{C}^{20 \times 250}$) into a real 128-D latent code $z$ using a three-layer bidirectional LSTM for both encoder and decoder, with preprocessing to $(A_i, \sin\phi_i, \cos\phi_i)$ for stability.
- **Conditional Diffusion Model:** Learns to denoise a noised latent $z_t$ into a signal-consistent latent $z_0$ given an observed anchor code $z_c$, using a fully connected denoiser network parameterized by $\kappa_{\theta_\text{diff}}$.

The overview pipeline is:

```
X → Encoder E → z → Diffusion network (Condition z_c) → ẑ → Decoder D → X̂
```

## 2. Physical Models and Sensor Simulation

### 2.1. Aircraft Dynamics (UAV)

6-DOF rigid body equations are used:
- State vector: $x = [x_\text{GDT}, v^B, q_{N \rightarrow B}, \omega_{I \rightarrow B}, m]^T$
- Newton-Euler evolution:
  $$
  m \dot{v}^B = F_\text{Aero} + F_\text{prop} + m g + \cdots, \qquad
  I \dot{\omega}^B + \omega^B \times (I\omega^B) = M_\text{Aero} + M_\text{prop}
  $$
  with quaternion and NED updates for orientation and position.
- Aerodynamics use AVL-derived coefficients:
  $$
  F_\text{Aero} = \frac{1}{2} \rho V^2 S [C_X, C_Y, C_Z]^T
  $$
- Control is four-PID loop autopilot (airspeed, pitch/altitude, bank/course, sideslip).

### 2.2. Sensor and Weather Stochasticity

- **IMU:** Modeled as
  $$
  \tilde{f} = f_\text{true} + b_\text{acc} + \eta_\text{acc}, \qquad
  \dot{b} = -\frac{1}{\tau} b + \sigma_w w(t), \qquad b(0) \sim \mathcal{N}(0, \sigma_\text{bias}^2)
  $$
- **Air data, GNSS, magnetometer, and camera:** All subject to independent random walks and Gaussian biases seeded per run.
- **Turbulence:** High-frequency velocity spectra use Dryden models, e.g.,
  $$
  \Phi_u(\Omega) = \sigma_u^2 \frac{2L_u}{\pi} \frac{1}{1 + (L_u\Omega)^2}
  $$
- **Weather:** Scenario-specific linear ramps with parameters (e.g., $\Delta T$, $|v_\text{wind}|$) drawn from seedable distributions.

## 3. Scenario Generation and Monte Carlo Workflows

### 3.1. Flight Scenarios (UAV)

- **Abort-to-Recovery:** GNSS loss after initial segment, followed by maneuvers (coordinated turns, airspeed/altitude changes, prolonged flight in varying weather), with mission parameters and environmental disturbances drawn per run.
- **Mission-Continuation Bearing-Maneuvers:** Shorter, rapid legs with repeated heading changes, constant weather. Both are parameterized for stochastic repeatability.

### 3.2. Monte Carlo Evaluation

- Set $N_\text{ex}$ number of runs and seedings to ensure scenario coverage.
- For each run, simulate aircraft, sensors, and navigation plugin; record estimated and ground-truth states.
- Metrics:
  $$
  \mu_j = \frac{1}{N} \sum_n f_{Xj}(t_n), \quad
  \sigma_j = \sqrt{\frac{1}{N} \sum (f_{Xj} - \mu_j)^2}, \quad
  \max_j = \max_n |f_{Xj}(t_n)|
  $$
  With aggregated means, variances, and maximums for cross-run analysis.

### 3.3. Underwater Channel Generation

- Encode an observed impulse response $X_c$ to $z_c$.
- Sample $z_T \sim \mathcal{N}(0, I)$, iteratively denoise using
  $$
  z_{t-1} = \frac{1}{\sqrt{\alpha_t}}\left[z_t - \frac{\beta_t}{\sqrt{1-\bar{\alpha}_t}} \hat{\varepsilon}_{t-1} \right] + \sigma_t \xi
  $$
  where $\hat{\varepsilon}_{t-1} = \kappa_{\theta_\text{diff}}(z_t, z_c, t)$
- Decode $z_0$ back to reconstructed TVIR, matching higher-order statistics of both training and conditional anchor sample.

## 4. Training Regimes, Adaptation, and Extensibility

### 4.1. Pre-training and Fine-tuning (Underwater Channel)

- **Pre-training:** On 1 million simulated TVIRs from UnderwaterAcoustics.jl RaySolver across broad physical environments; autoencoder with $L_\text{AE}$ loss (amp + phase, Eq. (14)); diffusion with noise prediction loss (Eq. (22)).
- **Fine-tuning:** Performed on as few as 50–100 real world TVIRs, with fast adaptation (minutes), demonstrating that channel characteristics and communication system performance are retained with minimal data.

### 4.2. Software Plugins and Reproducibility

- **UAV Simulator:** User-defined navigation algorithms (e.g., EKF, UKF, visual SLAM, VIO) are integrated via a plugin interface, updated at 100 Hz, and evaluated identically across ensemble runs.
- **Acoustic Simulator:** Researchers can substitute TVIR encoders/decoders or diffusion denoisers, or retrain on alternative environmental distributions.

- Configuration is managed via YAML/INI; all stochastic modules are reproducibly seeded.

| Simulator           | Programming Language | User Plugin API         | Typical Use Cases                                |
|---------------------|---------------------|------------------------|--------------------------------------------------|
| Fixed-wing UAV      | C++11+              | NavigationBase (C++)   | GNSS-denied navigation benchmarking              |
| Underwater Acoustic | Python/Torch model  | Network modules (PyTorch) | Surrogate channel generation, comms simulation |

## 5. Evaluation Metrics and Benchmarks

- **Flight navigation:** Trajectory drift/bias/variance, final state error, boundedness, dynamic response. Aggregated via per-run and across-run statistics.
- **Underwater channel:** Delay/Doppler spread, coherence time, Rice $K$-factor, amplitude/phase distributions of significant taps; BER/SNR and CDF matches for BPSK/OFDM against UACC-GAN and stochastic replay baselines (Figs. 16, 21).

StableUASim achieves data-efficiency in surrogate adaptation; with underwater acoustic modeling, fidelity is maintained on as few as one NOF1 or fifty Keppel recordings, outperforming GAN surrogates on low-data benchmarks [2511.18078].

## 6. Validation, Software Access, and Integration

- The UAV simulation is open-source (GitHub: edugallogithub/gnssdenied_flight_simulation), built atop CMake, Eigen, Boost, OpenSceneGraph, osgEarth, and OpenGL.
- Output includes per-run time-series and CSV/MATLAB-compatible aggregate files, facilitating standardized comparison and plotting.
- The underwater acoustic framework is fully reproducible from the explicit neural and loss formulations, with code structure and training schedules provided to support independent implementation or extension.

## 7. Research Impact and Prospective Directions

StableUASim defines the state-of-the-art for reproducible, physically consistent simulator-driven evaluation:

- In UAV navigation, it enables robust Monte Carlo-based quantification of estimator drift and failure rates under stochastic sensor/weather/mission perturbations, addressing the classical GNSS-denied challenge [2102.00883].
- As a surrogate acoustic channel, it bridges the gap between limited real-world measurements and the high data demand of learning-based underwater communication system design, supporting scalable conditional channel realization with minimal adaptation overhead [2511.18078].

A plausible implication is that, with its emphasis on modularity, stochastic scenario design, and extensible plugin interfaces, StableUASim provides a rigorous substrate for quantitatively benchmarking learning-driven algorithms in safety-critical and nonstationary environments. Further adoption across airborne and underwater simulation and benchmarking efforts is likely, particularly in fields requiring domain adaptation, transfer learning, or robust estimator assessment.

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