fix(commander)!: don't arm on MAV_CMD_MISSION_START (#29345)

MAV_CMD_MISSION_START used to switch to Mission mode and arm the
vehicle in one go (added in #5808). Arming as a side effect of a
"start mission" command is unexpected and can spin up props: the
MAVLink spec never said it arms, and QGC, MAVSDK and the ROS 2
interface library all arm explicitly. DO_LAND_START reuses this
command internally, so it could arm a vehicle on the ground too.

The command now only switches to Mission mode; if disarmed, the
mission starts once the vehicle is armed. This matches the spec
clarification in mavlink/mavlink#2648.

Assisted-by: Claude:claude-opus-5-5

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes authored and GitHub committed 2026-10-26 19:21:59 +13:00
1 parent ae4fd97df8
commit 1c3c7e5a72
3 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -121,7 +121,7 @@ PX4 supports these commands for changing modes on some vehicle types:
- [MAV_CMD_DO_ORBIT](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT) — MC Orbit mode
- [MAV_CMD_NAV_VTOL_TAKEOFF](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_VTOL_TAKEOFF) — VTOL specific takeoff mode
- [MAV_CMD_DO_REPOSITION](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_REPOSITION)
- [MAV_CMD_MISSION_START](https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START) — Starts a mission.
- [MAV_CMD_MISSION_START](https://mavlink.io/en/messages/common.html#MAV_CMD_MISSION_START) — Starts a mission (does not arm the vehicle).
Note that these commands predate "standard modes" and are mapped to vehicle-specific custom modes.
What that means is that even though the standard mode may be applicable to multiple vehicle types, the mode may only work for particular vehicles.
+5
View File
@@ -53,6 +53,11 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
- **`DO_JUMP` can only loop back and its repeat count must fit.**
A mission is now rejected if a `DO_JUMP` targets itself or a later mission item, even if its repeat count is 0, and if its repeat count is negative, above 65535 or not a number (it is no longer narrowed to a different count).
Missions stored on the vehicle with such jumps must be edited and uploaded again.
- **`MAV_CMD_MISSION_START` no longer arms the vehicle.**
The command switches to [Mission mode](../flight_modes_mc/mission.md) at the requested item, and the mission starts once the vehicle is armed.
This also applies to `MAV_CMD_DO_LAND_START`, which uses it internally.
Ground stations and scripts that relied on the command to arm must send `MAV_CMD_COMPONENT_ARM_DISARM` separately (QGroundControl, MAVSDK and the PX4 ROS 2 Interface Library already do).
See the [MAVLink spec clarification](https://github.com/mavlink/mavlink/pull/2648).
- **The primary GNSS receiver defaults to Auto.**
[SENS_GNSS_PRIME](../advanced_config/parameter_reference.md#SENS_GNSS_PRIME) now defaults to `-1` (Auto) instead of `0`, and saved values are not changed: with Auto the moving base of a moving base pair is the primary receiver, and without one, a receiver that passes the strict checks ([GNSS_REQ_EPH](../advanced_config/parameter_reference.md#GNSS_REQ_EPH) and the other `GNSS_REQ_*` parameters) is used, then one with an RTK fixed solution.
To keep preferring the receiver on the main serial port, set `SENS_GNSS_PRIME` to `0`.
+3 -3
View File
@@ -1290,9 +1290,9 @@ Commander::handle_command(const vehicle_command_s &cmd)
// requested first mission item valid
if (PX4_ISFINITE(cmd.param1) && (cmd.param1 >= -1) && (cmd.param1 < _mission_result_sub.get().seq_total)) {
// switch to AUTO_MISSION and ARM
if (_user_mode_intention.change(vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION, getSourceFromCommand(cmd))
&& (TRANSITION_DENIED != arm(arm_disarm_reason_t::mission_start))) {
// Switch to AUTO_MISSION but don't arm: arming is a separate command.
// If disarmed, the mission starts once the vehicle is armed.
if (_user_mode_intention.change(vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION, getSourceFromCommand(cmd))) {
cmd_result = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED;