Discovery and Connection
The discovery and connection subprotocols allows various UAVs and a single GCS to discover each other and establish a connection.
Discovery
Under the discovery subprotocol, heartbeats are broadcasted by each component (UAV or GCS) at a fixed frequency, which are received by other components to discover their presence.
Messages
HEARTBEAT
Sequence
sequenceDiagram
participant GCS
participant UAV
loop Every Second
GCS->>UAV: HEARTBEAT
UAV->>UAV: Start/Reset Timeout
Note over GCS,UAV: UAV has discovered GCS,<br />is ready to establish connection
end
loop Every Second
UAV->>GCS: HEARTBEAT
GCS->>GCS: Start/Reset Timeout
Note over GCS,UAV: GCS has discovered UAV,<br />is ready to establish connection
end
- Each node in the system starts transmitting
HEARTBEATmessages at a known frequency. - On receiving a
HEARTBEATmessage, the GCS/UAV starts a timeout. - If the timeout expires before a new
HEARTBEATmessage is received from the same node, then the connection is considered broken. - If a
HEARTBEATmessage is received before the timeout expires, then it is reset and the connection is kept alive.
Connection
After devices have discovered each other, the connection subprotocol is used to establish a connection between a GCS and UAV.
Messages
UAV_STATE_READ_REQUESTUAV_STATE_READ_REQUEST_ACK
Sequence
sequenceDiagram
participant GCS
participant UAV
Note over GCS,UAV: Discovery has happened
loop n
GCS->>UAV: UAV_STATE_READ_REQUEST
GCS->>GCS: Start timeout
alt success
UAV-->>GCS: UAV_STATE_READ_REQUEST_ACK
Note over UAV,GCS: Connection established
else failure
GCS->>GCS: Timeout expired
end
end
- When the GCS discovers a UAV, it sends a
UAV_STATE_READ_REQUESTmessage to the UAV to fetch its complete state (activity, mode, error and error-flags). - The GCS starts a timeout of a fixed duration.
- If the UAV responds with a
UAV_STATE_READ_REQUEST_ACKmessage (this includes the complete state) before the timeout expires, the operation is succesful and the GCS and UAV consider the connection established. - If the timeout expires, the GCS retries the operation upto
ntimes, after which the operation is considered a failure and reported to the operator.