Files
PX4-Autopilot/docs/en/camera/mavlink_v1_camera.md
Julian Oes afa97475f0 feat(camera_feedback): gate CAMERA_IMAGE_CAPTURED by param (#27920)
* feat(camera_feedback): gate CAMERA_IMAGE_CAPTURED by param

Some cameras implementing the MAVLink Camera Protocol (e.g. reached via
TRIG_INTERFACE=MAVLink) report CAMERA_IMAGE_CAPTURED themselves. The
autopilot's camera_feedback also emitted this message, so the ground
station saw duplicate capture messages for every shot.

Add a bool 'report' field to the camera_capture message, set from the new
CAM_CAP_REPORT parameter, and gate the CAMERA_IMAGE_CAPTURED stream on it.
When reporting is disabled the capture is still published and logged for
geotagging; only the MAVLink message to the ground station is suppressed.

CAM_CAP_REPORT applies live (no reboot); it only gates a MAVLink message,
unlike CAM_CAP_FBACK which reconfigures the capture pin.

* fix(camera_feedback): update docs
2026-07-22 20:03:50 +12:00

7.6 KiB

Simple MAVLink Cameras (Camera Protocol v1)

This topic explains how to use PX4 with a MAVLink camera that implements the Camera Protocol v1 (Simple Trigger Protocol) with PX4 and a Ground Station.

::: warning MAVLink cameras that use the MAVLink Camera Protocol v2 should be used instead when possible! This approach is retained for use with older MAVLink cameras. :::

Overview

Camera Protocol v1 defines a small set of commands that allow triggering of a camera for:

  • still image capture at a frequency based on either time or distance
  • video capture
  • limited camera configuration

PX4 supports this command set for triggering cameras with native support for the protocol (as described in this topic), and also for cameras attached to flight controller outputs.

Ground stations and MAVLink SDKs generally address camera commands to the autopilot, which then forwards them to a connected MAVLink channel of type onboard. PX4 also re-emits any camera mission items it encounters in a mission as camera commands: commands that aren't accepted are logged. In all cases the commands are sent with the system id of the autopilot and the component ID of 0 (i.e. addressed to all components, including cameras).

PX4 will also emit a CAMERA_TRIGGER whenever an image capture is triggered (the camera itself may also emit this message on triggering).

Controlling the Camera

The Camera Protocol v1 (Simple Trigger Protocol) defines the following commands:

A MAVLink camera will support some subset of these commands. As the protocol has no feature discovery process, the only way to know is by inspecting the COMMAND_ACK returned in response.

Cameras should also emit CAMERA_TRIGGER each time an image is captured.

Camera Protocol v1 describes the protocol in more detail.

Ground Stations

Ground stations can use any commands in the Camera Protocol v1 (Simple Trigger Protocol) and should address them to the autopilot component id. If the commands are not supported by the camera, it will return a COMMAND_ACK with an error result.

Generally the commands are addressed to the autopilot, because this works whether the camera is connected via MAVLink or directly to the flight controller. If addressed to the autopilot PX4 will emit CAMERA_TRIGGER each time an image is captured, and may log the camera capture event.

In theory you might also address commands to the camera directly.

Camera Commands in Missions

The following Camera Protocol v1 (Simple Trigger Protocol) commands can be used in missions (this is the same list as above).

PX4 re-emits them with the same system ID as the autopilot and component ID of MAV_COMP_ID_ALL:

Manual Control

Manual triggering using these cameras is not supported (for either Joystick or RC Controllers).

PX4 Configuration

Connect PX4 to your MAVLink camera by attaching it to an unused serial port on your flight controller, such as TELEM2. You can then configure the port as a MAVLink Peripheral. The document explains how, but in summary:

  1. Modify an unused MAV_n_CONFIG parameter, such as MAV_2_CONFIG, so that it is assigned to port to which your camera is connected.
  2. Set the corresponding MAV_2_MODE to 2 (Onboard). This ensures that the right set of MAVLink messages are emitted and forwarded.
  3. You may need to set some of the other parameters, depending on your connection - such as the baud rate.

Then connect and configure the camera as recommended in its user guide.

Camera Mode & Triggering

Configure the PX4 camera driver to enable the MAVLink camera backend, and set the triggering mode to capture on command in survey missions.

Using QGroundControl:

::: info You can also set the parameters directly:

:::

Capture Reporting

Some MAVLink cameras emit CAMERA_IMAGE_CAPTURED themselves each time an image is captured. By default PX4 emits this message for every capture as well, so a ground station would see each capture reported twice.

Set CAM_CAP_REPORT to 0 to stop PX4 reporting captures, leaving the camera as the only source of the message. Captures are still logged for geotagging when reporting is disabled.