Installing MAVLink Toolchain
This topic explains how to install the MAVLink toolchain. The toolchain includes the XML message definitions as well as the the GUI/command line tools that use the definitions to Generate MAVLink Source Files.
You do not need to install or generate the source files if you are using the C programming language and a standard dialect. Just get the prebuilt libraries and then jump to Using C Libraries.
The requirements for using the MAVLink generator are:
- Python 3.3+
- Python future module
- TkInter (required to use the GUI tool).
PYTHONPATHenvironment variable must be set to the directory path containing the mavlink repository.
If you are creating new XML definitions you should also install lxml and libxml2 for XML validation and formatting.
To install the MAVLink toolchain:
Install Python 3.6+:
- Windows: Download from Python for Windows
- Ubuntu Linux Python 3 is present on 18.04 and 20.04 by default but you will need to install the pip3 package manager:
sudo apt install python3-pip
Install the future module:
pip3 install future
pip3 install --user future
(Recommended) Install modules for XML validation and formatting:
sudo apt install python3-lxml libxml2-utils
- Windows: Installed already as part of Python for Windows
- Linux: Enter the following terminal command:
sudo apt install python3-tk
Clone the official mavlink repo or your fork with your custom dialect:
git clone https://github.com/mavlink/mavlink.git --recursive
PYTHONPATHto the directory path containing your mavlink repository. This will allow you to launch the tool from anywhere using Python's module argument
python3 -m mavgenerate.
Now you are ready to Generate MAVLink Libraries.