How to use the djitellopy.tello.Tello.udp_state_receiver function in djitellopy

To help you get started, we’ve selected a few djitellopy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github damiafuentes / DJITelloPy / djitellopy / tello.py View on Github external
self.address = (host, Tello.CONTROL_UDP_PORT)
        self.stream_on = False
        self.retry_count = retry_count
        self.last_received_command_timestamp = time.time()
        self.last_rc_control_timestamp = time.time()

        if drones is None:
            drones = {}

            # Run Tello command responses UDP receiver on background
            response_receiver_thread = threading.Thread(target=Tello.udp_response_receiver)
            response_receiver_thread.daemon = True
            response_receiver_thread.start()

            # Run state UDP receiver on background
            state_receiver_thread = threading.Thread(target=Tello.udp_state_receiver)
            state_receiver_thread.daemon = True
            state_receiver_thread.start()

        drones[host] = {
            'responses': [],
            'state': {},
        }