There are different ways to get started with MAVLink:
- Download the latest auto-generated libraries if you have a C/C++ project that uses the existing dialects.
- Install MAVLink and then Generate Language-Specific Source Files if you want to use any other supported language, add/modify messages or dialects, or use the example scripts.
The following documents are useful for understanding how to use the libraries:
- Using Generated Source Files explains how to include them in your project.
- Message Definitions contains human-readable explanations of the messages.
- Protocols explains the main sub-protocols for working with missions, cameras, images, parameters etc.
Below we explain how to get the prebuilt libraries, or install the tools to build them yourself.
C libraries (only) are auto-generated for the latest versions of all message specifications, for both MAVLink 1 and 2:
The requirements for using the MAVLink tools are:
- Python 2.7+ or Python 3.3+
- Python future module
- (Optional) Python TkInter module (required to use the GUI tool).
PYTHONPATHenvironment variable must be set to the directory path containing the mavlink repository.
The main installation steps are:
- Install Python 2.7+ or 3.3+.
- Windows: Download from Python for Windows
- Ubuntu Linux 16.04: Python 2.7 and Python 3.0 are already present.
If you are using Python3 you will need to install the pip3 package manager:
sudo apt-get install python3-pip
- Install the future module:
pip install future
pip install --user future
(Optionally) Install TkInter
- Windows: Installed already as part of Python for Windows
- Linux: Enter the following terminal command:
sudo apt-get install python-tk
Clone the mavlink repo (or your fork) into a user-writable directory:
git clone https://github.com/mavlink/mavlink.git git submodule update --init --recursive
Alternatively you can do this in one line:
git clone https://github.com/mavlink/mavlink.git --recursive
PYTHONPATHto the directory path containing your mavlink repository.
Now you are ready to Generate Source Files.