mavsdk::FollowMe Class Reference

#include: follow_me.h


Allow users to command the vehicle to follow a specific target. The target is provided as a GPS coordinate and altitude.

Data Structures

struct Config

struct TargetLocation

Public Types

Type Description
enum Result Possible results returned for followme operations.
std::function< void(Result)> ResultCallback Callback type for asynchronous FollowMe calls.

Public Member Functions

Type Name Description
  FollowMe (System & system) Constructor. Creates the plugin for a specific System.
  FollowMe (std::shared_ptr< System > system) Constructor. Creates the plugin for a specific System.
  ~FollowMe () override Destructor (internal use only).
  FollowMe (const FollowMe & other) Copy constructor.
FollowMe::Config get_config () const Get current configuration.
Result set_config (Config config)const Apply configuration by sending it to the system.
bool is_active () const Check if FollowMe is active.
Result set_target_location (TargetLocation location)const Set location of the moving target.
FollowMe::TargetLocation get_last_location () const Get the last location of the target.
Result start () const Start FollowMe mode.
Result stop () const Stop FollowMe mode.
const FollowMe & operator= (const FollowMe &)=delete Equality operator (object is not copyable).

Constructor & Destructor Documentation

FollowMe()

mavsdk::FollowMe::FollowMe(System &system)

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto follow_me = FollowMe(system);

Parameters

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

FollowMe()

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

Constructor. Creates the plugin for a specific System.

The plugin is typically created as shown below:

auto follow_me = FollowMe(system);

Parameters

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

~FollowMe()

mavsdk::FollowMe::~FollowMe() override

Destructor (internal use only).

FollowMe()

mavsdk::FollowMe::FollowMe(const FollowMe &other)

Copy constructor.

Parameters

Member Typdef Documentation

typedef ResultCallback

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

Callback type for asynchronous FollowMe calls.

Member Enumeration Documentation

enum Result

Possible results returned for followme operations.

Value Description
Unknown Unknown result.
Success Request succeeded.
NoSystem No system connected.
ConnectionError Connection error.
Busy Vehicle is busy.
CommandDenied Command denied.
Timeout Request timed out.
NotActive FollowMe is not active.
SetConfigFailed Failed to set FollowMe configuration.

Member Function Documentation

get_config()

FollowMe::Config mavsdk::FollowMe::get_config() const

Get current configuration.

This function is blocking.

Returns

FollowMe::Config - Result of request.

set_config()

Result mavsdk::FollowMe::set_config(Config config) const

Apply configuration by sending it to the system.

This function is blocking.

Parameters

Returns

Result - Result of request.

is_active()

bool mavsdk::FollowMe::is_active() const

Check if FollowMe is active.

This function is blocking.

Returns

 bool - Result of request.

set_target_location()

Result mavsdk::FollowMe::set_target_location(TargetLocation location) const

Set location of the moving target.

This function is blocking.

Parameters

Returns

Result - Result of request.

get_last_location()

FollowMe::TargetLocation mavsdk::FollowMe::get_last_location() const

Get the last location of the target.

This function is blocking.

Returns

FollowMe::TargetLocation - Result of request.

start()

Result mavsdk::FollowMe::start() const

Start FollowMe mode.

This function is blocking.

Returns

Result - Result of request.

stop()

Result mavsdk::FollowMe::stop() const

Stop FollowMe mode.

This function is blocking.

Returns

Result - Result of request.

operator=()

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

Equality operator (object is not copyable).

Parameters

Returns

 const FollowMe & -

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

results matching ""

    No results matching ""