simple_takeoff.py
Go to the documentation of this file.
1 from time import sleep
2 import tellopy
3 
4 
5 def handler(event, sender, data, **args):
6  drone = sender
7  if event is drone.EVENT_FLIGHT_DATA:
8  print(data)
9 
10 
11 def test():
12  drone = tellopy.Tello()
13  try:
14  drone.subscribe(drone.EVENT_FLIGHT_DATA, handler)
15 
16  drone.connect()
17  drone.wait_for_connection(60.0)
18  drone.takeoff()
19  sleep(5)
20  drone.down(50)
21  sleep(5)
22  drone.land()
23  sleep(5)
24  except Exception as ex:
25  print(ex)
26  finally:
27  drone.quit()
28 
29 if __name__ == '__main__':
30  test()
def handler(event, sender, data, args)


tello_driver
Author(s): Jordy van Appeven
autogenerated on Wed May 13 2020 03:34:54