Skip to content

Commit

Permalink
Update follow_me_example to use MAVSDK v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfrakes committed Jun 14, 2024
1 parent fca61e3 commit 865fbe6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/follow_me_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from mavsdk.follow_me import (Config, FollowMeError, TargetLocation)


default_height = 8.0 # in meters
follow_height = 8.0 # in meters
# distance between drone and target
follow_distance = 2.0 # in meters

# Direction relative to the Target
# Options are NONE, FRONT, FRONT_LEFT, FRONT_RIGHT, BEHIND
direction = Config.FollowDirection.BEHIND
responsiveness = 0.02
altitude_mode = Config.FollowAltitudeMode.TARGET_GPS
max_follow_vel = 10
# direction relative to the target
follow_angle_deg = 0

# This list contains fake location coordinates
# (These coordinates are obtained from mission.py example)
Expand Down Expand Up @@ -45,7 +45,8 @@ async def run():

# Follow me Mode requires some configuration to be done before starting
# the mode
conf = Config(default_height, follow_distance, direction, responsiveness)
conf = Config(follow_height, follow_distance, responsiveness,
altitude_mode, max_follow_vel, follow_angle_deg)
await drone.follow_me.set_config(conf)

print("-- Taking Off")
Expand Down

0 comments on commit 865fbe6

Please sign in to comment.