Skip to main content

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

  1. 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
  1. Each node in the system starts transmitting HEARTBEAT messages at a known frequency.
  2. On receiving a HEARTBEAT message, the GCS/UAV starts a timeout.
  3. If the timeout expires before a new HEARTBEAT message is received from the same node, then the connection is considered broken.
  4. If a HEARTBEAT message 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

  1. UAV_STATE_READ_REQUEST
  2. UAV_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
  1. When the GCS discovers a UAV, it sends a UAV_STATE_READ_REQUEST message to the UAV to fetch its complete state (activity, mode, error and error-flags).
  2. The GCS starts a timeout of a fixed duration.
  3. If the UAV responds with a UAV_STATE_READ_REQUEST_ACK message (this includes the complete state) before the timeout expires, the operation is succesful and the GCS and UAV consider the connection established.
  4. If the timeout expires, the GCS retries the operation upto n times, after which the operation is considered a failure and reported to the operator.