Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr move param transaction protocol #279

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 96 additions & 58 deletions message_definitions/v1.0/auterion.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<dialect>0</dialect>
<enums>
<enum name="MAV_CMD">
<entry value="900" name="MAV_CMD_PARAM_TRANSACTION" hasLocation="false" isDestination="false">
<description>Request to start or end a parameter transaction. Multiple kinds of transport layers can be used to exchange parameters in the transaction (param, param_ext and mavftp). The command response can either be a success/failure or an in progress in case the receiving side takes some time to apply the parameters.</description>
<param index="1" label="Action" enum="PARAM_TRANSACTION_ACTION">Action to be performed (start, commit, cancel, etc.)</param>
<param index="2" label="Transport" enum="PARAM_TRANSACTION_TRANSPORT">Possible transport layers to set and get parameters via mavlink during a parameter transaction.</param>
<param index="3" label="Transaction ID">Identifier for a specific transaction.</param>
</entry>
<entry value="2006" name="MAV_CMD_CAMERA_TRACK_OBJECT" hasLocation="false" isDestination="false">
<wip/>
<!-- This message is work-in-progress and it can therefore change. It should NOT be used in stable production environments. -->
Expand Down Expand Up @@ -88,60 +94,39 @@
<description>Decision to deny the handoff request and keep control ownership.</description>
</entry>
</enum>
<!-- Transactions for parameter protocol -->
<enum name="PARAM_TRANSACTION_TRANSPORT">
<description>Possible transport layers to set and get parameters via mavlink during a parameter transaction.</description>
<entry value="0" name="PARAM_TRANSACTION_TRANSPORT_PARAM">
<description>Transaction over param transport.</description>
</entry>
<entry value="1" name="PARAM_TRANSACTION_TRANSPORT_PARAM_EXT">
<description>Transaction over param_ext transport.</description>
</entry>
</enum>
<enum name="PARAM_TRANSACTION_ACTION">
<description>Possible parameter transaction actions.</description>
<entry value="0" name="PARAM_TRANSACTION_ACTION_START">
<description>Commit the current parameter transaction.</description>
</entry>
<entry value="1" name="PARAM_TRANSACTION_ACTION_COMMIT">
<description>Commit the current parameter transaction.</description>
</entry>
<entry value="2" name="PARAM_TRANSACTION_ACTION_CANCEL">
<description>Cancel the current parameter transaction.</description>
</entry>
</enum>
</enums>
<messages>
<message id="13000" name="MOTOR_INFO">
<description> Contains information about a motor. </description>
<field type="uint8_t" name="index"> Motor index number starting with index 1. 0 if unknown. </field>
<field type="uint8_t" name="type"> The type of motor, TODO: define an enum </field>
<field type="uint64_t" name="total_time" units="s"> Total accumulated usage time</field>
<field type="int16_t" name="temperature" units="cdegC" invalid="INT16_MAX">Temperature of motor. INT16_MAX if unknown.</field>
</message>
<message id="13441" name="CONTROL_STATUS">
<description>Status message indicating the currently active flight control and payload control entity.
This message should typically be send from the system at a low frequency as well as after a control ownership change to all connected GCS.
</description>
<field type="uint8_t" name="current_flight_controller" enum="CURRENT_CONTROL_ENTITY">Current flight control entity.</field>
<field type="uint8_t" name="current_payload_controller" enum="CURRENT_CONTROL_ENTITY">Current payload control entity.</field>
</message>
<message id="13442" name="REQUEST_CONTROL">
<description>Request the flight control and/or the payload control of the target system by a GCS.
The message can be used in a multi GCS environment. A GCS can request the control ownership of the target system.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to change to own ownership.</field>
<field type="uint8_t" name="request_priority" default="0">Priority of the control request. If the priority is higher than the priority
of the current control entity, control is given without handoff request.
The priority request should be authenticated on the target system before granting this privilegs. Default value of 0.</field>
<field type="char[40]" name="requester_id">Identification of the control entity requesting ownership.</field>
<field type="char[100]" name="reason">Reason for taking ownership.</field>
</message>
<message id="13443" name="REQUEST_CONTROL_ACK">
<description>Error code response of the target system to the control ownership request.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target which was processed.</field>
<field type="uint8_t" name="error_code" enum="CONTROL_REQUEST_ERROR_CODE">Error code response.</field>
</message>
<message id="13444" name="RELEASE_CONTROL">
<description>Release the previously aquired control.
The message can be used in a multi GCS environment to release the control of the target system.
This message is ignored when the GCS is not the current active control entity of the control target.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to release own ownership.</field>
</message>
<message id="13445" name="REQUEST_HANDOFF">
<description>Request handoff of current control entity.
This message is send from the system to the current active control entity to request the handoff of the control target to another GCS.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to handoff control ownership.</field>
<field type="char[40]" name="requester_id">Identification of the control entity requesting ownership.</field>
<field type="char[100]" name="reason">Reason from the control entity requesting ownership.</field>
</message>
<message id="13446" name="HANDOFF_RESPOND">
<description>Handoff response to handoff request.
This message is the response from the GCS in control to the handoff request.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to handoff.</field>
<field type="uint8_t" name="handoff_decision" enum="HANDOFF_DECISION">Control target decision.</field>
<!-- Transactions for parameter protocol -->
<message id="19" name="PARAM_ACK_TRANSACTION">
<description>Response from a PARAM_SET message when it is used in a transaction.</description>
<field type="uint8_t" name="target_system">Id of system that sent PARAM_SET message.</field>
<field type="uint8_t" name="target_component">Id of system that sent PARAM_SET message.</field>
<field type="char[16]" name="param_id">Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string</field>
<field type="float" name="param_value">Parameter value (new value if PARAM_ACCEPTED, current value otherwise)</field>
<field type="uint8_t" name="param_type" enum="MAV_PARAM_TYPE">Parameter type.</field>
<field type="uint8_t" name="param_result" enum="PARAM_ACK">Result code.</field>
</message>
<message id="447" name="BEACON_POSITION">
<description>Position of and distance to a Beacon.
Expand Down Expand Up @@ -183,12 +168,6 @@
<field type="uint32_t" name="cps">Detector value scaled by factor</field>
<field type="float" name="dt" units="s">delta-t integration period</field>
</message>
<message id="13470" name="UNIQUE_IDENTIFIER">
<description>Unique identifier message to uniquely identify different GCS and systems using an 256 bit uuid. The uuid can be randomly generated an stored for the relevant systems.
Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=13470.
</description>
<field type="char[32]" name="uuid">uuid of the sender.</field>
</message>
<message id="500" name="TRACKER_STATUS">
<wip/>
<!-- This message is work-in-progress and it can therefore change. It should NOT be used in stable production environments. -->
Expand Down Expand Up @@ -227,5 +206,64 @@
<field type="uint16_t[10]" name="axis_value" invalid="[UINT16_MAX]">Value of each joystick axis</field>
<field type="uint8_t[20]" name="button_value" invalid="[UINT8_MAX]">Value of each joystick button</field>
</message>
<message id="13000" name="MOTOR_INFO">
<description> Contains information about a motor. </description>
<field type="uint8_t" name="index"> Motor index number starting with index 1. 0 if unknown. </field>
<field type="uint8_t" name="type"> The type of motor, TODO: define an enum </field>
<field type="uint64_t" name="total_time" units="s"> Total accumulated usage time</field>
<field type="int16_t" name="temperature" units="cdegC" invalid="INT16_MAX">Temperature of motor. INT16_MAX if unknown.</field>
</message>
<message id="13441" name="CONTROL_STATUS">
<description>Status message indicating the currently active flight control and payload control entity.
This message should typically be send from the system at a low frequency as well as after a control ownership change to all connected GCS.
</description>
<field type="uint8_t" name="current_flight_controller" enum="CURRENT_CONTROL_ENTITY">Current flight control entity.</field>
<field type="uint8_t" name="current_payload_controller" enum="CURRENT_CONTROL_ENTITY">Current payload control entity.</field>
</message>
<message id="13442" name="REQUEST_CONTROL">
<description>Request the flight control and/or the payload control of the target system by a GCS.
The message can be used in a multi GCS environment. A GCS can request the control ownership of the target system.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to change to own ownership.</field>
<field type="uint8_t" name="request_priority" default="0">Priority of the control request. If the priority is higher than the priority
of the current control entity, control is given without handoff request.
The priority request should be authenticated on the target system before granting this privilegs. Default value of 0.</field>
<field type="char[40]" name="requester_id">Identification of the control entity requesting ownership.</field>
<field type="char[100]" name="reason">Reason for taking ownership.</field>
</message>
<message id="13443" name="REQUEST_CONTROL_ACK">
<description>Error code response of the target system to the control ownership request.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target which was processed.</field>
<field type="uint8_t" name="error_code" enum="CONTROL_REQUEST_ERROR_CODE">Error code response.</field>
</message>
<message id="13444" name="RELEASE_CONTROL">
<description>Release the previously aquired control.
The message can be used in a multi GCS environment to release the control of the target system.
This message is ignored when the GCS is not the current active control entity of the control target.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to release own ownership.</field>
</message>
<message id="13445" name="REQUEST_HANDOFF">
<description>Request handoff of current control entity.
This message is send from the system to the current active control entity to request the handoff of the control target to another GCS.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to handoff control ownership.</field>
<field type="char[40]" name="requester_id">Identification of the control entity requesting ownership.</field>
<field type="char[100]" name="reason">Reason from the control entity requesting ownership.</field>
</message>
<message id="13446" name="HANDOFF_RESPOND">
<description>Handoff response to handoff request.
This message is the response from the GCS in control to the handoff request.
</description>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to handoff.</field>
<field type="uint8_t" name="handoff_decision" enum="HANDOFF_DECISION">Control target decision.</field>
</message>
<message id="13470" name="UNIQUE_IDENTIFIER">
<description>Unique identifier message to uniquely identify different GCS and systems using an 256 bit uuid. The uuid can be randomly generated an stored for the relevant systems.
Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=13470.
</description>
<field type="char[32]" name="uuid">uuid of the sender.</field>
</message>
</messages>
</mavlink>
8 changes: 3 additions & 5 deletions message_definitions/v1.0/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,6 @@
<param index="1" label="Tag" minValue="0" increment="1">Target tag to jump to.</param>
<param index="2" label="Repeat" minValue="0" increment="1">Repeat count.</param>
</entry>
<!-- entry value 900 reserved for MAV_CMD_PARAM_TRANSACTION (development.xml) -->
<entry value="1000" name="MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW" hasLocation="false" isDestination="false">
<description>Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate. </description>
<param index="1" label="Pitch angle" units="deg" minValue="-180" maxValue="180">Pitch angle (positive to pitch up, relative to vehicle for FOLLOW mode, relative to world horizon for LOCK mode).</param>
Expand Down Expand Up @@ -3925,7 +3924,7 @@
</entry>
</enum>
<enum name="PARAM_ACK">
<description>Result from PARAM_EXT_SET message (or a PARAM_SET within a transaction).</description>
<description>Result from PARAM_EXT_SET message.</description>
<entry value="0" name="PARAM_ACK_ACCEPTED">
<description>Parameter value ACCEPTED and SET</description>
</entry>
Expand All @@ -3936,7 +3935,7 @@
<description>Parameter failed to set</description>
</entry>
<entry value="3" name="PARAM_ACK_IN_PROGRESS">
<description>Parameter value received but not yet set/accepted. A subsequent PARAM_ACK_TRANSACTION or PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent.</description>
<description>Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent.</description>
</entry>
</enum>
<enum name="CAMERA_MODE">
Expand Down Expand Up @@ -5179,7 +5178,6 @@
<field type="uint32_t" name="custom_mode">The new autopilot-specific mode. This field can be ignored by an autopilot.</field>
</message>
<!-- IDs 15-17 reserved for PARAM_VALUE_UNION and other param messages -->
<!-- IDs 19 reserved for PARAM_ACK_TRANSACTION (development.xml) -->
<message id="20" name="PARAM_REQUEST_READ">
<description>Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -&gt; value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also https://mavlink.io/en/services/parameter.html for a full documentation of QGroundControl and IMU code.</description>
<field type="uint8_t" name="target_system">System ID</field>
Expand All @@ -5203,7 +5201,7 @@
<message id="23" name="PARAM_SET">
<description>Set a parameter value (write new value to permanent storage).
The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at https://mavlink.io/en/services/parameter.html.
PARAM_SET may also be called within the context of a transaction (started with MAV_CMD_PARAM_TRANSACTION). Within a transaction the receiving component should respond with PARAM_ACK_TRANSACTION to the setter component (instead of broadcasting PARAM_VALUE), and PARAM_SET should be re-sent if this is ACK not received.</description>
</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="char[16]" name="param_id">Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string</field>
Expand Down
Loading
Loading