ArduPilot/pymavlink is a Python project with 740 stars. python MAVLink interface and utilities
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This is a Python implementation of the MAVLink protocol.
It includes a source code generator (generator/mavgen.py) to create MAVLink protocol implementations for other programming languages as well.
Also contains tools for analyzing flight logs.
Documentation
Please see http://ardupilot.org/dev/docs/mavlink-commands.html for mavlink command reference.
For realtime discussion please see the pymavlink Gitter channel
Examples can be found in the repository or in the ArduSub book
Rust generation and MAVSpec/mavio interoperability are documented in
generator/Rust/README.md.
Installation
Pymavlink supports Python 3. Python 2 support has been removed.
The following instructions assume you are using a Debian-based (like Ubuntu) installation.
Dependencies
Pymavlink has several dependencies :
- [lxml](http://lxml.de/installation.html) : for checking and parsing xml file
Optional :
- numpy : for FFT
- pytest : for tests
On Linux
lxml has some additional dependencies that can be installed with your package manager (here with apt):
sudo apt install libxml2-dev libxslt-dev
Optional for FFT scripts and tests:
sudo apt install python3-numpy python3-pytest
Analogously you can install the required dependencies for pymavlink:
sudo apt install python3-lxml
Alternatively, in the unlikely event that your distribution (other than Debian and its derivatives like Ubuntu) does not feature that package, you may decide to use pip and install the missing dependency from its source tree:
Yet another alternative is to use brew, in perfect analogy to how it is described for the macOS.
On macOS
lxml's native dependencies (libxml2 and libxslt) can be installed with Homebrew :
brew install libxml2 libxslt
Install the Python dependencies with pip so they land in the same Python environment as pymavlink (Homebrew's numpy/pytest install into Homebrew's own Python interpreter, which is typically not the one running pymavlink) :
python3 -m pip install --upgrade lxml
Optional for FFT scripts and tests:
python3 -m pip install --upgrade numpy pytest
On Windows
Lxml can be installed with a Windows installer from here : https://pypi.org/project/lxml
Installation
For users
It is recommended to install pymavlink from PyPI with pip, that way dependencies should be auto installed by pip.
sudo python3 -m pip install --upgrade pymavlink
Mavnative
Starting from September 2022, mavnative, a C extension for parsing mavlink, was deprecated and removed. Mavnative development was stalled for long time, it only supports MAVLink1 and doesn't get any fix on the protocol.
Since pip installation is executed from /tmp, it is necessary to point to the directory containing message definitions with MDEF. MDEF should not be set to any particular message version directory but the parent folder instead. If you have cloned from mavlink/mavlink then this is /mavlink/message_definitions . Using pip should auto install dependencies and allow you to keep them up-to-date.
Or:
python3 -m pip install .
Running the tests
From inside the pymavlink directory, fetch the message definitions alongside
the checkout and run the suite with pytest:
MDEF points at the message definitions used to generate the dialects; if you
already have an ArduPilot checkout, point it at that mavlink/message_definitions
instead. PYTHONPATH=.. imports the local checkout rather than a pip-installed
copy.
Ardupilot Custom Modes
By default, pymavlink will map the Ardupilot mode names to mode numbers per the definitions in the ardupilotmega.xml file. However, during development, it can be useful to add to or update the default mode mappings.
To do this:
create a folder named .pymavlink in your home directory (i.e. $HOME on Linux, $USERPROFILE on Windows); and
add a JSON file called custom_mode_map.json to this new .pymavlink folder.
The JSON file is a dictionary that maps vehicle MAV_TYPE value to a dictionary of mode numbers to mode names. An example that duplicates the existing mapping for MAV_TYPE_FIXED_WING (enum value of 1) vehicles is as follows:
change the display name of an existing mode (e.g. change "TAKEOFF" to "LAUNCH");
add a new mode (e.g. add "25": "NEW_MODE"); and
add a mapping for an unsupported vehicle type (e.g. add a mapping for MAV_TYPE_AIRSHIP (enum value of 7) vehicles).
Notes:
Whilst the MAV_TYPE and mode numbers are integers, they need to be defined as strings in the JSON file, as raw integers can't be used as dictionary keys in JSON.
This feature updates the default definitions. You can use it to change the name-to-number mapping for a mode, but you completely can't remove an existing mapping.
License
pymavlink is released under the GNU Lesser General Public License v3 or later.
The source code generated by generator/mavgen.py is available under the permissive MIT License.
No homepage URL was recorded for ArduPilot/pymavlink in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How many stars does ArduPilot/pymavlink have?
ArduPilot/pymavlink has 740 GitHub stars — refresh the page for the live number, or check github.com/ArduPilot/pymavlink. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is ArduPilot/pymavlink open source?
TopGit's metadata for ArduPilot/pymavlink does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What is ArduPilot/pymavlink?
ArduPilot/pymavlink (ArduPilot/pymavlink) is a Python project on GitHub. From the project's own README: python MAVLink interface and utilities
Where do I read more about ArduPilot/pymavlink?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/ArduPilot/pymavlink is the definitive source.
Read full README in the tab above.
Still deciding about pymavlink?
One click hands the question to an AI along with this page — see what it says about pymavlink.