FollowMe

class mavsdk.follow_me.Config(follow_height_m, follow_distance_m, responsiveness, altitude_mode, max_tangential_vel_m_s, follow_angle_deg)

Bases: object

Configuration type.

Parameters:
  • follow_height_m (float) – [m] Follow height in meters (recommended minimum 8 meters)

  • follow_distance_m (float) – [m] Follow distance to target in meters (recommended minimum 4 meter)

  • responsiveness (float) – How responsive the vehicle is to the motion of the target, Lower value = More responsive (range 0.0 to 1.0)

  • altitude_mode (FollowAltitudeMode) – Follow Altitude control mode

  • max_tangential_vel_m_s (float) – [m/s] Maximum orbit tangential velocity relative to the target, in meters per second. Higher value = More aggressive follow angle tracking.

  • follow_angle_deg (float) – [deg] Follow Angle relative to the target. 0 equals following in front of the target’s direction. Angle increases in Clockwise direction, so following from right would be 90 degrees, from the left is -90 degrees, and so on.

class FollowAltitudeMode(value)

Bases: Enum

Altitude mode to configure which altitude the follow me will assume the target to be at.

Values

CONSTANT

Target assumed to be mobing at a constant altitude of home position (where the vehicle armed)

TERRAIN

Target assumed to be at the terrain level sensed by the distance sensor

TARGET_GPS

Target GPS altitude taken into account to do 3D tracking

CONSTANT = 0
TARGET_GPS = 2
TERRAIN = 1
class mavsdk.follow_me.FollowMe(async_plugin_manager)

Bases: 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

Possible results returned for followme operations

Values

UNKNOWN

Unknown 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