Skip to content

Commit b72924a

Browse files
authored
Fix Follow Me example (#722)
* 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
1 parent 707c48c commit b72924a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/follow_me_example.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ async def run():
5959
# This for loop provides fake coordinates from the fake_location list for
6060
# the follow me mode to work.
6161
# In a simulator it won't make much sense though
62+
target = TargetLocation(0, 0, 0, 0, 0, 0)
6263
for latitude, longitude in fake_location:
63-
target = TargetLocation(latitude, longitude, 0, 0, 0, 0)
64+
target.latitude_deg = latitude
65+
target.longitude_deg = longitude
66+
target.absolute_altitude_m = 480.0
67+
target.velocity_x_m_s = 0
68+
target.velocity_y_m_s = 0
69+
target.velocity_z_m_s = 0
6470
print("-- Following Target")
6571
await drone.follow_me.set_target_location(target)
6672
await asyncio.sleep(2)

0 commit comments

Comments
 (0)