mavsdk::MissionRaw Class Reference
#include: mission_raw.h
The MissionRaw class enables direct access to MAVLink mission items.
This plugin gives direct access to the MAVLink mission protocol which means full control over waypoints and waypoint actions/commands. However, this means that not all functionality provided is actually implemented or correctly supported by a flight controller.
For a tested, simpler subset in mission functionality, it is recommended to use the Mission plugin.
Currently, only downloading the mission items is implemented, uploading could be added in the future if required.
Data Structures
struct MavlinkMissionItemInt
Public Types
Type | Description |
---|---|
enum Result | Possible results returned for mission requests. |
std::function< void(Result, std::vector< std::shared_ptr< MavlinkMissionItemInt > >)> mission_items_and_result_callback_t | Type for vector of mission items. |
std::function< void()> mission_changed_callback_t | Callback type to signal if the mission has changed. |
Public Member Functions
Type | Name | Description |
---|---|---|
MissionRaw (System & system) | Constructor. Creates the plugin for a specific System. | |
~MissionRaw () | Destructor (internal use only). | |
MissionRaw (const MissionRaw &)=delete | Copy constructor (object is not copyable). | |
void | download_mission_async (mission_items_and_result_callback_t callback) | Downloads a vector of mission items from the system (asynchronous). |
void | download_mission_cancel () | Cancel a mission download (asynchronous). |
void | subscribe_mission_changed (mission_changed_callback_t callback) | Subscribes to mission progress (asynchronous). |
const MissionRaw & | operator= (const MissionRaw &)=delete | Equality operator (object is not copyable). |
Static Public Member Functions
Type | Name | Description |
---|---|---|
const char * | result_str (Result result) | Gets a human-readable English string for an MissionRaw::Result. |
Constructor & Destructor Documentation
MissionRaw()
mavsdk::MissionRaw::MissionRaw(System &system)
Constructor. Creates the plugin for a specific System.
The plugin is typically created as shown below:
auto mission_raw = std::make_shared<MissionRaw>(system);
Parameters
- System& system - The specific system associated with this plugin.
~MissionRaw()
mavsdk::MissionRaw::~MissionRaw()
Destructor (internal use only).
MissionRaw()
mavsdk::MissionRaw::MissionRaw(const MissionRaw &)=delete
Copy constructor (object is not copyable).
Parameters
- const MissionRaw& -
Member Typdef Documentation
typedef mission_items_and_result_callback_t
typedef std::function<void(Result, std::vector<std::shared_ptr<MavlinkMissionItemInt> >)> mavsdk::MissionRaw::mission_items_and_result_callback_t
Type for vector of mission items.
typedef mission_changed_callback_t
typedef std::function<void()> mavsdk::MissionRaw::mission_changed_callback_t
Callback type to signal if the mission has changed.
Member Enumeration Documentation
enum Result
Possible results returned for mission requests.
Value | Description |
---|---|
UNKNOWN |
Unknown error. |
SUCCESS |
Request succeeded. |
ERROR |
Error. |
BUSY |
Vehicle busy. |
TIMEOUT |
Request timed out. |
INVALID_ARGUMENT |
Invalid argument. |
NO_MISSION_AVAILABLE |
No mission available on system. |
CANCELLED |
Mission upload or download has been cancelled. |
Member Function Documentation
download_mission_async()
void mavsdk::MissionRaw::download_mission_async(mission_items_and_result_callback_t callback)
Downloads a vector of mission items from the system (asynchronous).
The method will fail if any of the downloaded mission items are not supported by the MAVSDK API.
Parameters
- mission_items_and_result_callback_t callback - Callback to receive mission items and result of this request.
download_mission_cancel()
void mavsdk::MissionRaw::download_mission_cancel()
Cancel a mission download (asynchronous).
This cancels an ongoing mission download. The mission download will fail with the result Result::CANCELLED.
subscribe_mission_changed()
void mavsdk::MissionRaw::subscribe_mission_changed(mission_changed_callback_t callback)
Subscribes to mission progress (asynchronous).
Parameters
- mission_changed_callback_t callback - Callback to receive mission progress.
operator=()
const MissionRaw& mavsdk::MissionRaw::operator=(const MissionRaw &)=delete
Equality operator (object is not copyable).
Parameters
- const MissionRaw& -
Returns
const MissionRaw & -
result_str()
static const char* mavsdk::MissionRaw::result_str(Result result)
Gets a human-readable English string for an MissionRaw::Result.
Parameters
- Result result - Enum for which string is required.
Returns
const char * - Human readable string for the MissionRaw::Result.