-
Notifications
You must be signed in to change notification settings - Fork 327
Bring new multi-GCS protocol messages from mavlink/mavlink #382
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,6 +163,53 @@ | |
| <param index="6" reserved="true" default="0"/> | ||
| <param index="7" reserved="true" default="NaN"/> | ||
| </entry> | ||
| <entry value="32100" name="MAV_CMD_REQUEST_OPERATOR_CONTROL" hasLocation="false" isDestination="false"> | ||
| <description>Request GCS control of a system (or of a specific component in a system). | ||
|
|
||
| A controlled system should only accept MAVLink commands and command-like messages that are sent by its controlling GCS, or from other components with the same system id. | ||
| Commands from other systems should be rejected with MAV_RESULT_PERMISSION_DENIED (except for this command, which may be acknowledged with MAV_RESULT_ACCEPTED if control is granted). | ||
| Command-like messages should be ignored (or rejected if that is supported by their associated protocol). | ||
|
|
||
| GCS control of the whole system is managed via a single component that we will refer to here as the "system manager component". | ||
| This component streams the CONTROL_STATUS message and sets the GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER flag. | ||
| Other components in the system should monitor for the CONTROL_STATUS message with this flag, and set their controlling GCS to match its published system id. | ||
| A GCS that wants to control the system should also monitor for the same message and flag, and address the MAV_CMD_REQUEST_OPERATOR_CONTROL to its component id. | ||
| Note that integrators are required to ensure that there is only one system manager component in the system (i.e. one component emitting the message with GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER set). | ||
|
|
||
| The MAV_CMD_REQUEST_OPERATOR_CONTROL command is sent by a GCS to the system manager component to request or release control of a system, specifying whether subsequent takeover requests from another GCS are automatically granted, or require permission. | ||
|
|
||
| The system manager component should grant control to the GCS if the system does not require takeover permission (or is uncontrolled) and ACK the request with MAV_RESULT_ACCEPTED. | ||
| The system manager component should then stream CONTROL_STATUS indicating its controlling system: all other components with the same system id should monitor this message and set their own controlling GCS to match that of the system manager component. | ||
|
|
||
| If the system manager component cannot grant control (because takeover requires permission), the request should be rejected with MAV_RESULT_PERMISSION_DENIED. | ||
| The system manager component should then send this same command to the current owning GCS in order to notify of the request. | ||
| The owning GCS would ACK with MAV_RESULT_ACCEPTED, and might choose to release control of the vehicle, or re-request control with the takeover bit set to allow permission. | ||
| Note that the pilots of both GCS should co-ordinate safe handover offline. | ||
|
|
||
| Note that in most systems the only controlled component will be the "system manager component", and that will be the autopilot. | ||
| However separate GCS control of a particular component is also permitted, if supported by the component. | ||
| In this case the GCS will address MAV_CMD_REQUEST_OPERATOR_CONTROL to the specific component it wants to control. | ||
| The component will then stream CONTROL_STATUS for its controlling GCS (it must not set GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER). | ||
| The component should fall back to the system GCS (if any) when it is not directly controlled, and may stop emitting CONTROL_STATUS. | ||
| The flow is otherwise the same as for requesting control over the whole system. | ||
| </description> | ||
| <param index="1" label="Sysid requesting control">System ID of GCS requesting control. 0 when command sent from GCS to autopilot (autopilot determines requesting GCS sysid from message header). Sysid of GCS requesting control when command sent by autopilot to controlling GCS.</param> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a fan of this. mavlink nodes should generally not change behaviour based on whether they're a GCS or an autopilot. So in this case the autopilot appears as if it is trying to take control of the GCS, which is odd. Suggest a distinct command for the autopilot asking the GCS if it is OK for it to transfer control elsewhere |
||
| <param index="2" label="Action">0: Release control, 1: Request control.</param> | ||
| <param index="3" label="Allow takeover">Enable automatic granting of ownership on request (by default reject request and notify current owner). 0: Ask current owner and reject request, 1: Allow automatic takeover.</param> | ||
| <param index="4">Empty</param> | ||
| <param index="5">Empty</param> | ||
| <param index="6">Empty</param> | ||
| <param index="7">Empty</param> | ||
| </entry> | ||
| </enum> | ||
| <enum name="GCS_CONTROL_STATUS_FLAGS" bitmask="true"> | ||
| <description>CONTROL_STATUS flags.</description> | ||
| <entry value="1" name="GCS_CONTROL_STATUS_FLAGS_SYSTEM_MANAGER"> | ||
| <description>If set, this CONTROL_STATUS publishes the controlling GCS for the whole system. If unset, the CONTROL_STATUS indicates the controlling GCS for just the component emitting the message. Note that to request control of the system a GCS should send MAV_CMD_REQUEST_OPERATOR_CONTROL to the component emitting CONTROL_STATUS with this flag set.</description> | ||
| </entry> | ||
| <entry value="2" name="GCS_CONTROL_STATUS_FLAGS_TAKEOVER_ALLOWED"> | ||
| <description>Takeover allowed (requests for control will be granted). If not set requests for control will be rejected, but the controlling GCS will be notified (and may release control or allow takeover).</description> | ||
| </entry> | ||
| </enum> | ||
| <enum name="GPS_SYSTEM_ERROR_FLAGS" bitmask="true"> | ||
| <description>Flags indicating errors in a GPS receiver.</description> | ||
|
|
@@ -344,5 +391,10 @@ | |
| <field type="uint8_t" name="gnss_signal_quality" minValue="0" maxValue="10" invalid="UINT8_MAX">An abstract value representing the quality of incoming GNSS signals, or 255 if not available.</field> | ||
| <field type="uint8_t" name="post_processing_quality" minValue="0" maxValue="10" invalid="UINT8_MAX">An abstract value representing the estimated PPK quality, or 255 if not available.</field> | ||
| </message> | ||
| <message id="512" name="CONTROL_STATUS"> | ||
| <description>Information about GCS in control of this MAV. This should be broadcast at low rate (nominally 1 Hz) and emitted when ownership or takeover status change. Control over MAV is requested using MAV_CMD_REQUEST_OPERATOR_CONTROL.</description> | ||
| <field type="uint8_t" name="sysid_in_control">System ID of GCS MAVLink component in control (0: no GCS in control).</field> | ||
| <field type="uint8_t" name="flags" enum="GCS_CONTROL_STATUS_FLAGS" display="bitmask">Control status. For example, whether takeover is allowed, and whether this message instance defines the default controlling GCS for the whole system.</field> | ||
| </message> | ||
| </messages> | ||
| </mavlink> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is interesting but perhaps unrelated.