PX4 custom mode list: align with PX4 definition#14540
Open
DonLakeFlyer wants to merge 1 commit into
Open
Conversation
52910a0 to
b9e8367
Compare
Contributor
|
See the Build Results workflow run for details. |
b9e8367 to
57989e3
Compare
- 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.
57989e3 to
602de9c
Compare
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.
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).