Skip to content

PX4 custom mode list: align with PX4 definition#14540

Open
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:px4-flight-mode-align
Open

PX4 custom mode list: align with PX4 definition#14540
DonLakeFlyer wants to merge 1 commit into
mavlink:masterfrom
DonLakeFlyer:px4-flight-mode-align

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Replaces #14359.

Aligns the PX4 custom flight mode list baked into QGC with the current PX4 definitions.

Description

  • Pin enum values. PX4_CUSTOM_MAIN_MODE, PX4_CUSTOM_SUB_MODE_AUTO and PX4_CUSTOM_SUB_MODE_POSCTL now have explicit numeric values. These are a wire contract with PX4 firmware and must not depend on enum auto-increment ordering.
  • Add missing modes. QGC now knows about Position Slow, Altitude Cruise, Termination, VTOL Takeoff and Guided Course (e.g. "Termination" previously showed as Unknown).
  • Remove phantom AUTO_RTGS. PX4 deleted the AUTO_RTGS sub-mode in 2020, but QGC still displayed "Return to Groundstation". Slot 7 is now an explicit reserved/do-not-use placeholder.
  • Classify new modes. updateAvailableFlightModes() now assigns fixed wing / multi rotor flags for the new modes instead of letting them fall through to struct defaults (this also keeps the two switches exhaustive, avoiding -Wswitch).
  • Simplify custom-example. CustomFirmwarePlugin::updateAvailableFlightModes() now calls the base PX4FirmwarePlugin implementation and only narrows canBeSet, rather than duplicating the airframe switch logic (which had already drifted out of sync).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • Builds clean locally (no errors/warnings on the four changed files)

Flight Stacks Tested

  • PX4 (mode list updated to match PX4; runtime spot-check still recommended)

By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

Copilot AI review requested due to automatic review settings June 16, 2026 16:46

This comment was marked as resolved.

This comment was marked as low quality.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

⚠️ Build results unavailable — artifact download from one or more platform workflows failed (likely artifact retention expiry or transient API error). The combined report cannot be generated for this run.

See the Build Results workflow run for details.

@DonLakeFlyer DonLakeFlyer force-pushed the px4-flight-mode-align branch from b9e8367 to 57989e3 Compare June 16, 2026 21:13
@github-actions github-actions Bot added the Tests label Jun 16, 2026
- Pin explicit numeric values to PX4_CUSTOM_MAIN_MODE / SUB_MODE enums so the
  wire contract no longer depends on auto-increment ordering.
- Add the modes QGC was missing: Position Slow, Altitude Cruise, Termination,
  VTOL Takeoff and Guided Course.
- Remove the phantom "Return to Groundstation" (AUTO_RTGS) mode; PX4 deleted
  this sub-mode in 2020. Slot 7 is now reserved/do-not-use.
- Classify the new modes for fixed wing / multi rotor in
  updateAvailableFlightModes() so they aren't left at struct defaults.
- Simplify the custom-example override to call the base implementation and only
  narrow canBeSet, instead of duplicating the airframe switch logic.
@DonLakeFlyer DonLakeFlyer force-pushed the px4-flight-mode-align branch from 57989e3 to 602de9c Compare June 17, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants