Skip to content

Send GNSS quality (DDI 514) to implements - #83

Open
gunicsba wants to merge 3 commits into
developfrom
feature/gnss-quality-announcement
Open

gunicsba wants to merge 3 commits into
developfrom
feature/gnss-quality-announcement

Conversation

@gunicsba

@gunicsba gunicsba commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Second of four PRs split out of #73 (see #82 for the first). Parses the fix-quality byte from AOG's GPS/IMU PGN 0xD6 (source 0x7C) and pushes it to every ISOBUS client whose device description declares DDI 514 (GNSSQuality) as settable, every 250 ms. A non-settable declaration is skipped, since it cannot accept a Value command.

Deliberately not gated on track-control negotiation. In #73 this was only sent after the DDI 505/506 handshake completed. Nothing in the ISO DDI definitions ties DDI 514 to 505/506 — it's a general positioning signal that happens to share the TRACK DDI number block — so any implement that declares it gets it.

  • AOG fix values 0-8 are forwarded unchanged: they are the NMEA 2000 GNSS Method values DDI 514 uses, including 6=Estimated, 7=Manual, 8=Simulated. Values above 8 and a stale/missing 0xD6 map to 1 (weakest real fix), not 0: some implements gate TRACK/section control on GNSS quality being non-zero, and AOG doesn't always send 0xD6 (e.g. Simulator mode).
  • DDI 514 is mapped to its element in request_measurement_commands() next to the existing DDI mappings. Mapping only, no OnChange subscription — it's a value the TC pushes, not one it reads back. Like the existing mappings, this only runs for clients with sections (implements, not tractors).
  • Docs: docs/PROTOCOL.md (source 0x7C, PGN 0xD6, outbound DDI 514) and the readme.

Keeping the follow-up PRs conflict-free

Trial-merged against #82 (TECU): clean, no conflicts. The new members in app.hpp and the new blocks in app.cpp are deliberately placed away from where #82 inserts. The readme gets its own "Guidance data sent to implements" subsection so the remaining guidance PRs append bullets there rather than all editing the shared capabilities list.

Test plan

  • Release build + AOG_TC_VALIDATE_IOP=ON build, ctest 5/5.
  • Real-bus check that an implement declaring DDI 514 receives the value — not yet run against hardware.

🤖 Generated with Claude Code

@gunicsba
gunicsba force-pushed the feature/gnss-quality-announcement branch from 2d710ef to 7ad08f0 Compare September 19, 2026 21:41
@gunicsba gunicsba added this to the Tramlines milestone Sep 19, 2026
@gunicsba
gunicsba force-pushed the feature/gnss-quality-announcement branch from 7ad08f0 to dac551e Compare September 19, 2026 22:00
@gunicsba gunicsba added the enhancement New feature or request label Sep 19, 2026
@gunicsba
gunicsba added this pull request to stack #86 September 19, 2026 22:08
@gunicsba
gunicsba requested a balanced review from Copilot September 19, 2026 22:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Valid GNSS methods 6–8 are misreported, and non-settable DDI declarations may receive unsupported commands.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity · 3 Low severity

Open (5)
What changed in this PR

Adds periodic GNSS quality forwarding from AOG to compatible ISOBUS implements.

Changes:

  • Parses GNSS quality from PGN 0xD6.
  • Maps and transmits DDI 514 every 250 ms.
  • Documents the protocol and capability.
File Description
src/​app.cpp Parses and periodically forwards GNSS quality.
src/​task_controller.cpp Maps DDI 514 and sends values.
include/​app.hpp Adds GNSS quality state and timeout.
include/​task_controller.hpp Exposes GNSS quality transmission.
docs/​PROTOCOL.md Documents PGN 0xD6 and DDI 514.
readme.md Lists GNSS quality support.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/app.cpp Outdated
Comment thread src/task_controller.cpp
Comment thread docs/PROTOCOL.md Outdated
Comment thread include/app.hpp Outdated
Comment thread include/task_controller.hpp Outdated
Parses the fix-quality byte from AOG's GPS/IMU PGN 0xD6 (source 0x7C) and
pushes it to every client whose DDOP declares DDI 514 (GNSSQuality), every
250 ms.

- AOG fix values 0-8 are forwarded unchanged (they are the NMEA 2000 GNSS Method
  values DDI 514 uses, including 6=Estimated, 7=Manual, 8=Simulated). Values
  above 8 and a stale/missing 0xD6 map to 1 (weakest real fix) rather than 0,
  since some implements gate TRACK and section control on GNSS quality being
  non-zero.
- DDI 514 is mapped to its element in request_measurement_commands() alongside
  the other DDI mappings; mapping only, no OnChange subscription, since it is
  a value the TC pushes rather than one it reads back. Only implements that
  declare DDI 514 as settable are mapped, since a non-settable DDI cannot accept
  a Value command.
- docs/PROTOCOL.md and the readme document the new PGN and DDI. The readme
  gets its own "Guidance data sent to implements" subsection so follow-up
  guidance PRs append bullets there instead of all editing the shared
  capabilities list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gunicsba
gunicsba force-pushed the feature/gnss-quality-announcement branch from dac551e to 7d05e40 Compare September 19, 2026 23:04
Resolve conflict in request_measurement_commands(): keep the GNSS quality
(DDI 514) mapping and switch its output, plus the two GNSS prints in
app.cpp, to log() to match the async logging from #79.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve conflict in task_controller.cpp by keeping both new helpers:
find_owning_element_number (GNSS quality) and save_received_ddop (#96).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants