Trouble with Starting FollowMe API with LookAt Behavior in Olympe

Hello,

We are trying to get the FollowMe API working in Olympe with “LookAt” behavior. For target detection, we use a DNN running on the drone’s video stream which gives us an estimated GPS location based on the target’s location in frame, the drone’s location, and the drone’s pose. From there, we compute an estimated azimuth and elevation which we send to the drone. Here is a snippet of our tracking code. When we run this code, the drone fails to track the detected object. Inspecting follow_me.mode_info, we see that the only missing requirement is <image_detection: 6> even though we send our first image detection prior to starting the API. We have tried waiting on the framing and image detection commands to send and complete successfully to no avail. Can someone offer some insight into what we are doing wrong? Thanks in advance for your help.

self.behavior = mode.look_at
while self.active:
    try:
        det = json.loads(self.sub_socket.recv_json())
        if not self.tracking and len(det) > 0:
            print("Starting new track on object: \"{0}\"".format(det[0]["class"]))
            self.tracking = True
            azi, elev = self.calculate_azimuth_elevation(det[0]["lat"], det[0]["lon"])
            conf = int(det[0]["score"] * 255)
            self.drone(follow_me.set_target_is_controller(0))
            self.drone(follow_me.target_image_detection(azi, elev, 0.0, conf, 1, self.current_time_millis()))
            self.drone(follow_me.target_framing_position(50, 50))
            self.drone(follow_me.start(self.behavior))
        elif self.tracking and len(det) > 0:
            print("Got detection from cloudlet: {0}".format(json.dumps(det)))
            azi, elev = self.calculate_azimuth_elevation(det[0]["lat"], det[0]["lon"])
            conf = int(det[0]["score"] * 255)
            self.drone(follow_me.target_image_detection(azi, elev, 0.0, conf, 0, self.current_time_millis()))
    except Exception as e:
        print(f"Exception: {e}")

Here is the log of follow_me.mode_info:

OrderedDict([('mode', <mode.look_at: 1>), ('missing_requirements', <input_Bitfield: [<input.drone_calibrated: 0>, <input.drone_gps_good_accuracy: 1>, <input.target_gps_good_accuracy: 2>, <input.target_barometer_ok: 3>, <input.drone_far_enough: 4>, <input.drone_high_enough: 5>, <input.target_good_speed: 7>, <input.drone_close_enough: 8>]>), ('improvements', <input_Bitfield: [<input.drone_calibrated: 0>, <input.drone_gps_good_accuracy: 1>, <input.target_gps_good_accuracy: 2>, <input.target_barometer_ok: 3>, <input.drone_far_enough: 4>, <input.drone_high_enough: 5>, <input.image_detection: 6>, <input.target_good_speed: 7>, <input.drone_close_enough: 8>]>), ('list_flags', <list_flags_Bitfield: []>)]))

This topic was automatically closed after 30 days. New replies are no longer allowed.