Python API for interacting with DJI Tello Drones using the official SDK. Developed by Niaz M. Sameer for the CCC Kei Long College Computer Society.
- Download or clone this git repository onto your computer.
- Open the
main.py
file - Under the
# Write your instructions here:
comment, write all the instructions you'd like to send to the drone.
Before anything, you must first initialize the drone object. A drone object will have already been created in main.py
like this Tello = Drone("192.168.10.1", 8889, "192.168.10.2", 8889)
.
In your instructions, write Tello.initialize()
to initialize the drone object.
Once you have initialized the drone object, you can now start sending commands.
Tello.takeoff()
Tello.land()
Tello.go_forward(distance)
Tello.go_left(distance)
Tello.go_right(distance)
Tello.go_back(distance)
Tello.go_up(height)
Tello.go_down(height)
Tello.rotate_cw(angle)
Tello.rotate_ccw(angle)
If, for any reason, you need your drone to stop immediately and fall to the ground, don't worry, I developed a solution! In main.py
, a signal handler has been implemented to detect a KeyboardInterupt (Ctrl+C). By pressing Ctrl+C, the API will signal the drone to stop its motors immediately and your computer will cut the connection. Use this with care as the falling drone may injure someone.