Software
MAVSDK-Python
By MAVLink, from github.com/mavlink/MAVSDK-Python (opens in a new tab)
- Drones and boats
- Library
- BSD-3-Clause
A Python wrapper for the MAVSDK drone control library that talks to a C++ gRPC server to command MAVLink-based vehicles. Published on PyPI as mavsdk-grpc.
Facts
- GitHub stars
- 460read on 28 Nov 2026
- Last update
- 27 Nov 2026Newest commit on main
- Maintenance
- Activea commit in the last 90 days
- Difficulty
- Beginner
- Hardware it needs, as the project states it
- Raspberry Pi 1/2 and Zero need grpcio installed via the system package manager because no armv6 binary wheels exist; ARM Linux needs the MAVSDK_SERVER_ARCH variable set to armv6l, armv7l or aarch64 when building.
Checked on GitHub on 28 Nov 2026.
Licenses
- Code
- BSD-3-Clause (opens in a new tab)
Read by Robotheca from LICENSE.txt (opens in a new tab) (BSD-3-Clause) at commit 4f308ac (opens in a new tab), on 28 Nov 2026.
- Commercial use
- Yes
At a glance
- What it is
- Provides Python classes such as System to connect to and control MAVLink drones, largely auto-generated from proto message definitions.
- Starts an embedded mavsdk_server automatically on connect, or connects to a server already running at a given address.
- Requires Python 3.7 or newer because it is built on asyncio.
- Includes example scripts such as takeoff and land, and an API reference documentation site.
- Renamed from mavsdk to mavsdk-grpc; the mavsdk name on PyPI now refers to a different native binding.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses it yet.
- Licence
- BSD-3-Clause. Commercial use: Yes. Where it was read
- Install
- In the creator's words: The project's website (opens in a new tab)
- Maintenance
- Active, last commit on 27 Nov 2026.
Use it
How to install it, in the creator's words: The project's website (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/mavlink/MAVSDK-Python (opens in a new tab)
- The version Robotheca read4f308ac (opens in a new tab)
- Latest release4.3.0 (27 Nov 2026)
Robotheca read the repository at two versions: the summary at 8fa280f and the facts and the README at 4f308ac (read on 28 Nov 2026).
Robotheca never hosts the code: each link goes to the creator's own page.
The README
The creator's own README, copied as written: README.md by MAVLink, at commit 4f308ac, under BSD-3-Clause (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
MAVSDK-Python
This is the gRPC-based Python wrapper for MAVSDK, published on PyPI as
mavsdk-grpc (opens in a new tab) and imported as mavsdk_grpc.
The Python wrapper is based on a gRPC client communicating with the gRPC server written in C++. To use the Python wrapper the gRPC server called "backend" needs to be running on the same system. The wrapper is essentially auto-generated from the message definitions (proto files (opens in a new tab)).
⚠️ Renamed from
mavsdktomavsdk-grpcThis wrapper used to be published as
mavsdk. That name on PyPI now refers to the native MAVSDK binding, which has a different API and no gRPC dependency — see the migration guide (opens in a new tab).This project carries on under the
mavsdk-grpcname, including releases tracking MAVSDK v4. If you were usingmavsdk:
- Install
mavsdk-grpcand useimport mavsdk_grpc as mavsdk— the code is identical. The separate import name is deliberate, so that the two packages can never overwrite each other's files.- Or pin
mavsdk<4to freeze on the last release under the old name, which will not receive further updates.
Important Notes
- Python 3.7+ is required (because the wrapper is based on asyncio (opens in a new tab)).
- You may need to run
pip3instead ofpipandpython3instead ofpython, depending of your system defaults. - Auterion used to have a Getting started with MAVSDK-Python (web.archive.org) (opens in a new tab) guide if you're a beginner and not sure where to start.
API Reference docs
-> API Reference documentation (opens in a new tab).
Install using pip from PyPi
Note for Raspberry Pi 1/2 and Zero:
This wrapper requires grpcio. However, there are no binary packets of grpcio for armv6 available via pip (also see files on pypi.org (opens in a new tab)). In this case, install grpcio via the package manager, e.g.
sudo apt-get install python3-grpcio.
To install it, simply run:
pip3 install mavsdk-grpc
The package contains mavsdk_server already (previously called "backend"), which is started automatically when connecting (e.g. await drone.connect()). Have a look at the examples to see it used in practice. It will be something like:
from mavsdk_grpc import System
...
drone = System()
await drone.connect(system_address="udpin://0.0.0.0:14540")
Note: System() takes two named parameters: mavsdk_server_address and port. When left empty, they default to None and 50051, respectively, and mavsdk_server -p 50051 is run by await drone.connect(). If mavsdk_server_address is set (e.g. to "localhost"), then await drone.connect() will not start the embedded mavsdk_server and will try to connect to a server running at this address. This is useful for platforms where mavsdk_server does not come embedded, for debugging purposes, and for running mavsdk_server in a place different than where the MAVSDK-Python script is run.
Run the examples
Once the package has been installed, the examples can be run:
examples/takeoff_and_land.py
The examples assume that the embedded mavsdk_server binary can be run. In some cases (e.g. on Raspberry Pi), it may be necessary to run mavsdk_server manually, and therefore to set mavsdk_server_address='localhost' as described above.
Contribute
Note: this is more involved and targeted at contributors.
Most of the code is auto-generated from the proto definitions (opens in a new tab), using our templates (opens in a new tab). The generated files can be found in the generated (opens in a new tab) folder. As a result, contributions are generally made in the templates or on the build system. Regularly, there is a need to update MAVSDK-Python to include the latest features defined in the proto definitions. This is described below.
Clone the repo
Clone this repo and recursively update submodules:
git clone https://github.com/mavlink/MAVSDK-Python --recursive
cd MAVSDK-Python
Install prerequisites
First install the protoc plugin (protoc-gen-mavsdk):
cd proto/pb_plugins
pip3 install -r requirements.txt
You can check that the plugin was installed with $ which protoc-gen-mavsdk, as it should now be in the PATH.
Then go back to the root of the repo and install the dependencies of the SDK:
cd ../..
pip3 install -r requirements.txt -r requirements-dev.txt
Generate the code
Run the following helper script. It will generate the Python wrappers for each plugin.
./other/tools/run_protoc.sh
Adding support for new plugins
In case you updated the ./proto submodule to include a new plugin, you will also have to manually edit the file mavsdk/system.py to register the plugin.
Update mavsdk_server version
MAVSDK_SERVER_VERSION (opens in a new tab) contains exactly the tag name of the mavsdk_server release corresponding to the version of MAVSDK-Python. When the proto (opens in a new tab) submodule is updated here, chances are that mavsdk_server should be updated, too. Just edit this file, and the corresponding binary will be downloaded by the setup.py script (see below).
Build and install the package locally
After generating the wrapper and only in ARM architectures with linux, defines a variable MAVSDK_SERVER_ARCH:
export MAVSDK_SERVER_ARCH=<ARM embedded architecture>
Supported architectures: armv6l, armv7l and aarch64. For example for Raspberry Pi it is armv7l, or aarch64 (if a 64 bit distribution is used).
Then you can install a development version of the package, which links the package to the generated code in this local directory. To do so, use:
python3 setup.py build
pip3 install -e .
Note: MAVDSK-Python runs mavsdk/bin/mavsdk_server when await drone.connect() is called. This binary comes from MAVSDK (opens in a new tab) and is downloaded during the setup.py step above.
Generate the API documentation
Make sure the version tag is set correctly before generating new documentation.
pip3 install -r requirements-docs.txt
make -C mavsdk html
Formatting checks before committing
We use the following checks in CI (opens in a new tab):
pipx run ruff format --check --line-length=100 examples
pipx run ruff check --select=ASYNC,RUF006,E,F --line-length=100 examples
pipx run codespell .
Release steps
- Check the proto submodule is up-to-date and the generated code has been updated.
- Check all required pull requests are merged to main
- Check MAVSDK_SERVER_VERSION (opens in a new tab) is set to the correct version of mavsdk_server.
- Create git tag on laster main, e.g.:
git switch main git pull git tag X.Y.Z git push --tags - Go to releases page (opens in a new tab) and create new release.
The CI will now:
- Create and push a wheel for Windows, Linux and macOS to PyPi.
- Generate the latest docs and push them to s3.
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.