From 4c64b9522f9bb9815b089ab98cf2f33f11bded52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= <beat-kueng@gmx.net> Date: Wed, 10 May 2023 10:47:39 +0200 Subject: [PATCH] development: changes to standard flight modes (#1915) - reduces the mode name to 35 - removes 'base_mode', as this contains dynamic bits, like MAV_MODE_FLAG_SAFETY_ARMED - adds properties to modes: - whether a mode is flagged as 'advanced', so a UI can hide it - adds a user intended mode field. This is generally equal to custom_mode, but might be different in a failsafe condition --- message_definitions/v1.0/development.xml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/message_definitions/v1.0/development.xml b/message_definitions/v1.0/development.xml index 7e1c76c3da..2f037d9819 100644 --- a/message_definitions/v1.0/development.xml +++ b/message_definitions/v1.0/development.xml @@ -108,6 +108,21 @@ </description> </entry> </enum> + <enum name="MAV_MODE_PROPERTY" bitmask="true"> + <description>Mode properties. + </description> + <entry value="1" name="MAV_MODE_PROPERTY_ADVANCED"> + <description>If set, this mode is an advanced mode. + For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. + A GCS can optionally use this flag to configure the UI for its intended users. + </description> + </entry> + <entry value="2" name="MAV_MODE_PROPERTY_NOT_USER_SELECTABLE"> + <description>If set, this mode should not be added to the list of selectable modes. + The mode might still be selected by the FC directly (for example as part of a failsafe). + </description> + </entry> + </enum> <!-- The MAV_CMD enum entries describe either: --> <!-- * the data payload of mission items (as used in the MISSION_ITEM_INT message) --> <!-- * the data payload of mavlink commands (as used in the COMMAND_INT and COMMAND_LONG messages) --> @@ -294,9 +309,9 @@ <field type="uint8_t" name="number_modes">The total number of available modes for the current vehicle type.</field> <field type="uint8_t" name="mode_index">The current mode index within number_modes, indexed from 1.</field> <field type="uint8_t" name="standard_mode" enum="MAV_STANDARD_MODE">Standard mode.</field> - <field type="uint8_t" name="base_mode" enum="MAV_MODE_FLAG" display="bitmask">System mode bitmap.</field> <field type="uint32_t" name="custom_mode">A bitfield for use for autopilot-specific flags</field> - <field type="char[50]" name="mode_name">Name of custom mode, with null termination character. Should be omitted for standard modes.</field> + <field type="uint32_t" name="properties" enum="MAV_MODE_PROPERTY">Mode properties.</field> + <field type="char[35]" name="mode_name">Name of custom mode, with null termination character. Should be omitted for standard modes.</field> </message> <message id="436" name="CURRENT_MODE"> <description>Get the current mode. @@ -304,8 +319,8 @@ It may be requested using MAV_CMD_REQUEST_MESSAGE. </description> <field type="uint8_t" name="standard_mode" enum="MAV_STANDARD_MODE">Standard mode.</field> - <field type="uint8_t" name="base_mode" enum="MAV_MODE_FLAG" display="bitmask">System mode bitmap.</field> <field type="uint32_t" name="custom_mode">A bitfield for use for autopilot-specific flags</field> + <field type="uint32_t" name="intended_custom_mode" invalid="0">The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied</field> </message> <message id="437" name="AVAILABLE_MODES_MONITOR"> <description>A change to the sequence number indicates that the set of AVAILABLE_MODES has changed.