Python binding for MAVSDK
Actively maintained. Last release 5 days ago, commits in 25 of the last 26 weeks. A safe choice.
pip install mavsdkREADME as published on PyPI with version 4.3.0.
MAVSDK for Python
Python binding for MAVSDK, a library to communicate with MAVLink systems such as drones, cameras or ground stations.
It calls the MAVSDK C++ library directly (through its C wrapper), so there is no gRPC dependency and no mavsdk_server process to run.
The package exposes two interfaces:
mavsdk: a synchronous API using threads and callbacks.mavsdk.asyncio: an asyncio API.
Both are generated from the same protos and ship in the same distribution.
pip install mavsdk
Coming from MAVSDK-Python (
mavsdk3.x and earlier)?Up to 3.x,
mavsdkwas the gRPC-based MAVSDK-Python, which has a different API. It continues asmavsdk-grpc, imported asmavsdk_grpc. To keep using that API, installmavsdk-grpc, or pinmavsdk<4. To move to this package, see the migration guide.
Examples
Find examples for the synchronous API in examples/, and for the asyncio one in examples/asyncio/.
Development
Generate code
In order to generate the plugins from the proto submodule, run:
./tools/generate_from_protos.bash
This generates both interfaces: the synchronous plugins into mavsdk/plugins from templates/sync, and the asyncio ones into mavsdk/asyncio/plugins from .