oss-slu / oss-slu/PilotDataSynchronization

Plugin applies metric conversion factors to pilot altitude and airspeed that are already in feet and knots

Open
#196 0 comments 0 reactions 1 assignee View on GitHub

@Phlabry is already working on this.

Since Sep 17, 2026.

bug
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:279 multiplies pilot altitude by msToFeetRate (3.28084)
  • xplane_plugin/src/pilotdatasync-xp11.cpp:288 multiplies pilot airspeed by msToKnotsRate (1.94384)
  • The same happens on the Send Packet path at pilotdatasync-xp11.cpp:127-130 and in pilotdatasync-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

  1. Load the plugin and fly at a steady indicated altitude and airspeed.
  2. Compare "Elevation, Pilot" and "Airspeed, Pilot" in the plugin window, or the logged CSV, against the cockpit altimeter and airspeed indicator.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.