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.
Handle< Result, MissionPlan > IncomingMissionHandle Handle type for subscribe_incoming_mission.
std::function< void(MissionItem)> CurrentItemChangedCallback Callback type for subscribe_current_item_changed.
Handle< MissionItem > CurrentItemChangedHandle Handle type for subscribe_current_item_changed.
std::function< void(uint32_t)> ClearAllCallback Callback type for subscribe_clear_all.
Handle< uint32_t > ClearAllHandle Handle type for subscribe_clear_all.

Public Member Functions

Type Name Description
  MissionRawServer (std::shared_ptr< ServerComponent > server_component) Constructor. Creates the plugin for a ServerComponent instance.
  ~MissionRawServer () override Destructor (internal use only).
  MissionRawServer (const MissionRawServer & other) Copy constructor.
IncomingMissionHandle subscribe_incoming_mission (const IncomingMissionCallback & callback) Subscribe to when a new mission is uploaded (asynchronous).
void unsubscribe_incoming_mission (IncomingMissionHandle handle) Unsubscribe from subscribe_incoming_mission.
MissionPlan incoming_mission () const Poll for 'MissionPlan' (blocking).
CurrentItemChangedHandle subscribe_current_item_changed (const CurrentItemChangedCallback & callback) Subscribe to when a new current item is set.
void unsubscribe_current_item_changed (CurrentItemChangedHandle handle) Unsubscribe from subscribe_current_item_changed.
MissionItem current_item_changed () const Poll for 'MissionItem' (blocking).
void set_current_item_complete () const Set Current item as completed.
ClearAllHandle subscribe_clear_all (const ClearAllCallback & callback) Subscribe when a MISSION_CLEAR_ALL is received.
void unsubscribe_clear_all (ClearAllHandle handle) Unsubscribe from subscribe_clear_all.
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(std::shared_ptr< ServerComponent > server_component)

Constructor. Creates the plugin for a ServerComponent instance.

The plugin is typically created as shown below:

auto mission_raw_server = MissionRawServer(server_component);

Parameters

~MissionRawServer()

mavsdk::MissionRawServer::~MissionRawServer() override

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 IncomingMissionHandle

using mavsdk::MissionRawServer::IncomingMissionHandle =  Handle<Result, MissionPlan>

Handle type for subscribe_incoming_mission.

typedef CurrentItemChangedCallback

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

Callback type for subscribe_current_item_changed.

typedef CurrentItemChangedHandle

using mavsdk::MissionRawServer::CurrentItemChangedHandle =  Handle<MissionItem>

Handle type for subscribe_current_item_changed.

typedef ClearAllCallback

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

Callback type for subscribe_clear_all.

typedef ClearAllHandle

using mavsdk::MissionRawServer::ClearAllHandle =  Handle<uint32_t>

Handle 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()

IncomingMissionHandle mavsdk::MissionRawServer::subscribe_incoming_mission(const IncomingMissionCallback &callback)

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

Parameters

Returns

IncomingMissionHandle -

unsubscribe_incoming_mission()

void mavsdk::MissionRawServer::unsubscribe_incoming_mission(IncomingMissionHandle handle)

Unsubscribe from subscribe_incoming_mission.

Parameters

incoming_mission()

MissionPlan mavsdk::MissionRawServer::incoming_mission() const

Poll for 'MissionPlan' (blocking).

Returns

MissionPlan - One MissionPlan update.

subscribe_current_item_changed()

CurrentItemChangedHandle mavsdk::MissionRawServer::subscribe_current_item_changed(const CurrentItemChangedCallback &callback)

Subscribe to when a new current item is set.

Parameters

Returns

CurrentItemChangedHandle -

unsubscribe_current_item_changed()

void mavsdk::MissionRawServer::unsubscribe_current_item_changed(CurrentItemChangedHandle handle)

Unsubscribe from subscribe_current_item_changed.

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()

ClearAllHandle mavsdk::MissionRawServer::subscribe_clear_all(const ClearAllCallback &callback)

Subscribe when a MISSION_CLEAR_ALL is received.

Parameters

Returns

ClearAllHandle -

unsubscribe_clear_all()

void mavsdk::MissionRawServer::unsubscribe_clear_all(ClearAllHandle handle)

Unsubscribe from subscribe_clear_all.

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 & -

© MAVSDK Development Team 2017-2023. License: CC BY 4.0            Updated: 2023-12-27 03:58:12

results matching ""

    No results matching ""