Skip to content

feat(export): X-Plane FDR flight-data-recorder export#702

Draft
msupino wants to merge 15 commits into
devfrom
feat/fdr-export
Draft

feat(export): X-Plane FDR flight-data-recorder export#702
msupino wants to merge 15 commits into
devfrom
feat/fdr-export

Conversation

@msupino

@msupino msupino commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Adds 🎬 Export FDR to the Export dropdown so pilots can pre-fly their CVFR route in X-Plane as a replay.

How it works

  • Samples the route at 1-second intervals
  • Per sample: lat/lng (linear interp), altitude (smooth 20 s blend at each waypoint), heading (blend through turn), roll (bank-angle formula from turn rate + speed), pitch (climb/descent rate), VVI ft/min, ISA temperature
  • Outputs a plain-text .fdr file X-Plane opens via Load Flight Data Recorder File
  • Default aircraft: Cessna 172SP (user can edit the ACFT line in the file)

References

Closes #701

Made with Cursor

Adds '🎬 Export FDR' to the Export dropdown. Samples the route at 1
second intervals, computing for each point:
- lat/lng via linear interpolation along each leg
- altitude blended smoothly over 20 s at each waypoint transition
- heading blended through the turn angle
- roll from bank-angle formula: arctan(turn_rate × KTAS / 1092)
- pitch from climb/descent rate
- VVI in ft/min from Δalt between samples
- temperature from ISA lapse rate

Output is a plain-text .fdr file X-Plane opens via the FDR replay
dialog. Default aircraft Cessna 172SP (editable). EN + HE strings.

Closes #701

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot marked this pull request as draft June 9, 2026 12:42
@github-actions github-actions Bot temporarily deployed to pr-preview-702 June 9, 2026 12:43 Inactive
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview deployed

Open PR preview →

https://msupino.github.io/NavigationApp/branch/feat/fdr-export/

Commit: 234a516

Comment thread docs/app/io.js Fixed
msupino and others added 2 commits June 9, 2026 15:44
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot temporarily deployed to pr-preview-702 June 9, 2026 12:51 Inactive
…es X-Plane 12 spec

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread docs/app/io.js Fixed
Comment thread docs/app/io.js Fixed
Co-authored-by: Cursor <cursoragent@cursor.com>
…usable)

X-Plane FDR DATA rows are fixed-position, not header-labelled. The export
emitted time,lon,lat,alt,hdg,pitch,roll,IAS,VVI — which shifted every value
into the wrong column (heading landed in h_msl, altitude in latitude, etc.),
so X-Plane couldn't replay the route.

Add fdrDataRow() that writes each value to its required column per the spec
(1 time, 2 temp, 3 lon, 4 lat, 5 h_msl, 6 radio_alt, 7-9 controls, 10 pitch,
11 roll, 12 hdg true, 13 KIAS, 14 VVI, 15 slip, 16 turn). Replace the custom
DREF columns with the standard fixed KIAS/VVI slots; add PRES/TEMP/WIND header
lines. tests/export-fdr.spec.js asserts the column positions + altitude ramp.
Comment thread tests/export-fdr.spec.js Fixed
Comment thread tests/export-fdr.spec.js Fixed
X-Plane reported "Out of range FDR-file heading … 2000" — it was reading
our altitude (col 5) as the heading. The 'A'/'3' version line forced
X-Plane's compact parser (heading = 5th value); the documented keyword
format has no version line and uses the 80-column DATA order with heading
in its fixed far column. Remove the 'A'/'3' lines; keep the 80-col rows.

Also: describe each export type in the dropdown labels (JSON/GPX/PLN/FDR),
en + he.
X-Plane 12 rejected the header-less/legacy 80-col layout ("Old,
non-supported FDR format") and, with an A/3 header but 80-col rows, read
the altitude as the heading ("Out of range … 2000"). V3 wants the COMPACT
positional order: time, lon, lat, alt_ft, heading_true, pitch, roll — with
heading as the 5th value (confirmed by X-Plane's own error). Restore the
A/3 version header and emit compact rows. Reference: lavirott/tofdr.
msupino added 2 commits June 11, 2026 18:42
Replaced the per-leg straight-line sampler (which kinked instantly at each
waypoint) with a curved path: each interior waypoint is rounded with a
banked-turn arc of radius R = V²/(g·tan φ) at φ=18°, computed in a local
metres projection and clamped so adjacent turns don't overlap. The path is
resampled at 1 s and heading is taken from the path tangent, roll from the
heading rate (tan φ = ω·V/g, signed by turn direction), and pitch from the
climb rate — so X-Plane replays natural, banked turns instead of snapping
direction at the corners. Altitude is smoothed (±20 s) for gradual climbs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants