Versions Compared

Key

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

...

Code Block
languagejson
// Format schema here as JSON
{
  info: stringchar array, 100 characters, 8 bits * 100 = 800 bits = 100bytes, // Encompasses the second line of the QR scan result
  date: stringMMDDYY, 6  time: stringcharacters, 8 bits * 6 chars = 48 bits = 6 bytes,
  device_id: string,
  sensor_id: stringtime: HHMM, 4 chars, 32 bits = 4 bytes
}

Encoding

...

Encode the schema as a MAVLink message with the fields described above. We will define a Mavlink dialect and then load it and use the pack method for encoding and decode method for decoding as shown in this example. Therefore, we’ll encode into a fifo buffer and then send the data from the buffer to the XBee interface. We’ll use the decode method and other logic as a callback to the XBee interface.

...

- This will go into the frame message section of the zigbee

Frame protocol: Comms

Message Size: 110 bytes* (Note that this does NOT mean the message length in the frame will be 110, it will be 110 + everything before the message)

Code Block
languagenone
info (bytes 0-99) | date (bytes 100-105) | time (bytes 106-109)

*The use of bytes here is intentional, we mean bytes not bits

Implementation - Computer Vision (OUTDATED, NEW ONE SOON)

GOJI:

...

All functionality for GOJI will be contained in the GroundRecieve module. We’ll define a function called recieveGround in the module that uses the decode method of the mavlink dialect then constructs a response object which gets put into a RxPy Subject. The worker will subscribe to the subject and push its latest value to the output pipeline.

...

All functionality relating to GIJO will be contained in the GroundSend module. We’ll use the fifo buffer, pack and decode methods from the mavtest.py example to encode the message in the sendGround function. The worker will get messages in the request format as defined here as a “QR_INFO” message type. The GroundSendWorker will take from the pipeline in then use the sendGround method to get an encoded buffer which is then sent to the XBee interface to write.

...