...
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: Hunter Adams Roni Kant
Description
Handles communication between the ground station and drone using RFD 900 or equivalent modules, utilizing circular buffers for MAVLink message management.
...
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 ifDMAReceiveBuffer
is full.
...
Flexible design compatible with various communication protocols and setups.
⏲️
...
TelemetryTask
Owner: Rahul Ramkumar
Description
Facilitates STD32 timer interrupts for periodic callbacks, essential for consistent data dispatch to the ground station. This is just a way to abstract the process of creating a timer interrupt on the STM32 board. This method will be used to generate timer interrupts to schedule regular data transmissions to the ground station.
Method Signature
void registerTimerInterrupt(int timeIntervalMs, void (*function)())
Parameters
timeIntervalMs
: The timer interval in milliseconds.function
: The callback function.
Implementation Details
Example of function execution; real application requires STM32 timer setup.This is 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
TelemetryTask(const char* taskName, int stackSize, UBaseType_t uxPriority, TelemetryManager& tm, Callback cbLambda)
Parameters
taskName
: The RTOS task namestackSize
: Task stack size.uxPriority
: Task priority.tm
: Reference to telemetry manager instance.cbLambda
: The callback function.
Note
Callback
is a type alias for std::function<void(TelemetryManager&)>
Implementation Details
🔄 MavlinkTranslator
Owner: Yarema Dzulynsky
...
🚀 Main Class Definition: System Initialization and Task Management
Owner:
Flow Chart
...
Expand | ||
---|---|---|
| ||
|
Instances
GroundStationComms GSC: Oversees ground station comms.
MavlinkTranslator MT: MAVLink message and byte stream translator.TimerInterrupt TI: Timer-based task manager.
🌐 Function: init
Description
...
Timer Interrupts: Configured for 500ms and 1000ms operation intervals.
FreeRTOS Tasks:
translateToMavlinkThread
: ProcessesGSC.DMAReceiveBuffer
bytes into MAVLink messages.mavlinkToBytesThread
: Loads MAVLink bytes intoGSC.lowPriorityTransmitBuffer
.
Scheduler: Engages the FreeRTOS scheduler for task oversight.
🗝 Function: getInstance
Description
...
.
🔄 Tasks and ISRs
translateToMavlinkThread & mavlinkToBytesThread: Converts between MAVLink messages and byte streams for drone-ground station communication.
TimerISR500ms & TimerISR1000ms: Ensures regular data dispatch from both
GSC.lowPriorityTransmitBuffer
andGSC.highPriorityTransmitBuffer
.
...