Skip to content

Commit 02c8dce

Browse files
authored
Update follow_me_example to use MAVSDK v2 (#709)
* Update follow_me_example to use MAVSDK v2 * Fix spacing for pycodestyle
1 parent fca61e3 commit 02c8dce

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

examples/follow_me_example.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from mavsdk.follow_me import (Config, FollowMeError, TargetLocation)
88

99

10-
default_height = 8.0 # in meters
10+
follow_height = 8.0 # in meters
1111
# distance between drone and target
1212
follow_distance = 2.0 # in meters
13-
14-
# Direction relative to the Target
15-
# Options are NONE, FRONT, FRONT_LEFT, FRONT_RIGHT, BEHIND
16-
direction = Config.FollowDirection.BEHIND
1713
responsiveness = 0.02
14+
altitude_mode = Config.FollowAltitudeMode.TARGET_GPS
15+
max_follow_vel = 10
16+
# direction relative to the target
17+
follow_angle_deg = 0
1818

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

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

5152
print("-- Taking Off")

0 commit comments

Comments
 (0)