Overview
Here we want to define what a communication system between the STM32 and Jetson need to exchange (refer to the Exchanged Data specifications from last year), when it will be communicated (event-driven vs. batch) and the overall data schema.
Requirements
Comm Subsystem Requirement | Competition Requirement | Priority |
---|---|---|
Send the lattitude and longtitude in decimal degrees to the flight controller after a successful QR scan as well a begin takeoff command | Task 2: Send coordinates after QR Scan | HIGH |
At a specified rate, send the IMU and GPS data to the jetson | Task 2: Receive IMU data | HIGH |
At a specified rate, send the current location of the detected target to the flight controller | Task 2: Track targets | LOW |
Schema
Flight Controller → Jetson (FOJI)
// Format schema here as JSON { gpsCoordinates: { lattitude: 8 byte double, longtitude: 8 byte double, altitude: 8 byte double }, eulerAnglesOfPlane (Radians): { yaw: 4 byte float, pitch: 4 byte float, roll: 4 byte float } }
Note that in this iteration, eulerAnglesOfCamera comes from the gimbal controller rather than the flight controller.
Jetson → Firmware Controller (FIJO)
{ takeoffCommand: 4 byte boolean, qrScanFlag: 4 byte boolean, detectFlag: 4 byte boolean, gpsCoordinates: { lattitude: 8 byte double, longtitude: 8 byte double } }
Flags
These flags are booleans that are mutually excusive.
qrScanFlag: If true, then the gpsCoordinates are the coordinates that we got from the QR Scan.
detectFlag: If true, then the gpsCoordinates are the coordinates of the detected target. (used for hover mode)
Encoding
Encode the schema as a semicolon separated value with start and end bits.
FOJI
Start bit is a $ followed by FOJI
$FOJI;lattitude;longtitude;altitude;yaw;pitch;roll
Total Message Size: 47 bytes
FIJO
Start messages with a '$' sign followed by the string “FIJO”
$FIJO;takeoffCommand;qrScanFlag;detectFlag;lattitude;longitude
Total message size: 38 bytes