FollowMe

class mavsdk.follow_me.Config(min_height_m, follow_distance_m, follow_direction, responsiveness)

Bases: object

Configuration type.

Parameters
  • min_height_m (float) – Minimum height for the vehicle in meters (recommended minimum 8 meters)

  • follow_distance_m (float) – Distance from target for vehicle to follow in meters (recommended minimum 1 meter)

  • follow_direction (FollowDirection) – Direction to follow in

  • responsiveness (float) – How responsive the vehicle is to the motion of the target (range 0.0 to 1.0)

class FollowDirection(value)

Bases: enum.Enum

Direction relative to the target that the vehicle should follow

NONE

Do not follow

BEHIND

Follow from behind

FRONT

Follow from front

FRONT_RIGHT

Follow from front right

FRONT_LEFT

Follow from front left

BEHIND = 1
FRONT = 2
FRONT_LEFT = 4
FRONT_RIGHT = 3
NONE = 0
class mavsdk.follow_me.FollowMe(async_plugin_manager)

Bases: mavsdk._base.AsyncBase

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

Generated by dcsdkgen - MAVSDK FollowMe API

async get_config()

Get current configuration.

Returns

config – The current configuration

Return type

Config

async get_last_location()

Get the last location of the target.

Returns

location – The last target location that was set

Return type

TargetLocation

async is_active()

Check if FollowMe is active.

Returns

is_active – Whether follow me is active or not

Return type

bool

name = 'FollowMe'
async set_config(config)

Apply configuration by sending it to the system.

Parameters

config (Config) – The new configuration to be set

Raises

FollowMeError – If the request fails. The error contains the reason for the failure.

async set_target_location(location)

Set location of the moving target.

Parameters

location (TargetLocation) – The new TargetLocation to follow

Raises

FollowMeError – If the request fails. The error contains the reason for the failure.

async start()

Start FollowMe mode.

Raises

FollowMeError – If the request fails. The error contains the reason for the failure.

async stop()

Stop FollowMe mode.

Raises

FollowMeError – If the request fails. The error contains the reason for the failure.

exception mavsdk.follow_me.FollowMeError(result, origin, *params)

Bases: Exception

Raised when a FollowMeResult is a fail code

class mavsdk.follow_me.FollowMeResult(result, result_str)

Bases: object

Parameters
  • result (Result) – Result enum value

  • result_str (std::string) – Human-readable English string describing the result

class Result(value)

Bases: enum.Enum

Possible results returned for followme operations

UNKNOWN

Unkown result

SUCCESS

Request succeeded

NO_SYSTEM

No system connected

CONNECTION_ERROR

Connection error

BUSY

Vehicle is busy

COMMAND_DENIED

Command denied

TIMEOUT

Request timed out

NOT_ACTIVE

FollowMe is not active

SET_CONFIG_FAILED

Failed to set FollowMe configuration

BUSY = 4
COMMAND_DENIED = 5
CONNECTION_ERROR = 3
NOT_ACTIVE = 7
NO_SYSTEM = 2
SET_CONFIG_FAILED = 8
SUCCESS = 1
TIMEOUT = 6
UNKNOWN = 0
class mavsdk.follow_me.TargetLocation(latitude_deg, longitude_deg, absolute_altitude_m, velocity_x_m_s, velocity_y_m_s, velocity_z_m_s)

Bases: object

Target location for the vehicle to follow

Parameters
  • latitude_deg (double) – Target latitude in degrees

  • longitude_deg (double) – Target longitude in degrees

  • absolute_altitude_m (float) – Target altitude in meters above MSL

  • velocity_x_m_s (float) – Target velocity in X axis, in meters per second

  • velocity_y_m_s (float) – Target velocity in Y axis, in meters per second

  • velocity_z_m_s (float) – Target velocity in Z axis, in meters per second