Mavlink
Contents |
Introduction
The MAVLink protocol have been implemented in the Flexbot project to secure a standardized communication protocol with as little overhead as possible. This allows for not only transferring data over the serial USB interface between the Teensy and Intel NUC, but also for wireless transformation of all data from the NUC to client(s) and vice versa.
For more information of the MAVLink protocol itself see http://qgroundcontrol.org/mavlink/start.
This page will give information on how MAVLink is utilized in this project as well as how to update the main flexbot.xml message container and generate the C-headers + Python files needed.
Prerequisites
Make sure to have downloaded the newest version of the Flexbot repository and head into code/MAVLink/ and make sure flexbot.xml, Bridge/ and Generator/ is present.
Adding messages to Flexbot
All messages/signals to/from Flexbot are defined in flexbot.xml. A message is defined by an ID, name and description. All signals related to this message is defined by a type (uint8_t, float, etc), name and signal description.
E.g. to add a new message to Flexbot identify the last listed message ID and append to it:
<message id="16" name="TestSignal"> <description>Test signal for this example</description> <field type="float" name="value1">Floating point test value.</field> <field type="uint8_t" name="publish">Sets whether or not Teensy should publish this message.</field> </message>
An important note which goes for all messages is that it must contain the publish signal. This signal allows clients to subscribe to different messages and will save bandwidth as the Teensy only will publish messages that has subscribers.
By updating flexbot.xml nothing magical will happen. In order to integrate the new version of the message definitions C-headers must be generated and the source code on both Teensy and the GUI must be altered to support the new message definitions.