mavsdk::TrackingServer Class Reference

#include: tracking_server.h


API for an onboard image tracking software.

Data Structures

struct TrackPoint

struct TrackRectangle

Public Types

Type Description
enum CommandAnswer Answer to respond to an incoming command.
enum Result Possible results returned for tracking_server requests.
std::function< void(Result)> ResultCallback Callback type for asynchronous TrackingServer calls.
std::function< void(TrackPoint)> TrackingPointCommandCallback Callback type for subscribe_tracking_point_command.
std::function< void(TrackRectangle)> TrackingRectangleCommandCallback Callback type for subscribe_tracking_rectangle_command.
std::function< void(int32_t)> TrackingOffCommandCallback Callback type for subscribe_tracking_off_command.

Public Member Functions

Type Name Description
  TrackingServer (System & system) Constructor. Creates the plugin for a specific System.
  TrackingServer (std::shared_ptr< System > system) Constructor. Creates the plugin for a specific System.
  ~TrackingServer () Destructor (internal use only).
  TrackingServer (const TrackingServer & other) Copy constructor.
void set_tracking_point_status (TrackPoint tracked_point)const Set/update the current point tracking status.
void set_tracking_rectangle_status (TrackRectangle tracked_rectangle)const Set/update the current rectangle tracking status.
void set_tracking_off_status () const Set the current tracking status to off.
void subscribe_tracking_point_command (TrackingPointCommandCallback callback) Subscribe to incoming tracking point command.
void subscribe_tracking_rectangle_command (TrackingRectangleCommandCallback callback) Subscribe to incoming tracking rectangle command.
void subscribe_tracking_off_command (TrackingOffCommandCallback callback) Subscribe to incoming tracking off command.
Result respond_tracking_point_command (CommandAnswer command_answer)const Respond to an incoming tracking point command.
Result respond_tracking_rectangle_command (CommandAnswer command_answer)const Respond to an incoming tracking rectangle command.
Result respond_tracking_off_command (CommandAnswer command_answer)const Respond to an incoming tracking off command.
const TrackingServer & operator= (const TrackingServer &)=delete Equality operator (object is not copyable).

Constructor & Destructor Documentation

TrackingServer()

mavsdk::TrackingServer::TrackingServer(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto tracking_server = TrackingServer(system);

Parameters

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

TrackingServer()

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

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto tracking_server = TrackingServer(system);

Parameters

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

~TrackingServer()

mavsdk::TrackingServer::~TrackingServer()

Destructor (internal use only).

TrackingServer()

mavsdk::TrackingServer::TrackingServer(const TrackingServer &other)

Copy constructor.

Parameters

Member Typdef Documentation

typedef ResultCallback

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

Callback type for asynchronous TrackingServer calls.

typedef TrackingPointCommandCallback

using mavsdk::TrackingServer::TrackingPointCommandCallback =  std::function<void(TrackPoint)>

Callback type for subscribe_tracking_point_command.

typedef TrackingRectangleCommandCallback

using mavsdk::TrackingServer::TrackingRectangleCommandCallback =  std::function<void(TrackRectangle)>

Callback type for subscribe_tracking_rectangle_command.

typedef TrackingOffCommandCallback

using mavsdk::TrackingServer::TrackingOffCommandCallback =  std::function<void(int32_t)>

Callback type for subscribe_tracking_off_command.

Member Enumeration Documentation

enum CommandAnswer

Answer to respond to an incoming command.

Value Description
Accepted Command accepted.
TemporarilyRejected Command temporarily rejected.
Denied Command denied.
Unsupported Command unsupported.
Failed Command failed.

enum Result

Possible results returned for tracking_server requests.

Value Description
Unknown Unknown result.
Success Request succeeded.
NoSystem No system is connected.
ConnectionError Connection error.

Member Function Documentation

set_tracking_point_status()

void mavsdk::TrackingServer::set_tracking_point_status(TrackPoint tracked_point) const

Set/update the current point tracking status.

This function is blocking.

Parameters

set_tracking_rectangle_status()

void mavsdk::TrackingServer::set_tracking_rectangle_status(TrackRectangle tracked_rectangle) const

Set/update the current rectangle tracking status.

This function is blocking.

Parameters

set_tracking_off_status()

void mavsdk::TrackingServer::set_tracking_off_status() const

Set the current tracking status to off.

This function is blocking.

subscribe_tracking_point_command()

void mavsdk::TrackingServer::subscribe_tracking_point_command(TrackingPointCommandCallback callback)

Subscribe to incoming tracking point command.

Parameters

subscribe_tracking_rectangle_command()

void mavsdk::TrackingServer::subscribe_tracking_rectangle_command(TrackingRectangleCommandCallback callback)

Subscribe to incoming tracking rectangle command.

Parameters

subscribe_tracking_off_command()

void mavsdk::TrackingServer::subscribe_tracking_off_command(TrackingOffCommandCallback callback)

Subscribe to incoming tracking off command.

Parameters

respond_tracking_point_command()

Result mavsdk::TrackingServer::respond_tracking_point_command(CommandAnswer command_answer) const

Respond to an incoming tracking point command.

This function is blocking.

Parameters

Returns

Result - Result of request.

respond_tracking_rectangle_command()

Result mavsdk::TrackingServer::respond_tracking_rectangle_command(CommandAnswer command_answer) const

Respond to an incoming tracking rectangle command.

This function is blocking.

Parameters

Returns

Result - Result of request.

respond_tracking_off_command()

Result mavsdk::TrackingServer::respond_tracking_off_command(CommandAnswer command_answer) const

Respond to an incoming tracking off command.

This function is blocking.

Parameters

Returns

Result - Result of request.

operator=()

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

Equality operator (object is not copyable).

Parameters

Returns

 const TrackingServer & -

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

results matching ""

    No results matching ""