Managing Systems/Vehicles (Using Plugins)

Access to drone information, telemetry and control objects are provided by a number of different plugins. For example, the Action plugin is used to arm, takeoff and land the vehicle, while the Telemetry plugin can be used to query the vehicle GPS status, flight mode, etc. A separate plugin instance must be created for each system that needs it.

All plugins are declared/used in the same way. This topic uses the Action plugin for the purposes of the demonstration.

To use a plugin first link the plugin library into the application. Do this by adding it to the target_link_libraries section of the app's cmake build definition file:


Plugins are named using the convention For more information see Building C++ Apps

In the application source code:

  1. #include the header file for the plugin.
    #include <mavsdk/plugins/action/action.h>
  2. Create a connection to a System object (below named: system).
  3. Create the plugin instance, specifying the System it is to be used with:
    auto action = Action{system};
  4. The pointer can then be used to invoke actions on the specified system. For example, to takeoff you would call the API as shown:
© Dronecode 2017-2020. License: CC BY 4.0            Updated: 2023-03-09 01:10:03

results matching ""

    No results matching ""