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.
Handle< TrackPoint > TrackingPointCommandHandle Handle type for subscribe_tracking_point_command.
std::function< void(TrackRectangle)> TrackingRectangleCommandCallback Callback type for subscribe_tracking_rectangle_command.
Handle< TrackRectangle > TrackingRectangleCommandHandle Handle type for subscribe_tracking_rectangle_command.
std::function< void(int32_t)> TrackingOffCommandCallback Callback type for subscribe_tracking_off_command.
Handle< int32_t > TrackingOffCommandHandle Handle type for subscribe_tracking_off_command.

Public Member Functions

Type Name Description
  TrackingServer (std::shared_ptr< ServerComponent > server_component) Constructor. Creates the plugin for a ServerComponent instance.
  ~TrackingServer () override 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.
TrackingPointCommandHandle subscribe_tracking_point_command (const TrackingPointCommandCallback & callback) Subscribe to incoming tracking point command.
void unsubscribe_tracking_point_command (TrackingPointCommandHandle handle) Unsubscribe from subscribe_tracking_point_command.
TrackingRectangleCommandHandle subscribe_tracking_rectangle_command (const TrackingRectangleCommandCallback & callback) Subscribe to incoming tracking rectangle command.
void unsubscribe_tracking_rectangle_command (TrackingRectangleCommandHandle handle) Unsubscribe from subscribe_tracking_rectangle_command.
TrackingOffCommandHandle subscribe_tracking_off_command (const TrackingOffCommandCallback & callback) Subscribe to incoming tracking off command.
void unsubscribe_tracking_off_command (TrackingOffCommandHandle handle) Unsubscribe from subscribe_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(std::shared_ptr< ServerComponent > server_component)

Constructor. Creates the plugin for a ServerComponent instance.

The plugin is typically created as shown below:

auto tracking_server = TrackingServer(server_component);

Parameters

~TrackingServer()

mavsdk::TrackingServer::~TrackingServer() override

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 TrackingPointCommandHandle

using mavsdk::TrackingServer::TrackingPointCommandHandle =  Handle<TrackPoint>

Handle type for subscribe_tracking_point_command.

typedef TrackingRectangleCommandCallback

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

Callback type for subscribe_tracking_rectangle_command.

typedef TrackingRectangleCommandHandle

using mavsdk::TrackingServer::TrackingRectangleCommandHandle =  Handle<TrackRectangle>

Handle type for subscribe_tracking_rectangle_command.

typedef TrackingOffCommandCallback

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

Callback type for subscribe_tracking_off_command.

typedef TrackingOffCommandHandle

using mavsdk::TrackingServer::TrackingOffCommandHandle =  Handle<int32_t>

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

TrackingPointCommandHandle mavsdk::TrackingServer::subscribe_tracking_point_command(const TrackingPointCommandCallback &callback)

Subscribe to incoming tracking point command.

Parameters

Returns

TrackingPointCommandHandle -

unsubscribe_tracking_point_command()

void mavsdk::TrackingServer::unsubscribe_tracking_point_command(TrackingPointCommandHandle handle)

Unsubscribe from subscribe_tracking_point_command.

Parameters

subscribe_tracking_rectangle_command()

TrackingRectangleCommandHandle mavsdk::TrackingServer::subscribe_tracking_rectangle_command(const TrackingRectangleCommandCallback &callback)

Subscribe to incoming tracking rectangle command.

Parameters

Returns

TrackingRectangleCommandHandle -

unsubscribe_tracking_rectangle_command()

void mavsdk::TrackingServer::unsubscribe_tracking_rectangle_command(TrackingRectangleCommandHandle handle)

Unsubscribe from subscribe_tracking_rectangle_command.

Parameters

subscribe_tracking_off_command()

TrackingOffCommandHandle mavsdk::TrackingServer::subscribe_tracking_off_command(const TrackingOffCommandCallback &callback)

Subscribe to incoming tracking off command.

Parameters

Returns

TrackingOffCommandHandle -

unsubscribe_tracking_off_command()

void mavsdk::TrackingServer::unsubscribe_tracking_off_command(TrackingOffCommandHandle handle)

Unsubscribe from subscribe_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 & -

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

results matching ""

    No results matching ""