Arming and Disarming

This page explains how MAVLink can be used by a ground station or companion computer to arm or disarm a vehicle. The user wiki page for arming and disarming is here.

MAV_CMD_COMPONENT_ARM_DISARM within COMMAND_LONG

Attempt to arm or disarm the vehicle by sending a COMMAND_LONG with the command, param1 and param2 fields set as specified for the MAV_CMD_COMPONENT_ARM_DISARM command.

Command Field Type Description
target_system uint8_t System ID
target_component uint8_t Component ID of flight controller or just 0
command uint16_t MAV_CMD_COMPONENT_ARM_DISARM=400
confirmation uint8_t 0
param1 float 0:disarm, 1:arm
param2 float 0: arm-disarm unless prevented by safety checks, 21196: force arming or disarming
param3 float not used
param4 float not used
param5 float not used
param6 float not used
param7 float not used

Example

The example commands below can be copy-pasted into MAVProxy (aka SITL) to test this command. Before running these commands enter, “module load message”

Example MAVProxy/SITL Command

Description

message COMMAND_LONG 0 0 400 0 1 0 0 0 0 0 0

arm the vehicle (may fail because of arming checks)

message COMMAND_LONG 0 0 400 0 1 21196 0 0 0 0 0

force arm the vehicle (try to bypass arming checks)

message COMMAND_LONG 0 0 400 0 0 0 0 0 0 0 0

disarm the vehicle (may fail if not landed)

message COMMAND_LONG 0 0 400 0 0 21196 0 0 0 0 0

force disarm the vehicle even if flying