Skip to content

Commit

Permalink
Fix Follow Me example (#722)
Browse files Browse the repository at this point in the history
* Update follow_me_example.py

Fix Follow Me example by explicitly setting a non-zero value for absolute_altitude_m in target_location

* Update follow_me_example.py

Fixing style
  • Loading branch information
KarthiAru authored Aug 2, 2024
1 parent 707c48c commit b72924a
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 b72924a

Please sign in to comment.