DJITelloPy Documentation

repository·master·Indexed 23 days ago

https://github.com/damiafuentes/djitellopy

A 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.

Tokens
1K
Snippets
4
Records
9
Agent score
81%

What's inside DJITelloPy

  1. Tello EDU specific features and limitations

    master

    Certain features in DJITelloPy are exclusive to the Tello EDU model:

    • Mission pad detection and navigation: Only supported by Tello EDU. Successful use of mission pads requires a bright environment.
    • Connecting to an existing WiFi network: Only supported by Tello EDU.

    Note: When connected to an existing WiFi network, video streaming is currently unavailable.

  2. Install DJITelloPy in developer mode

    master

    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 .
  3. Install DJITelloPy via pip

    master

    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/
  4. Troubleshooting and usage notes

    master

    Common Issues and Limitations

    • Unknown command error with streamon: If the streamon command returns Unknown command, you must upgrade the drone's firmware via the official Tello app.
    • Mission Pads / Challenge Cards: Recognition and navigation for mission pads/challenge cards are only supported on Tello EDU models and require a bright environment for successful recognition.
    • WiFi Connectivity: Only Tello EDU supports connecting to an existing WiFi network. Note that when connecting to an existing WiFi, the video stream will be unavailable.
    • API Documentation: For a full list of available classes and methods, refer to the official documentation at djitellopy.readthedocs.io.
  5. Basic drone control example

    master

    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()
  6. Basic drone control with Tello class

    master

    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()
  7. Use the djitellopy.Tello class

    master

    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.