mavsdk::MissionRawServer Class Reference

#include: mission_raw_server.h


Acts as a vehicle and receives incoming missions from GCS (in raw MAVLINK format). Provides current mission item state, so the server can progress through missions.

Data Structures

struct MissionItem

struct MissionPlan

struct MissionProgress

Public Types

Type Description
enum Result Possible results returned for action requests.
std::function< void(Result)> ResultCallback Callback type for asynchronous MissionRawServer calls.
std::function< void(Result, MissionPlan)> IncomingMissionCallback Callback type for subscribe_incoming_mission.
std::function< void(MissionItem)> CurrentItemChangedCallback Callback type for subscribe_current_item_changed.
std::function< void(uint32_t)> ClearAllCallback Callback type for subscribe_clear_all.

Public Member Functions

Type Name Description
  MissionRawServer (System & system) Constructor. Creates the plugin for a specific System.
  MissionRawServer (std::shared_ptr< System > system) Constructor. Creates the plugin for a specific System.
  ~MissionRawServer () Destructor (internal use only).
  MissionRawServer (const MissionRawServer & other) Copy constructor.
void subscribe_incoming_mission (IncomingMissionCallback callback) Subscribe to when a new mission is uploaded (asynchronous).
MissionPlan incoming_mission () const Poll for 'MissionPlan' (blocking).
void subscribe_current_item_changed (CurrentItemChangedCallback callback) Subscribe to when a new current item is set.
MissionItem current_item_changed () const Poll for 'MissionItem' (blocking).
void set_current_item_complete () const Set Current item as completed.
void subscribe_clear_all (ClearAllCallback callback) Subscribe when a MISSION_CLEAR_ALL is received.
uint32_t clear_all () const Poll for 'uint32_t' (blocking).
const MissionRawServer & operator= (const MissionRawServer &)=delete Equality operator (object is not copyable).

Constructor & Destructor Documentation

MissionRawServer()

mavsdk::MissionRawServer::MissionRawServer(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto mission_raw_server = MissionRawServer(system);

Parameters

  • System& system - The specific system associated with this plugin.

MissionRawServer()

mavsdk::MissionRawServer::MissionRawServer(std::shared_ptr< System > system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto mission_raw_server = MissionRawServer(system);

Parameters

  • std::shared_ptr< System > system - The specific system associated with this plugin.

~MissionRawServer()

mavsdk::MissionRawServer::~MissionRawServer()

Destructor (internal use only).

MissionRawServer()

mavsdk::MissionRawServer::MissionRawServer(const MissionRawServer &other)

Copy constructor.

Parameters

Member Typdef Documentation

typedef ResultCallback

using mavsdk::MissionRawServer::ResultCallback =  std::function<void(Result)>

Callback type for asynchronous MissionRawServer calls.

typedef IncomingMissionCallback

using mavsdk::MissionRawServer::IncomingMissionCallback =  std::function<void(Result, MissionPlan)>

Callback type for subscribe_incoming_mission.

typedef CurrentItemChangedCallback

using mavsdk::MissionRawServer::CurrentItemChangedCallback =  std::function<void(MissionItem)>

Callback type for subscribe_current_item_changed.

typedef ClearAllCallback

using mavsdk::MissionRawServer::ClearAllCallback =  std::function<void(uint32_t)>

Callback type for subscribe_clear_all.

Member Enumeration Documentation

enum Result

Possible results returned for action requests.

Value Description
Unknown Unknown result.
Success Request succeeded.
Error Error.
TooManyMissionItems Too many mission items in the mission.
Busy Vehicle is busy.
Timeout Request timed out.
InvalidArgument Invalid argument.
Unsupported Mission downloaded from the system is not supported.
NoMissionAvailable No mission available on the system.
UnsupportedMissionCmd Unsupported mission command.
TransferCancelled Mission transfer (upload or download) has been cancelled.
NoSystem No system connected.
Next Intermediate message showing progress or instructions on the next steps.

Member Function Documentation

subscribe_incoming_mission()

void mavsdk::MissionRawServer::subscribe_incoming_mission(IncomingMissionCallback callback)

Subscribe to when a new mission is uploaded (asynchronous).

Parameters

incoming_mission()

MissionPlan mavsdk::MissionRawServer::incoming_mission() const

Poll for 'MissionPlan' (blocking).

Returns

MissionPlan - One MissionPlan update.

subscribe_current_item_changed()

void mavsdk::MissionRawServer::subscribe_current_item_changed(CurrentItemChangedCallback callback)

Subscribe to when a new current item is set.

Parameters

current_item_changed()

MissionItem mavsdk::MissionRawServer::current_item_changed() const

Poll for 'MissionItem' (blocking).

Returns

MissionItem - One MissionItem update.

set_current_item_complete()

void mavsdk::MissionRawServer::set_current_item_complete() const

Set Current item as completed.

This function is blocking.

subscribe_clear_all()

void mavsdk::MissionRawServer::subscribe_clear_all(ClearAllCallback callback)

Subscribe when a MISSION_CLEAR_ALL is received.

Parameters

clear_all()

uint32_t mavsdk::MissionRawServer::clear_all() const

Poll for 'uint32_t' (blocking).

Returns

 uint32_t - One uint32_t update.

operator=()

const MissionRawServer& mavsdk::MissionRawServer::operator=(const MissionRawServer &)=delete

Equality operator (object is not copyable).

Parameters

Returns

 const MissionRawServer & -

© Dronecode 2017-2020. License: CC BY 4.0            Updated: 2022-05-26 20:06:59

results matching ""

    No results matching ""