From b72924a68674829110b85285c9fc7e3e2014721f Mon Sep 17 00:00:00 2001 From: Karthik Arumugham Date: Fri, 2 Aug 2024 08:51:26 +0530 Subject: [PATCH] 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 --- examples/follow_me_example.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/follow_me_example.py b/examples/follow_me_example.py index 604f8c01..6615eeab 100755 --- a/examples/follow_me_example.py +++ b/examples/follow_me_example.py @@ -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)