Repository navigation
Issue #184 solved: send both halves so FlightModel and Pilot differ - #267
Merged
Sanjana-Siddani merged 1 commit intoNov 12, 2026
Merged
Sanjana-Siddani merged 1 commit into
Sanjana-Siddani merged 1 commit into
Conversation
…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.
|
Sanjana-Siddani
self-requested a review
November 11, 2026 19:03
Sanjana-Siddani
approved these changes
Nov 11, 2026
Sanjana-Siddani
left a comment
Collaborator
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #184.
What was wrong
Every iMotions entry declares two fields,
FlightModel*andPilot*, 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.
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.pyreadparts[8], theFlightModel*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 readsparts[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/elevationis metres andposition/true_airspeedis 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
yawandg_forcehave no pilot-side DataRef, so both halves carry the flightmodel value and are equal by design.Verification
x86_64-pc-windows-gnu, and is clang-format clean under LLVM styleThe plugin half is not verified beyond compiling. Whether
position/elevationand 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.