Component Definition File

A component information file is an XML file that describes the custom settings of a MAVLink component (like a gimbal or companion computer).

The location of the file can be requested from a component. Usually the component hosts the file and distributes it using MAVLink FTP.

The settings themselves can be queried and set using MAVLink Parameters (a GCS client may use the file to generate a settings UI).

The component definition file mechanism is based on the camera definition file, and therefore very similar.

Discovery Mechanism

The ground station must first discover all components on the network by broadcasting the command MAV_CMD_REQUEST_MESSAGE (specifying the COMPONENT_INFORMATION message). All components should respond with COMPONENT_INFORMATION.

The COMPONENT_INFORMATION.component_definition_uri field contains the definition file URL. Typically this is a MAVLink FTP URL address (i.e. the component itself), but it might also be an address on the Internet.

Example Definition File

This is an example of a gimbal component definition file that defines a single custom parameter:

<?xml version="1.0" encoding="UTF-8" ?>
<mavlinkcomponent>
    <definition version="7">
        <model>Supergimbal 1000</model>
        <vendor>Gimbal king</vendor>
    </definition>
    <parameters>
        <parameter name="MAX_PAN_RATE" type="int32" default="60" min="1" max="360" step="1">
            <description>Max pan angular rate in degrees per second</description>
        </parameter>
    <localization>
        <locale name="de_DE">
            <strings original="Max pan angular rate in degrees per second" translated="Maximale Schwenkgeschwindigkeit in Grad pro Sekunde" />
        </locale>
    </localization
<mavlinkcomponent>

Parameter

For the example above, the parameter MAX_PAN_RATE can be set using the PARAM_EXT parameter protocol (for more information, check the camera definition).

File Compression

In order to save flash space on the component and during transfer, the file can be compressed using gzip. If the URL of the definition file ends with .xml.gz it is the gzip compressed stream of the text file.

The file stream is compressed but it is not an archive like .zip or .tar.gz (so there is no folder structure).

results matching ""

    No results matching ""