Skip to content

fix(mavlink_command): allow QGC 5 takeoff command (again)#27899

Open
MaEtUgR wants to merge 3 commits into
mainfrom
maetugr/fix-takeoff-again
Open

fix(mavlink_command): allow QGC 5 takeoff command (again)#27899
MaEtUgR wants to merge 3 commits into
mainfrom
maetugr/fix-takeoff-again

Conversation

@MaEtUgR

@MaEtUgR MaEtUgR commented Jul 14, 2026

Copy link
Copy Markdown
Member

Solved Problem

  1. Start basic PX4 simulation (make px4_sitl sihsim_quadx) and QGC 5.0.8 stable
  2. Press on Takeoff button
  3. Takeoff gets "denied":
    image

Bisection shows #27541 rejects even basic, commonly used commands like takeoff sent by the ground station.

Solution

  1. Solve the basic takeoff case I ran into.
  2. Remove the complicated per vehicle type handling that was only used to break the takeoff command.
  3. Let Claude Code compare command usage in QGC 5 and PX4 main to determine if there are more such basic supported cases that newly get rejected.
Claude output

Confirmed compatibility bugs (fixed)

cmd Issue Fix
NAV_TAKEOFF (22) QGC sends param1=-1 unconditionally on every guided takeoff, for all vehicle types (first commit) override widened to all vehicle types
NAV_WAYPOINT (16) "Pass Radius" (param3) is a plain editable field in the waypoint editor for any vehicle mission mask 0x7B→0x7F
NAV_VTOL_TAKEOFF (84) raw mission-command editor exposes param2 "Transition Heading" mission mask 0x78→0x7A
NAV_VTOL_LAND (85) raw mission-command editor exposes param3 "Approach Alt" mission mask 0x78→0x7C
DO_CHANGE_SPEED (178) mission-item "Offset" (Relative/Absolute) field writes param4 mission mask 0x07→0x0F
DO_LAND_START (189) FW/VTOL Landing Pattern (a commonly-used feature) sets real lat/lon/alt in param5-7 mission mask 0x00→0x70
DO_SET_ROI_WPNEXT_OFFSET (196) mask omitted param5-7, but PX4's own navigator_main.cpp reads them as pitch/roll/yaw offset — this was a bug in the table independent of QGC mission+command mask 0x01→0x71
CONDITION_GATE (4501) Survey/Corridor-Scan complex items can emit real param2 + lat/lon/alt when "condition gate" is enabled mission mask 0x00→0x72

DO_LAND_START and NAV_WAYPOINT are the two I'd flag as most impactful — Landing Pattern is a standard FW/VTOL workflow, so that one alone must have broken most fixed-wing mission uploads from QGC.

Checked, no issue found

NAV_LOITER_UNLIM, NAV_LOITER_TIME, NAV_RETURN_TO_LAUNCH, NAV_LAND, NAV_LOITER_TO_ALT, NAV_ROI (dead/unused by QGC), NAV_DELAY, CONDITION_DELAY/CONDITION_DISTANCE (not offered by QGC for PX4 vehicles at all), DO_SET_MODE (sent as legacy SET_MODE, not validated by this table), DO_JUMP, DO_SET_HOME, DO_SET_ROI_LOCATION, DO_SET_ROI_NONE, DO_SET_ROI (unreachable for PX4), all camera/gripper/autotune/video/image commands, DO_VTOL_TRANSITION, all 5 geofence commands, NAV_RALLY_POINT, DO_WINCH (QGC has no UI for it at all).

Changelog Entry

Fix basic MAVLink commands like takeoff from QGC 5 getting rejected

Test coverage

It fixes the takeoff at least 👀 Ideally #27541 would have been tested once before merging.

Context

Last time #26408 rejected basic commands sent from QGC 5, had to be reverted in #26626 to make PX4 usable again.

