MAVSDK (v0.35.0)
MAVSDK is a MAVLink Library with APIs for C++, iOS, Python and Android.
The SDK is the best way to integrate with a flight stack over MAVLink! It is supported by Dronecode, ensuring that it is robust, well tested, and maintained.
The library provides a simple API for managing one or more vehicles, providing programmatic access to vehicle information and telemetry, and control over missions, movement and other operations.
The library can run on a vehicle-based companion computer or on a ground-based GCS or mobile device (these devices have significantly more processing power that an ordinary flight controller, enabling tasks like computer vision, obstacle avoidance, and route planning).
Developers can extend MAVSDK using C++ plugins in order to add any other required MAVLink API (for example, to integrate a flight controller with custom cameras, gimbals, or other hardware over MAVLink).
Language bindings are actively being developed on top of MAVSDK-C++.
Project Status
MAVSDK is a robust and well-tested library that is already being used in production environments.
Future compatibility is not guaranteed (the API is not "stable").
The current status is:
- MAVSDK-C++ (2016). Used in production.
- MAVSDK-Swift (2018): Used in production.
- MAVSDK-Python (2019): Used in production.
- MAVSDK-Java (2019): Used in production.
- MAVSDK-Go (2020): Feature complete.
- MAVSDK-JavaScript (2019): Proof of concept.
- MAVSDK-CSharp (2019). Proof of concept.
- MAVSDK-Rust (2019): Proof of concept.
- Other cross-platform wrappers are actively being developed.
Getting Started
- Python 3 developers install and use MAVSDK-Python from PyPi (
pip3 install mavsdk
). There is no further setup, so you can then immediately run the examples in the normal way. The drone API is essentially the same as for the C++ API. - iOS developers should start from the MAVSDK-Swift reference.
- Python developers should check out the Python reference docs.
- C++ Developers should start at the C++ Library.
Getting Help
This guide contains information and examples showing how to use the SDK. If you have specific questions that are not answered by the documentation, these can be raised on:
Use Github for bug reports/enhancement requests:
Library Features
The core library (MAVSDK-C++) is written in C++, with auto-generated bindings for other supported programming languages.
The library is:
- Straightforward and easy to use. It has an API that supports both synchronous (blocking) and asynchronous calls (using callbacks).
- Fast, robust, and lightweight. Built to handle onboard usage with high rate messaging.
- Cross-platform (Linux, macOS, Windows, iOS, Android).
- Extensible, using compile-time plugins.
The main features provided by the API are (in all programing languages):
- Connect to and manage up to 255 vehicles via a TCP, UDP or serial connection.
- Get information about vehicles (vendor, software versions, product versions etc.)
- Get vehicle telemetry and state information (e.g. battery, GPS, RC connection, flight mode etc.) and set telemetry update rates.
- Send commands to arm, disarm, kill, takeoff, land and return to launch.
- Create and manage missions.
- Control a camera and gimbal both inside and outside of missions.
- Send commands to directly control vehicle movement.
- Send commands to start sensor calibration.
See the FAQ for answers to common questions about the library.
Contributing
We welcome contributions! If you want to help or have suggestions/bug reports please get in touch with the development team.
The Contributing (C++) section contains everything you need to contribute, including topics about building the SDK from source code, running our integration and unit tests, and all other aspects of core development.
License
- The MAVSDK is licensed under the permissive BSD 3-clause.
- This documentation is licensed under CC BY 4.0 license.
Governance
The MAVSDK project is hosted under the governance of the Dronecode Foundation.