PX4 custom mode list: align with PX4 definition - #14540
Conversation
52910a0 to
b9e8367
Compare
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 25 passed, 0 skipped Code CoverageCoverage: 66.3% No baseline available for comparison Artifact Sizes
Updated: 2026-07-06 18:29:43 UTC • Commit: 6abfa8a • Triggered by: Android |
b9e8367 to
57989e3
Compare
57989e3 to
602de9c
Compare
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (12.90%) is below the target coverage (30.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #14540 +/- ##
==========================================
+ Coverage 25.47% 30.64% +5.17%
==========================================
Files 769 785 +16
Lines 65912 66787 +875
Branches 30495 30944 +449
==========================================
+ Hits 16788 20467 +3679
+ Misses 37285 32391 -4894
- Partials 11839 13929 +2090
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 435 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
| PX4_CUSTOM_SUB_MODE_AUTO_PRECLAND = 9, | ||
| PX4_CUSTOM_SUB_MODE_AUTO_VTOL_TAKEOFF = 10, | ||
| PX4_CUSTOM_SUB_MODE_GUIDED_COURSE = 11, | ||
| }; |
| AUTO_TAKEOFF = PX4_CUSTOM_MAIN_MODE_AUTO <<16 | (PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF << 24 ), | ||
| AUTO_VTOL_TAKEOFF = PX4_CUSTOM_MAIN_MODE_AUTO <<16 | (PX4_CUSTOM_SUB_MODE_AUTO_VTOL_TAKEOFF << 24 ), | ||
| AUTO_GUIDED_COURSE = PX4_CUSTOM_MAIN_MODE_AUTO <<16 | (PX4_CUSTOM_SUB_MODE_GUIDED_COURSE << 24 ), |
- 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.
69a5c94 to
6abfa8a
Compare
Replaces #14359.
Aligns the PX4 custom flight mode list baked into QGC with the current PX4 definitions.
Description
PX4_CUSTOM_MAIN_MODE,PX4_CUSTOM_SUB_MODE_AUTOandPX4_CUSTOM_SUB_MODE_POSCTLnow have explicit numeric values. These are a wire contract with PX4 firmware and must not depend on enum auto-increment ordering.Unknown).AUTO_RTGSsub-mode in 2020, but QGC still displayed "Return to Groundstation". Slot 7 is now an explicit reserved/do-not-use placeholder.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).CustomFirmwarePlugin::updateAvailableFlightModes()now calls the basePX4FirmwarePluginimplementation and only narrowscanBeSet, rather than duplicating the airframe switch logic (which had already drifted out of sync).Type of Change
Testing
Flight Stacks Tested
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).