oss-slu / oss-slu/PilotDataSynchronization
Plugin applies metric conversion factors to pilot altitude and airspeed that are already in feet and knots
@Phlabry is already working on this.
Since Sep 17, 2026.
- Dominant language
- Rust
- Stars
- 4
- Forks
- 8
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 2
Description
Describe the bug
The plugin reads sim/cockpit2/gauges/indicators/altitude_ft_pilot and sim/cockpit2/gauges/indicators/airspeed_kts_pilot, which are already in feet and knots (xplane_plugin/docs/key_datarefs.md:28-29 and :56-57), then multiplies them by meter and meters-per-second conversion factors:
xplane_plugin/src/pilotdatasync-xp11.cpp:279multiplies pilot altitude bymsToFeetRate(3.28084)xplane_plugin/src/pilotdatasync-xp11.cpp:288multiplies pilot airspeed bymsToKnotsRate(1.94384)- The same happens on the Send Packet path at
pilotdatasync-xp11.cpp:127-130and inpilotdatasync-xp11.macos.cpp:94-95, 228, 237
The comment at pilotdatasync-xp11.cpp:263 says the dataref provides meters. That is only true for the flightmodel refs converted at lines 275 and 284. Every altitude and velocity value sent to iMotions and logged by data_logger.py is inflated by these factors.
To Reproduce
- Load the plugin and fly at a steady indicated altitude and airspeed.
- Compare "Elevation, Pilot" and "Airspeed, Pilot" in the plugin window, or the logged CSV, against the cockpit altimeter and airspeed indicator.
- Per the code, the plugin values are about 3.28 and 1.94 times the instrument readings.
Expected behavior
Pilot altitude and airspeed are passed through unconverted. Only sim/flightmodel/position/elevation (meters) and true_airspeed (meters per second) need conversion.
Additional context
Effect on the committed ML data in inference/Data/labeled_flight_data.csv: median velocity is 377 kt as logged and 194 kt once divided back; median altitude is 9,892 ft as logged and 3,015 ft corrected. Re-running FlightEventLabeler on corrected values changes 4,825 of 16,604 labels (29.1%). For example 1,676 rows labeled HIGH_SPEED become NORMAL_FLIGHT, and LOW_ALTITUDE goes from 0 rows to 518. The thresholds in label_generator.py assume real feet and knots, so existing labels and the trained model are affected until this is fixed and the data is re-collected or rescaled.
Found while reviewing #177.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.