AeroCoder Logo

Microservices (Protocols)

Parameter protocol

PARAM_VALUE, PARAM_SET, and the read-all / read-single flows autopilots expose.

The parameter protocol lets a GCS read and write the hundreds of tuning values an autopilot exposes (PID gains, failsafe thresholds, sensor calibrations). Parameters are identified by a 16-character string ID and carry a float or int32 value.

To read all parameters, the GCS sends PARAM_REQUEST_LIST and the autopilot streams back PARAM_VALUE messages for every parameter. To read one, send PARAM_REQUEST_READ with the ID or index. To write, send PARAM_SET and wait for the echoed PARAM_VALUE.

python

# Pymavlink: read and set a parameter
conn.mav.param_request_read_send(
    conn.target_system, conn.target_component,
    b"ARMING_CHECK", -1
)
msg = conn.recv_match(type="PARAM_VALUE", blocking=True, timeout=3)
print(f"{msg.param_id} = {msg.param_value}")

# Set a new value
conn.mav.param_set_send(
    conn.target_system, conn.target_component,
    b"ARMING_CHECK", 0, mavutil.mavlink.MAV_PARAM_TYPE_INT32
)

Robustness

Parameters can be lost on noisy links. The GCS should track which indices have been received and re-request missing ones. The param_count and param_index fields in PARAM_VALUE enable gap detection.

← Previous

Mission protocol

Next →

Command protocol

Edit this page on mavlink.io ↗

On This Page

Robustness

© 2024 AeroCoder. All rights reserved

TwitterYouTubeInstagram