Repository navigation
Load the client's Prepar3D TSV exports into the telemetry schema #228
Description
Is your feature request related to a problem? Please describe.
features.py expects the logger schema (pilot_id, flight_id, altitude, heading, vertical_speed, velocity, target_*). The client's files were exported from Prepar3D, not X-Plane, and their headers change from file to file. Nothing in inference/ can read them.
What the client files look like (checked across all 19):
- 5 pilots (P001, P002, P003, P004, P007) and 19 flights, named
P001_T1.tsvand so on - Tab-separated, sampled at about 1 Hz, latin-1 encoded (the degree sign is mis-encoded)
- The header changes from file to file:
Nose gearappears in 5 files (always 0),Flaps position percentis missing in P004_T1 and P004_T3, and 4 files carry a strayEngine N …column (Engine 2–4, every value 0) - Latitude/Longitude appear twice, and every file ends in 2 empty columns
Describe the solution you'd like
Add a pure inference/prepar3d_export.py and a thin CLI load_client_data.py.
- Map columns by header name, never by position. Strip the unit suffix after the comma.
Altitude MSL→altitude(ft)Heading (true)→heading(deg true; note that the schema doc says magnetic)Indicated Airspeed→velocity(kts)Vertical speed→vertical_speed(fpm)- Keep
pitch,bank,throttle,elevator_input,aileron_input,rudder_input,elevator_trimandflaps(when present).
- Derive
pilot_idandtrialfrom the file name (P001_T3→P001,3) and setflight_idtoP001_T3. - Drop the duplicate Lat/Lon, the empty trailing columns and stray
Engine Ncolumns. Makeflapsandnose_gearNaN when the column is missing, not 0. - These files come from Prepar3D, not through our plugin, so the Plugin applies metric conversion factors to pilot altitude and airspeed that are already in feet and knots #196 rescaling does not apply. Sanity-check the units: cruise IAS should be about 70–130 kt and the field elevation near 1,100 ft.
Acceptance criteria
- All 19 files load into one long table with one row per sample
- Tests cover each header variant: Nose gear present, Flaps missing, stray Engine column
- A test checks that a missing required column raises an error naming it
-
docs/telemetry_schema.mdgains a section on the client export format and its mapping
Update (source of the data): the client says these files "were derived from Prepar3D, as I currently do not have X-Plane data", and that the plan is to build the prototype on them and migrate to X-Plane later. Keep this loader separate from the plugin/logger path: it is a loader for Prepar3D exports only. The plugin will be the source once the client moves to X-Plane.
Activity
[-]Load X-Plane Data Output TSVs into the telemetry schema[/-][+]Load the client's Prepar3D TSV exports into the telemetry schema[/+]jmacd867 commentedon Oct 15, 2026
Edited the body: the client's files come from Prepar3D, not X-Plane (her note: "they were derived from Prepar3D, as I currently do not have X-Plane data"). Also corrected the header counts after re-checking all 19 files:
Nose gearis in 5 files, not 6, and always reads 0; strayEngine Ncolumns are in 4 files, not 5, and are all zeros. The proposed module is renamedprepar3d_export.py.jmacd867 commentedon Oct 16, 2026
Confirmed by the client (`docs/client_meeting_notes.md`):