AeroCoder Logo

Messages and Commands

MAV_CMD command reference

Key commands for arm, takeoff, land, reposition, and mission control.

MAV_CMD values are the verbs of MAVLink. They are sent inside COMMAND_LONG or COMMAND_INT messages and cover everything from arming to camera triggers. Each command has up to 7 float parameters (param1–param7).

text

Frequently used MAV_CMDs
─────────────────────────────────────────────────────────────
ID      Name                     Description
─────   ─────────────────────    ────────────────────────────
400     MAV_CMD_COMPONENT_ARM    Arm / disarm motors
        _DISARM                  param1: 1=arm, 0=disarm
22      MAV_CMD_NAV_TAKEOFF      Takeoff to altitude
                                 param7: altitude (m)
21      MAV_CMD_NAV_LAND         Land at current position
20      MAV_CMD_NAV_RETURN       Return to launch point
        _TO_LAUNCH
176     MAV_CMD_DO_SET_MODE      Set flight mode
                                 param1: base mode
                                 param2: custom mode
2600    MAV_CMD_CONTROL          Relinquish or take control
        _HIGH_LATENCY            for high-latency links
31010   MAV_CMD_DO_GIMBAL       Point gimbal (v2 protocol)
        _MANAGER_PITCHYAW        param1–2: pitch/yaw

ACK flow

After sending a COMMAND_LONG, wait for COMMAND_ACK. The result field tells you: ACCEPTED (0), TEMPORARILY_REJECTED (1), DENIED (2), UNSUPPORTED (3), FAILED (4), IN_PROGRESS (5), or CANCELLED (6). Retry on timeout — the GCS is responsible for retransmission.

← Previous

Heartbeat and connection management

Next →

System and component IDs

Edit this page on mavlink.io ↗

On This Page

ACK flow

© 2024 AeroCoder. All rights reserved

TwitterYouTubeInstagram