No description
| config | ||
| docs | ||
| results | ||
| src | ||
| tests | ||
| .gitignore | ||
| README.md | ||
| requirements.txt | ||
| run.py | ||
DEM-Based Terrain-Aided INS (TAN)
Simulated terrain-aided navigation for a high-speed UAV without GNSS: IMU dead reckoning, radar altimeter, synthetic DEM, terrain profile matching, EKF/UKF fusion, and integrity gating.
Full research spec: docs/PROJECT_SPEC.md · Engineering plan: docs/roadmap.md
What it does
flowchart LR
IMU[IMU] --> INS[INS dead reckoning]
ALT[Altimeter] --> TM[Terrain matcher]
DEM[DEM map] --> TM
INS --> TM
TM --> GATE[Integrity gate]
GATE --> FILT[EKF / UKF]
FILT --> OUT[Corrected position]
FILT -.->|optional reset| INS
- Load real SRTM
.hgtmaps natively, or build a synthetic DEM fallback. - Fly a truth trajectory (straight legs + banked turns).
- Simulate IMU and radar altimeter with noise and bias.
- Run INS (drifts over time).
- Match measured height profiles to the DEM (MAD matcher).
- Gate bad matches (χ² test), then fuse with EKF or UKF.
- Plot trajectories and errors; run benchmarks and Monte Carlo.
Quick start
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python run.py sim # plots 01–06 → sim_outputs/[tile_name]/
python run.py bench # scenario table → results/
python run.py mc # Monte Carlo → results/ + monte_carlo_*.png
python run.py all # run all three
Or directly:
python tests/main_sim.py
Settings (no code edits needed)
Edit config/settings.yaml (~20 fields). Example:
| Group | Keys | Purpose |
|---|---|---|
| Flight | start_speed_mps, flight_segments_sec, turn_rate_deg_s |
Mission path |
| DEM | dem_amplitude_m, dem_seed |
Terrain roughness |
| Sensors | imu_*, altimeter_* |
Noise / bias |
| Matching | match_search_radius_m, match_window_size, match_interval_sec |
TAN tuning |
| Filter | filter_type (ekf / ukf), filter_q_pos_m, filter_r_pos_m |
Fusion |
| Integrity | integrity_chi2_threshold, closed_loop_ins_reset |
False-match rejection |
| UI | plot_theme (dark / minimal), output_dir |
Plots |
Override file path:
export DEM_TAN_SETTINGS=/path/to/my_settings.yaml
Project layout
config/settings.yaml ← all tunables
data/
dem_tiles/ Place SRTM `.hgt` dataset tiles here (e.g., n34e051.hgt)
src/
dem/ DEM loader + synthetic terrain + HGT parser
simulation/ Truth trajectory
sensors/ IMU + altimeter models
navigation/ INS, matcher, EKF, UKF, integrity
analysis/ NavigationPipeline, scenarios
plotting/ Dark / minimal themes
tests/
main_sim.py End-to-end demo
run_benchmarks.py Multi-scenario comparison
run_monte_carlo.py Statistical runs
docs/ Walkthrough logs and project documents
trash/ Transient discarded files
sim_outputs/ Figures (01–06) separated conditionally per loaded DEM title
results/ CSV + markdown tables
Output figures (sim_outputs/)
Once started, the pipeline runs dynamically over every .hgt dataset placed at data/dem_tiles/. Outcomes are organized neatly per tile layout:
| File | Phase | Content |
|---|---|---|
01_trajectory_3d.png |
1–2 | Truth path over DEM (3D) |
02_imu_accel.png |
3 | Body-frame accelerometer |
03_altimeter.png |
3 | True vs noisy AGL + terrain height |
04_navigation_map.png |
4–6 | Plan view on DEM (truth / INS / fused) |
05_full_navigation.png |
7 | Map + accepted/rejected terrain matches |
06_error_over_time.png |
Eval | Horizontal position error vs time |
monte_carlo_*.png |
9 | CEP histogram & dispersion (run.py mc) |
Sample results
After python run.py bench, open results/benchmark_summary.md. Typical patterns:
- Mountainous / hilly terrain → fusion can beat INS-only when matches are accepted.
- Flat terrain → matching fails more often (high gate rejection).
- UKF vs EKF → similar on this 4-state model; compare last benchmark row.
Monte Carlo prints CEP50 / CEP95 and saves histograms in sim_outputs/.
Themes
plot_theme |
Look |
|---|---|
dark |
Dark background (default) |
minimal |
Light, clean lines |
Limitations (MVP)
- Local flat-Earth INS (not full strapdown 6-DOF).
- Synthetic DEM safely fallbacks natively without external data required.
- Profile MAD matching (not full NCC grid search).
- Particle filter not implemented (see roadmap).
License
Academic / research use — see course or lab guidelines.