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() overrideDestructor (internal use only).
FollowMe() ​
mavsdk::FollowMe::FollowMe(const FollowMe &other)Copy constructor.
Parameters
- const FollowMe& other -
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() constGet current configuration.
This function is blocking.
Returns
 FollowMe::Config - Result of request.
set_config() ​
Result mavsdk::FollowMe::set_config(Config config) constApply configuration by sending it to the system.
This function is blocking.
Parameters
- Config config -
Returns
 Result - Result of request.
is_active() ​
bool mavsdk::FollowMe::is_active() constCheck if FollowMe is active.
This function is blocking.
Returns
 bool - Result of request.
set_target_location() ​
Result mavsdk::FollowMe::set_target_location(TargetLocation location) constSet location of the moving target.
This function is blocking.
Parameters
- TargetLocation location -
Returns
 Result - Result of request.
get_last_location() ​
FollowMe::TargetLocation mavsdk::FollowMe::get_last_location() constGet the last location of the target.
This function is blocking.
Returns
 FollowMe::TargetLocation - Result of request.
start() ​
Result mavsdk::FollowMe::start() constStart FollowMe mode.
This function is blocking.
Returns
 Result - Result of request.
stop() ​
Result mavsdk::FollowMe::stop() constStop FollowMe mode.
This function is blocking.
Returns
 Result - Result of request.
operator=() ​
const FollowMe & mavsdk::FollowMe::operator=(const FollowMe &)=deleteEquality operator (object is not copyable).
Parameters
- const FollowMe& -
Returns
 const FollowMe & -

