The MAVSDK C++ library provides a simple C++ API for managing one or more vehicles via MAVLink. It enables programmatic access to vehicle information and telemetry, and control over missions, movement and other operations. The C++ library is designed to be performant, and can be used to enable tasks like computer vision, obstacle avoidance, and route planning.
The MAVSDK C++ library is a robust and well-tested library that is in use in production environments. Note however that the API is still being evolved and the project does not provide future compatibility guarantees.
Check out the QuickStart guide to get started.
A simple complete example can be found in Takeoff and Land.
Information about API changes between versions: API changes.
Mavsdk is the main library class. API consumers use Mavsdk to discover and access vehicles (System objects), which in turn provide access to all other drone information and control objects (e.g. Telemetry, Mission etc.).
The most important classes are:
- Mavsdk: Discover and connect to vehicles (System).
- System: Represents a connected vehicle (e.g. a copter or VTOL drone). It provides access to vehicle information and control through the classes listed below.
- Info: Basic version information about the hardware and/or software of a system.
- Telemetry: Get vehicle telemetry and state information and set telemetry update rates.
- Action: Simple drone actions including arming, taking off, and landing.
- Mission: Waypoint mission creation and upload/download. Missions are created from MissionItem objects.
- Offboard: Control a drone with velocity commands.
- Geofence: Specify a geofence.
- Gimbal: Control a gimbal.
- Camera: Control a camera.
- FollowMe: Drone tracks a position supplied by the SDK.
- Calibration: Calibrate sensors (e.g.: gyro, accelerometer, and magnetometer).
- LogFiles: Download log files from the vehicle.
The following APIs provide more direct access to underlying MAVLink messages/types. They should only be used where features are missing from the main APIs above.
- Param: Raw access to get and set parameters.
- MissionRaw: Direct access to MAVLink mission items.
- MavlinkPassthrough: Provides full/direct MAVLink access
The Contributing section contains everything you need to contribute to project, including topics about building the SDK from source code, running our integration and unit tests, and all other aspects of core development.
If something doesn't work as expected, make sure to check Troubleshooting.