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

Add control handoff messages for multiple GCS #1954

Closed
Closed
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
105 changes: 105 additions & 0 deletions message_definitions/v1.0/development.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,60 @@
<param index="7" reserved="true"/>
</entry>
</enum>
<enum name="CURRENT_CONTROL_ENTITY">
<description>List of the currently active control entity.</description>
<entry value="0" name="CURRENT_CONTROL_ENTITY_NONE">
<description>Setting if no entity has control ownership.</description>
</entry>
<entry value="1" name="CURRENT_CONTROL_ENTITY_OWNER">
<description>Setting if the receiving GCS is the control entity.</description>
</entry>
<entry value="2" name="CURRENT_CONTROL_ENTITY_OTHER">
<description>Setting if a GCS other than the receiving GCS is the control entity.</description>
</entry>
</enum>
<enum name="CONTROL_TARGET_REQUEST">
<description>Selection of control target for changing ownership.</description>
<entry value="0" name="CONTROL_TARGET_ALL">
<description>Request change control ownership of both flight control and payload control.</description>
</entry>
<entry value="1" name="CONTROL_TARGET_FLIGHT">
<description>Request change control ownership of the flight control.</description>
</entry>
<entry value="2" name="CONTROL_TARGET_PAYLOAD">
<description>Request change control ownership of the payload control.</description>
</entry>
</enum>
<enum name="CONTROL_REQUEST_ERROR_CODE">
<description>Error code for the control request response.</description>
<entry value="0" name="CONTROL_REQUEST_PROCESSED">
<description>Code indicating successful processing of the request.</description>
</entry>
<entry value="1" name="CONTROL_REQUEST_DENIED">
<description>Error code indicating that the control request has been denied by the target system.</description>
</entry>
<entry value="2" name="CONTROL_REQUEST_HANDOFF_TIMEOUT">
<description>Error Code indicating timeout on the handoff request.</description>
</entry>
<entry value="3" name="CONTROL_REQUEST_DENIED_CONCURRENT">
<description>Error Code indicating another control request is in process.</description>
</entry>
<entry value="4" name="CONTROL_REQUEST_NO_CONTROL_AUTHORITY">
<description>Error Code indicating no enough authority to take control ownership.</description>
</entry>
<entry value="5" name="CONTROL_REQUEST_NO_PRIORITY_AUTHORITY">
<description>Error Code indicating no enough priority authority control ownership.</description>
</entry>
</enum>
<enum name="HANDOFF_DECISION">
<description>Decision of the GCS to a handoff request.</description>
<entry value="0" name="HANDOFF_DECISION_ACCEPT">
<description>Decision to accept the handoff and release control ownership.</description>
</entry>
<entry value="1" name="HANDOFF_DECISION_DENIED">
<description>Decision to deny the handoff request and keep control ownership.</description>
</entry>
</enum>
</enums>
<messages>
<!-- Transactions for parameter protocol -->
Expand Down Expand Up @@ -470,5 +524,56 @@
<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>
</message>
<message id="441" 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="target_system">System this messsage is meant for.</field>
<field type="uint8_t" name="current_flight_controller" enum="CURRENT_CONTROL_ENTITY">Current flight control entity.</field>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this works. It is emitted by an autopilot or autopilot payload to say what component or system it is being controlled by right?

So CURRENT_CONTROL_ENTITY_NONE makes sense "i'm not being controlled", but this is nonsensical:

  • `CURRENT_CONTROL_ENTITY_OWNER: Setting if the receiving GCS is the control entity.

Why? Because the message is received by everything on the network, so if there are multiple GCS they will all think they are the control entity right?

For this I would just emit a mavlink address. Perhaps future proof by making it a uint16_t.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for field below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is not intended to be broadcasted to all GCS at the same time. As you correctly pointed out, that would not work with the enum entity. On the other hand i wanted to avoid using the system Id, as in the RAS-A protocol, they want to get rid of the system Id and replace it with the underlying transport protocol address (IP address/port in most cases). So we would need to send this message targeted for each GCS independently stating that they are in control or someone else. AS i don't expect a hugh amount of simultaneous connections, it should be feasible to send such targeted Messages.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the point, but this will not work with MAVLink as it actually is. To be in common messages need to be standard - possible for anyone to take and use with the MAVLink 2 protocol. That is not the case, so I can't really engage on this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I think you are saying is that a system that wants to send the message would not broadcast it. Instead it would send it to a specific recipient (say GCS A) using whatever mechanism is used for addressing (now system ID, but on RAS-A maybe some other address) and that system would get the enum value that was relevant - i.e. "you are the controller" or "something else is the controller". Is that right?

So this would be sent round robin to all GCS or other things that might want control?

The normal way in mavlink to do this would be to broadcast the the ID of the owning item.

<field type="uint8_t" name="current_payload_controller" enum="CURRENT_CONTROL_ENTITY">Current payload control entity.</field>
</message>
<message id="442" 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="target_system">Target system for the control request.</field>
<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[10]" name="requester_id">Identification of the control entity requesting ownership.</field>
<field type="char[50]" name="reason">Reason for taking ownership.</field>
</message>
<message id="443" name="REQUEST_CONTROL_ACK">
<description>Error code response of the target system to the control ownership request.
</description>
<field type="uint8_t" name="target_system">System to send the Ack back.</field>
<field type="uint8_t" name="error_code" enum="CONTROL_REQUEST_ERROR_CODE">Error code response.</field>
</message>
<message id="444" 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="target_system">System which should release control of the sender</field>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to release own ownership.</field>
</message>
<message id="445" 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="target_system">GCS which is currently in control and has to accept handover.</field>
<field type="uint8_t" name="control_target" enum="CONTROL_TARGET_REQUEST">Control target to handoff control ownership.</field>
<field type="char[10]" name="requester_id">Identification of the control entity requesting ownership.</field>
<field type="char[50]" name="reason">Reason from the control entity requesting ownership.</field>
</message>
<message id="446" 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="target_system">System which should hand over the control.</field>
<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>
</messages>
</mavlink>