@MaEtUgR MaEtUgR self-assigned this Jul 14, 2026
@github-actions github-actions Bot added scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:mavlink MAVLink module, streams, commands, or protocol handling. labels Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: -192 byte (-0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +30  [ = ]       0    .debug_abbrev
  -0.0%      -4  [ = ]       0    .debug_frame
  -0.0%    -673  [ = ]       0    .debug_info
  -0.0%    -317  [ = ]       0    .debug_line
    +250%      +5  [ = ]       0    [Unmapped]
    -0.0%    -322  [ = ]       0    [section .debug_line]
  -0.0%    -269  [ = ]       0    .debug_loclists
  -0.0%     -56  [ = ]       0    .debug_rnglists
    [NEW]      +3  [ = ]       0    [Unmapped]
    -0.0%     -59  [ = ]       0    [section .debug_rnglists]
  -0.0%    -159  [ = ]       0    .debug_str
  +0.8%      +2  [ = ]       0    .shstrtab
  -0.0%     -14  [ = ]       0    .strtab
    [NEW]     +12  [ = ]       0    CSWTCH.1932
    [DEL]     -12  [ = ]       0    CSWTCH.1935
    [NEW]     +12  [ = ]       0    CSWTCH.2546
    [DEL]     -12  [ = ]       0    CSWTCH.2549
    [NEW]     +24  [ = ]       0    CSWTCH.3465
    [NEW]     +24  [ = ]       0    CSWTCH.3466
    [DEL]     -24  [ = ]       0    CSWTCH.3468
    [DEL]     -24  [ = ]       0    CSWTCH.3469
     +25%     +16  [ = ]       0    ___ZN3Ekf20controlGravityFusionERKN9estimator9imuSampleE_veneer
   -32.7%     -16  [ = ]       0    __nxsched_add_prioritized_veneer
    -2.4%      -1  [ = ]       0    mavlink_cmd_params::_find_mask()
    [NEW]     +63  [ = ]       0    mavlink_cmd_params::check_params()
    [DEL]     -76  [ = ]       0    mavlink_cmd_params::check_params_for_vehicle()
  +2.1%    +192  [ = ]       0    [Unmapped]
  -0.0%    -192  -0.0%    -192    .text
    [NEW]     +64  [NEW]     +64    mavlink_cmd_params::check_params()
    [NEW]     +60  [NEW]     +60    CSWTCH.1932
    [NEW]     +42  [NEW]     +42    CSWTCH.2546
    [NEW]     +15  [NEW]     +15    CSWTCH.3465
    [NEW]     +15  [NEW]     +15    CSWTCH.3466
    +2.0%      +4  +2.0%      +4    MavlinkReceiver::handle_message_att_pos_mocap()
    -0.3%      -4  -0.3%      -4    MavlinkReceiver::MavlinkReceiver()
    -1.5%      -4  -1.5%      -4    MavlinkStreamAutopilotStateForGimbalDevice::send()
   -15.4%      -4 -15.4%      -4    MavlinkULog::start_ack_received()
    -1.9%      -8  -1.9%      -8    MavlinkMissionManager::MavlinkMissionManager()
   -15.8%     -12 -15.8%     -12    mavlink_cmd_params::_find_mask()
    [DEL]     -15  [DEL]     -15    CSWTCH.3468
    [DEL]     -15  [DEL]     -15    CSWTCH.3469
    -1.2%     -16  -1.2%     -16    MavlinkMissionManager::parse_mavlink_mission_item()
    -1.0%     -16  -1.0%     -16    MavlinkReceiver::handle_message_command_both<>()
    [DEL]     -42  [DEL]     -42    CSWTCH.2549
   -28.9%     -44 -28.9%     -44    MavlinkMissionManager::update_mission_state()
    [DEL]     -60  [DEL]     -60    CSWTCH.1935
    [DEL]     -64  [DEL]     -64    mavlink_cmd_params::check_params_for_vehicle()
    -3.0%     -88  -3.0%     -88    MavlinkReceiver::run()
  -0.0% -1.43Ki  -0.0%    -192    TOTAL

px4_fmu-v6x [Total VM Diff: -200 byte (-0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +30  [ = ]       0    .debug_abbrev
  -0.0%      -4  [ = ]       0    .debug_frame
  -0.0%    -673  [ = ]       0    .debug_info
  -0.0%    -325  [ = ]       0    .debug_line
   -42.9%      -3  [ = ]       0    [Unmapped]
    -0.0%    -322  [ = ]       0    [section .debug_line]
  -0.0%    -269  [ = ]       0    .debug_loclists
  -0.0%     -56  [ = ]       0    .debug_rnglists
    [NEW]      +3  [ = ]       0    [Unmapped]
    -0.0%     -59  [ = ]       0    [section .debug_rnglists]
  -0.0%    -159  [ = ]       0    .debug_str
  -0.8%      -2  [ = ]       0    .shstrtab
  -0.0%     -14  [ = ]       0    .strtab
    [NEW]     +12  [ = ]       0    CSWTCH.1932
    [DEL]     -12  [ = ]       0    CSWTCH.1935
    [NEW]     +12  [ = ]       0    CSWTCH.2546
    [DEL]     -12  [ = ]       0    CSWTCH.2549
    [NEW]     +24  [ = ]       0    CSWTCH.3465
    [NEW]     +24  [ = ]       0    CSWTCH.3466
    [DEL]     -24  [ = ]       0    CSWTCH.3468
    [DEL]     -24  [ = ]       0    CSWTCH.3469
    -2.4%      -1  [ = ]       0    mavlink_cmd_params::_find_mask()
    [NEW]     +63  [ = ]       0    mavlink_cmd_params::check_params()
    [DEL]     -76  [ = ]       0    mavlink_cmd_params::check_params_for_vehicle()
  +3.4%    +200  [ = ]       0    [Unmapped]
  -0.0%    -200  -0.0%    -200    .text
    [NEW]     +64  [NEW]     +64    mavlink_cmd_params::check_params()
    [NEW]     +60  [NEW]     +60    CSWTCH.1932
    [NEW]     +42  [NEW]     +42    CSWTCH.2546
    [NEW]     +15  [NEW]     +15    CSWTCH.3465
    [NEW]     +15  [NEW]     +15    CSWTCH.3466
    +2.0%      +4  +2.0%      +4    MavlinkReceiver::handle_message_att_pos_mocap()
    -0.3%      -4  -0.3%      -4    MavlinkReceiver::MavlinkReceiver()
    -1.5%      -4  -1.5%      -4    MavlinkStreamAutopilotStateForGimbalDevice::send()
   -115.4%      -4 -115.4%      -4    [1 Others]
    -1.9%      -8  -1.9%      -8    MavlinkMissionManager::MavlinkMissionManager()
    -0.0%      -8  -0.0%      -8    [section .text]
   -15.8%     -12 -15.8%     -12    mavlink_cmd_params::_find_mask()
    [DEL]     -15  [DEL]     -15    CSWTCH.3468
    [DEL]     -15  [DEL]     -15    CSWTCH.3469
    -1.2%     -16  -1.2%     -16    MavlinkMissionManager::parse_mavlink_mission_item()
    -1.0%     -16  -1.0%     -16    MavlinkReceiver::handle_message_command_both<>()
    [DEL]     -42  [DEL]     -42    CSWTCH.2549
   -28.9%     -44 -28.9%     -44    MavlinkMissionManager::update_mission_state()
    [DEL]     -60  [DEL]     -60    CSWTCH.1935
    [DEL]     -64  [DEL]     -64    mavlink_cmd_params::check_params_for_vehicle()
    -3.0%     -88  -3.0%     -88    MavlinkReceiver::run()
  -0.0% -1.44Ki  -0.0%    -200    TOTAL

Updated: 2026-07-14T13:16:50

@MaEtUgR MaEtUgR changed the title Fix QGC 5 takeoff command (again) fix(mavlink_command): allow QGC 5 takeoff command (again) Jul 14, 2026
@github-actions github-actions Bot added the kind:bug Something is broken or behaving incorrectly. label Jul 14, 2026
@MaEtUgR MaEtUgR force-pushed the maetugr/fix-takeoff-again branch from dfe3c12 to 9387c68 Compare July 14, 2026 12:53
@MaEtUgR MaEtUgR force-pushed the maetugr/fix-takeoff-again branch from 9387c68 to 676aa7f Compare July 14, 2026 13:10
@julianoes

Copy link
Copy Markdown
Contributor

I noticed this last night as well, thanks!

@julianoes

Copy link
Copy Markdown
Contributor

So I agree that we need to be compatible with QGC, but also, we need to fix in QGC when it sends something wrong, right? And then add a note explaining it. Why would QGC send -1 for pitch?

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

Labels

kind:bug Something is broken or behaving incorrectly. scope:mavlink MAVLink module, streams, commands, or protocol handling. scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants