Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Achieve transmission of GLOBAL_POSITION_INT & ATTITUDE MAVLink messages from the drone to the ground control station (Mission Planner) via RFD 900 radio. Any missing sensor data will be filled with sample data at this time.

🛠️ 3. Class Definitions

📡

...

GroundStationCommunication

Owner: Roni Kant

Description

...

  • DMAReceiveBuffer: CircularBuffer - Stores incoming data.

  • lowPriorityTransmitBuffer: CircularBuffer - For low-priority data dispatch.

  • highPriorityTransmitBuffer: CircularBuffer - For high-priority routine data dispatch.

Methods

  • sendToGroundStationtransmit(CircularBuffer &transmissionBuffer): Sends data to the ground station.

  • receiveFromGroundStationISR(): ISR for incoming data, discards if DMAReceiveBuffer is full.

...

Flexible design compatible with various communication protocols and setups.

⏲️

...

TelemetryTask

Owner: Rahul Ramkumar

Description

Facilitates RTOS timer interrupts for periodic callbacks, essential for consistent data dispatch to the ground station. This is a way to abstract the process of creating an RTOS timer interrupt and allow us to have access to the telemetry manager instance within the callback. This method will be used to generate timer interrupts to schedule regular data transmissions to the ground station.essentially a wrapper for a FreeRTOS task that allows us to use a lambda function with access to the TM instance as a FreeRTOS task.

Constructor Signature

TimerInterruptTelemetryTask(const char* taskName, int stackSize, UBaseType_t uxPriority,
TickType_t intervalMs, TelemetryManager& tm, Callback cbLambda)

...

  • taskName: The RTOS task name

  • stackSize: Task stack size.

  • uxPriority: Task priority.intervalMs: Callback interval.

  • tm: Reference to telemetry manager instance.

  • cbLambda: The callback function.

...

Callback is a type alias for std::function<void(TelemetryManager&)>

Implementation Details

Example of function execution; real application requires RTOS timer setup.

🔄 MavlinkTranslator

Owner: Yarema Dzulynsky

...

🚀 Main Class Definition: System Initialization and Task Management

Owner:

Flow Chart

...

Expand
titleMarkdown Mermaid Flowchart Code
Code Block

Telemetry Manager Setup
```mermaid
flowchart TB
TMConstructor("Create TelemetryManager Instance")
MTConstructor("Create MavlinkTranslator Instance")
GSCConstructor("Create GroundStationCommunication Instance")

defineCallbacks["Define routineDataTransmission Task Callback"]

GSCDefine("create 
DMAReceiveBuffer, 
lowPriorityTransmitBuffer, 
highPriorityTransmitBuffer")
End("End")





TMConstructor --> MTConstructor
TMConstructor --> GSCConstructor

MTConstructor --> defineCallbacks
GSCConstructor --> defineCallbacks

GSCConstructor --> GSCDefine
defineCallbacks --> End


```

Telemetry Manager Operation
```mermaid
flowchart TB

%% TELEMETRY MANAGER


%% Routine Data Transmission Functionality

routineDataTransmission("RTOS Task: routineDataTransmission")

ingestStateData["Ingest drone state data
and convert to Mavlink bytes"]

packHPBuffer["Pack drone state data 
(Mavlink bytes) into 
GSC.highPriorityTransmitBuffer"]

transmitStateData["Transmit GSC.highPriorityTransmitBuffer 
contents via GSC.transmit()"]

RTOSDelay["RTOS delay: 500ms"]

routineDataTransmission --> ingestStateData
ingestStateData --> packHPBuffer
packHPBuffer --> transmitStateData
transmitStateData --> RTOSDelay
RTOSDelay --> ingestStateData


%% DMA Receive Functionality


DMAInterrupt("RFD900 Interrupt: receiveInterruptServiceRoutine")
receiveData["Receive data"]
checkBufferSpace{"GSC.DMAReceiveBuffer 
enough space?"}
addDataToBuffer["Add new data to GSC.DMAReceiveBuffer"]
discardData["Discard new data"]
DMAInterruptEnd("DMA Interrupt Handler End")

DMAInterrupt --> receiveData
receiveData --> checkBufferSpace
checkBufferSpace --> |Yes| addDataToBuffer
checkBufferSpace --> |No| discardData
addDataToBuffer --> DMAInterruptEnd
discardData --> DMAInterruptEnd

%% Loop Update Functionality

loopUpdate("SM Managed: update")

translateMavlink["Translate Mavlink bytes 
(to callback actions) from 
GSC.DMAReceiveBuffer and 
trigger associated callbakcs"]

fillLowPriorityBuffer["Fill GSC.lowPriorityTransmitBuffer"]

transmitLowPriorityBuffer["Transmit GSC.lowPriorityTransmitBuffer"]

loopUpdate --> translateMavlink
translateMavlink --> fillLowPriorityBuffer
fillLowPriorityBuffer --> transmitLowPriorityBuffer
transmitLowPriorityBuffer --> |SM Managed Delay| translateMavlink
```

Instances

  • GroundStationComms GSC: Oversees ground station comms.

  • MavlinkTranslator MT: MAVLink message and byte stream translator.

...