Skip to content

Issue #184 solved: send both halves so FlightModel and Pilot differ - #267

Merged
Sanjana-Siddani merged 1 commit into
oss-slu:mainfrom
PRINCEKK122:184-pair-flightmodel-and-pilot-values
Nov 12, 2026
Merged

Sanjana-Siddani merged 1 commit into
oss-slu:mainfrom
PRINCEKK122:184-pair-flightmodel-and-pilot-values

Conversation

@PRINCEKK122

Copy link
Copy Markdown
Collaborator

Closes #184.

What was wrong

Every iMotions entry declares two fields, FlightModel* and Pilot*, but the plugin sent the pilot half only and the relay filled both with the same number. The reason there are two fields — comparing the pilot's instrument reading against the aircraft's true state — did not work at all.

The fix

The plugin now sends 16 values per sample: both halves of each value, flightmodel first, in the relay's entry order.

position 0,1 2,3 4,5 6,7 8,9 10,11 12,13 14,15
value altitude airspeed vertical speed heading roll pitch yaw g force

Note vertical speed before heading. The old pilot-only payload sent heading third and the relay reordered it on the way out; the paired payload is in entry order so the relay pairs straight through. The relay's generic pairing branch already handled this shape correctly but was unreachable behind the 8-field branch, so it now has an explicit 16-field branch with a test pinning the order. The 4- and 8-field shapes still duplicate, because an older plugin gives the relay nothing else to put there.

Two things the issue did not mention

Both would have been silent failures, so they are the part most worth reviewing.

data_logger.py read parts[8], the FlightModel* field. That was the pilot value only because both halves were identical. Widening the payload without touching this would have repointed the entire ML pipeline from pilot readings to flightmodel readings, with nothing failing anywhere. It now reads parts[9], keeping the dataset pilot-side as GLOSSARY.md defines it ("Pilot reading": carries simulated sensor error rather than the aircraft's true physical state).

The two halves were not in the same units. position/elevation is metres and position/true_airspeed is metres per second, while the pilot DataRefs are already feet and knots. Pairing them raw would have reproduced #196 in a new place. The plugin's display code already converted correctly, so the conversion rates moved to file scope and both send sites use them.

Caveats, documented in the code and docs

  • Airspeed differs in kind, not only by sensor error: the flightmodel half is true airspeed, the pilot half indicated, so the gap grows with altitude.
  • yaw and g_force have no pilot-side DataRef, so both halves carry the flightmodel value and are equal by design.

Verification

The plugin half is not verified beyond compiling. Whether position/elevation and the AHARS DataRefs read sensibly in flight needs someone running X-Plane. I have no way to check that, so please do not read the green checks as covering it.

This is a telemetry-contract break

Data captured after this is not comparable to inference/data/ on these fields — a second caveat alongside the pre-#196 scaling. That is a decision rather than a diff, so it wants agreement, not just approval.

@Phlabry you may have a view here given #213 (designated values) and #236 (heading reference), both of which turn on what these values mean.

…iffer

Every iMotions entry declares two fields, FlightModel* and Pilot*, but the
plugin sent the pilot half only and the relay filled both with the same
number. The reason there are two fields -- comparing the instrument reading
against the aircraft's true state -- did not work at all.

The plugin now sends 16 values per sample, both halves of each value,
flightmodel first, in the relay's entry order. The relay's generic pairing
branch already handled that shape correctly but was unreachable behind the
8-field branch; it now has an explicit 16-field branch so a test pins the
order. The 4- and 8-field shapes still duplicate, because an older plugin
gives the relay nothing else to put there.

Two things the issue did not mention, both of which would have been silent:

data_logger.py read parts[8], the FlightModel* field. That was the pilot
value only because both halves were identical, so this change alone would
have repointed the whole ML pipeline from pilot readings to flightmodel
readings with nothing failing. It now reads parts[9], keeping the dataset
pilot-side as GLOSSARY.md defines it.

The two halves were not in the same units. position/elevation is metres and
position/true_airspeed is metres per second, while the pilot DataRefs are
already feet and knots, so pairing them raw would have reproduced oss-slu#196 in a
new place. The plugin's display code already converted correctly, so the
conversion rates moved to file scope and both send sites use them.

Airspeed still differs in kind, not only by sensor error: the flightmodel
half is true airspeed and the pilot half indicated, so the gap grows with
altitude. yaw and g_force have no pilot-side DataRef, so both halves carry
the flightmodel value and are equal by design. Both are documented.

Tests: relay 25 (2 new, including one pinning that the legacy 8-field shape
still duplicates), inference 120 (2 new, using values that differ so the
halves can be told apart). The plugin cross-compiles and links for Windows
and is clang-format clean under LLVM style.

The two failing relay mirror tests on this branch are oss-slu#251, fixed by oss-slu#265,
not introduced here.
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@Sanjana-Siddani
Sanjana-Siddani self-requested a review November 11, 2026 19:03

@Sanjana-Siddani Sanjana-Siddani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really thorough fix! I checked that both send paths convert flightmodel to feet and knots, that data_logger and live clustering still read the pilot value, and that old and new plugin/relay versions still work together. Relay tests pass (the 2 failures are #251), all 120 Python tests pass, and clang-format is clean. Small thing: the C++ diff looks huge because the file’s line endings changed from CRLF to LF. Fine for now, but maybe add a .gitattributes later. Approving

@Sanjana-Siddani
Sanjana-Siddani merged commit 12cdd43 into oss-slu:main Nov 12, 2026
3 checks passed
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.

Relay sends the pilot value twice, so FlightModel fields carry pilot data

2 participants