MAVLink user commands

This page documents how the Skybrush firmware uses user-defined MAVLink command codes like MAV_CMD_USER_1 and MAV_CMD_USER_2.

MAV_CMD_USER_1

The param1 field of the command is set as follows:

  • 0 reloads the current show from the internal storage (typically an SD card)

  • 1 clears the current show, also removing the copy from the internal storage

  • 2 triggers the test of the pyro payload. param2 is the index of the first channel to test (zero-based). param3 is the number of channels to test; zero means all channels starting from the channel in param2. param4 is the delay between consecutive channel tests, in seconds.

  • 3 executes another COMMAND_INT command if and only if the group index of the drone (i.e. its SHOW_GROUP parameter) is set to a specific value. param6 contains the real command code to execute in its lower 16 bits, while bits 30:16 (inclusive) contain the group index plus one, zero meaning "all groups". The MSB of param6 (sign bit) must be zero. We reserve the right to repurpose high bits in future versions and sacrifice higher group indices. param7 of the command is remapped to param1 of the injected command, while param7 in the injected command is always zero.

MAV_CMD_USER_2

Sets the show origin, orientation and AMSL reference in a single command. Supported only with COMMAND_INT MAVLink packets only to avoid floating-point rounding issues. param4 is the orientation in degrees. param5 and param6 are the latitude and longitude of the show origin (in 10-7 degrees). param7 is the AMSL altitude reference (in millimeters). When param7 is less than -9999999, it is ignored and the show will be controlled based on AGL only (which should be used only for non-RTK setups).