Overview of DJITelloPy classes
masterThe DJITelloPy library provides two primary classes for drone interaction:
Tello: Used for controlling a single Tello drone.Swarm: Used for controlling multiple Tello EDU drones in parallel.
repository·master·Indexed 23 days ago
https://github.com/damiafuentes/djitellopyA Python interface for DJI Tello drones implementing the official Tello and Tello EDU SDKs. It provides the Tello class for single drone control—including flight commands, video streams, and state packet parsing—and the Swarm class for controlling multiple Tello EDU drones in parallel. Supports Tello EDU specific features such as mission pad detection and connecting to existing WiFi networks.
The DJITelloPy library provides two primary classes for drone interaction:
Tello: Used for controlling a single Tello drone.Swarm: Used for controlling multiple Tello EDU drones in parallel.Certain features in DJITelloPy are exclusive to the Tello EDU model:
Note: When connected to an existing WiFi network, video streaming is currently unavailable.
To install the project in editable mode, which allows you to modify the library source code and use it immediately like a normal installation, clone the repository and use pip install -e ..
git clone https://github.com/damiafuentes/DJITelloPy.git
cd DJITelloPy
pip install -e .Install the library using the standard pip command. For Linux distributions with both Python 2 and Python 3 (like Ubuntu or Debian), use pip3 to ensure it is installed for Python 3.
If you experience slow download speeds or timeouts, you can use a mirror (e.g., Tsinghua mirror).
pip install djitellopy
# Or for Python 3 on Linux:
pip3 install djitellopy
# Using a mirror if needed:
pip install djitellopy -i https://pypi.tuna.tsinghua.edu.cn/simple/streamon command and receive an Unknown command response, it indicates that your Tello firmware is outdated. You should update the firmware using the official Tello app.Unknown command error with streamon: If the streamon command returns Unknown command, you must upgrade the drone's firmware via the official Tello app.This example demonstrates the basic lifecycle of a Tello drone session: connecting, taking off, performing movement commands, and landing.
from djitellopy import Tello
tello = Tello()
tello.connect()
tello.takeoff()
tello.move_left(100)
tello.rotate_counter_clockwise(90)
tello.move_forward(100)
tello.land()The simplest way to control a Tello drone is to use the Tello class. You must first call .connect() to establish communication, then you can issue flight commands like .takeoff(), movement commands, and finally .land() to finish the flight.
from djitellopy import Tello
tello = Tello()
tello.connect()
tello.takeoff()
tello.move_left(100)
tello.rotate_counter_clockwise(90)
tello.move_forward(100)
tello.land()The djitellopy.Tello class is the primary interface for controlling a DJI Tello drone. It provides methods to connect to the drone, manage flight operations (takeoff, landing, movement), and access the camera stream.
To use it, you must instantiate the class, which typically establishes a connection to the drone's Wi-Fi network, and then call its various methods to execute commands.