Skip to content

PX4 custom mode list: align with PX4 definition#14359

Open
sfuhrer wants to merge 1 commit into
mavlink:masterfrom
sfuhrer:patch-1
Open

PX4 custom mode list: align with PX4 definition#14359
sfuhrer wants to merge 1 commit into
mavlink:masterfrom
sfuhrer:patch-1

Conversation

@sfuhrer
Copy link
Copy Markdown

@sfuhrer sfuhrer commented May 11, 2026

Align PX4 custom modes backed into QGC with PX4 definitions.

Description

E.g. the PX4 mode "Termination" is not displayed in QGC.
image

Untested.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/Build changes
  • Other

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Tested with hardware

Platforms Tested

  • Linux
  • Windows
  • macOS
  • Android
  • iOS

Flight Stacks Tested

  • PX4
  • ArduPilot

Screenshots

Checklist

  • I have read the Contribution Guidelines
  • I have read the Code of Conduct
  • My code follows the project's coding standards
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally

Related Issues


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).

Align PX4 custom modes backed into QGC with PX4 definitions.
Copilot AI review requested due to automatic review settings May 11, 2026 09:58
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your first pull request! 🎉

A maintainer will review this soon. Please ensure:

  • CI checks pass
  • Code follows coding standards
  • Changes tested on relevant platforms

We appreciate your contribution to QGroundControl!

@sfuhrer sfuhrer changed the title Update px4_custom_mode.h PX4 custom mode list: align with PX4 definition May 11, 2026
@sfuhrer
Copy link
Copy Markdown
Author

sfuhrer commented May 11, 2026

@bkueng @MaEtUgR fyi.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates QGroundControl’s PX4 custom mode definitions (px4_custom_mode.h) to better match PX4’s upstream mode/sub-mode enumerations, aiming to improve flight mode decoding (e.g., displaying PX4 “Termination” instead of “Unknown”).

Changes:

  • Extended PX4_CUSTOM_MAIN_MODE with additional main modes (Termination, Altitude Cruise) and updated the Rattitude naming.
  • Updated PX4_CUSTOM_SUB_MODE_AUTO to replace deleted RTGS with a reserved value and added VTOL takeoff + EXTERNAL1..8 sub-modes.
  • Added additional POSCTL sub-mode(s) (e.g., SLOW) and normalized indentation.

PX4_CUSTOM_MAIN_MODE_STABILIZED,
PX4_CUSTOM_MAIN_MODE_RATTITUDE,
PX4_CUSTOM_MAIN_MODE_SIMPLE /* unused, but reserved for future use */
PX4_CUSTOM_MAIN_MODE_RATTITUDE_LEGACY,
PX4_CUSTOM_SUB_MODE_AUTO_RTL,
PX4_CUSTOM_SUB_MODE_AUTO_LAND,
PX4_CUSTOM_SUB_MODE_AUTO_RTGS,
PX4_CUSTOM_SUB_MODE_AUTO_RESERVED_DO_NOT_USE, // was PX4_CUSTOM_SUB_MODE_AUTO_RTGS, deleted 2020-03-05
Comment on lines +13 to +16
PX4_CUSTOM_MAIN_MODE_RATTITUDE_LEGACY,
PX4_CUSTOM_MAIN_MODE_SIMPLE, /* unused, but reserved for future use */
PX4_CUSTOM_MAIN_MODE_TERMINATION,
PX4_CUSTOM_MAIN_MODE_ALTITUDE_CRUISE
Comment on lines 40 to +43
enum PX4_CUSTOM_SUB_MODE_POSCTL {
PX4_CUSTOM_SUB_MODE_POSCTL_POSCTL = 0,
PX4_CUSTOM_SUB_MODE_POSCTL_ORBIT
PX4_CUSTOM_SUB_MODE_POSCTL_POSCTL = 0,
PX4_CUSTOM_SUB_MODE_POSCTL_ORBIT,
PX4_CUSTOM_SUB_MODE_POSCTL_SLOW
@github-actions
Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Failed View
Windows Failed View
MacOS Failed View
Android Failed View

Some builds failed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 4 passed, 44 failed, 7 skipped.


Updated: 2026-05-11 10:42:09 UTC • Triggered by: Android

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants