Skip to content

Commit

Permalink
Update follow_me_example.py
Browse files Browse the repository at this point in the history
Fix Follow Me example by explicitly setting a non-zero value for absolute_altitude_m in target_location
  • Loading branch information
KarthiAru committed Aug 1, 2024
1 parent 707c48c commit 3d35010
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/follow_me_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ async def run():
# This for loop provides fake coordinates from the fake_location list for
# the follow me mode to work.
# In a simulator it won't make much sense though
target = TargetLocation(0,0,0,0,0,0)
for latitude, longitude in fake_location:
target = TargetLocation(latitude, longitude, 0, 0, 0, 0)
target.latitude_deg = latitude
target.longitude_deg = longitude
target.absolute_altitude_m = 480.0
target.velocity_x_m_s = 0
target.velocity_y_m_s = 0
target.velocity_z_m_s = 0
print("-- Following Target")
await drone.follow_me.set_target_location(target)
await asyncio.sleep(2)
Expand Down

0 comments on commit 3d35010

Please sign in to comment.