Skip to content

fix(ArduPlane): Derive GNSS serial protocol from connection (F17) - #2288

Draft
nflyernz wants to merge 2 commits into
ArduPilot:masterfrom
nflyernz:fix/arduplane-gnss-serial-default
Draft

nflyernz wants to merge 2 commits into
ArduPilot:masterfrom
nflyernz:fix/arduplane-gnss-serial-default

Conversation

@nflyernz

@nflyernz nflyernz commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

F17: ArduPlane GNSS serial-port defaults

The AMC 5.0.0 ArduPlane Basic Mandatory Configuration walkthrough found that both generic Plane GNSS templates unconditionally set SERIAL3_PROTOCOL=5. That can change a port without a physical GPS receiver. Serial protocol 5 selects the GPS transport; it is distinct from GPS1_TYPE=5, the NMEA driver.

Remove that hardcoded line from empty_4.7.x/18_gnss.param and normal_plane/18_gnss.param. Plane Step 18 now derives SERIAL1_PROTOCOL through SERIAL9_PROTOCOL as 5 only for the selected UART and a physical serial GPS driver. The firmware-dependent GPS_TYPE and GPS1_TYPE rules are unchanged. The new change reason was added to the generated configuration-step translation strings.

The rules make no serial assignment for None, DroneCAN, MAVLink, MSP, HIL, or ExternalAHRS. No baud rate is inferred.

Validation

  • Focused pytest: 83 passed (Plane GNSS regression, configuration-step schema, configuration-strings BDD).
  • Ruff check and format, focused Pylint (10.00/10), targeted ty check, and git diff --check: passed.
  • Regression tests cover both templates; physical GPS on SERIAL2/3/4; nonserial and special transports; both firmware driver rules; saved serial values and eligible FC import; connection rename; and display of a newly derived parameter after step load.

Inline editor follow-up and dependency

Commit 928697ad11e3e6f fixes the GNSS inline rename exception. Forced, derived, and F17 rule-owned serial destinations are left to their owning rules. Regression tests cover saved GNSS port changes, special transports, repeated changes, and final export.

Validation: 432 focused tests passed, with Ruff, focused Pylint, targeted ty, and git diff --check passing.

Remaining dependency: Changing from None to a physical GNSS UART while Step 18 is open requires the shared inline derived-parameter refresh correction in #2289. Until integrated, reloading the step makes the newly derived parameter available.

No physical flight controller was used. Leave this PR in draft for upstream CI and automated review.

Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
@amilcarlucas amilcarlucas added the AIReview Request an automated AI review; picked up by the reviewprs sweep label Oct 27, 2026
@AP-Review

AP-Review commented Oct 27, 2026 •

Copy link
Copy Markdown

Deprecated — see below for the updated review.

Previous review (2026-10-27)

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: REQUEST CHANGES

Reviewed at head 3b807d0b8a.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/methodicconfigurator/2288/1.html#prMethodicConfigurator-2288

Requesting changes: the new derived GNSS serial rules are correct when evaluated, but they break the inline GNSS connection edit on step 18.

Blocking

  1. configuration_steps_ArduPlane.json:598: projects whose 18_gnss.param already has a SERIALn_PROTOCOL now raise ParameterForcedOrDerivedError when the GNSS port is changed in the inline editor. That covers every project made from the old Plane templates, and new projects once step 18 has been saved. The cause is that _apply_gnss_protocol_value calls set_new_value on the now-derived rename target. The table is not refreshed and the rename is left half-done. Skip forced/derived targets there, since the rule already gives 5, and add an inline-refresh test with a saved SERIAL3_PROTOCOL.

Should fix

  • empty_4.7.x/18_gnss.param:7 (same for normal_plane): with the template row gone, an inline port change from SERIAL3 to SERIAL4 keeps and saves SERIAL3_PROTOCOL=5 and never adds SERIAL4_PROTOCOL. Base renamed it correctly. refresh_current_step_computed_parameters needs to add newly derived rows and drop stale added ones, or the template should keep a row for the rename to move.

Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: COMMENT

Reviewed at head 928697ad11.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/methodicconfigurator/2288/2.html#prMethodicConfigurator-2288

No blockers remain; one should-fix depends on #2289 landing first.

Since the last review, the ParameterForcedOrDerivedError on inline GNSS port changes with a saved SERIALn_PROTOCOL is fixed by the new guard, and tests now cover it.

Should fix

Minor (1)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIReview Request an automated AI review; picked up by the reviewprs sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants