Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update follow_me_example to use MAVSDK v2 #709

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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