Skip to content

Python application to control the DJI Tello Drone with different controllers.

Notifications You must be signed in to change notification settings

Lupin3000/Tello-Python

Repository files navigation

DJI Tello - Python

DJI Tello Drone

This software makes use of: DJI Tello Python API

Important

The owner of this project assumes no responsibility for any damage, issues, or legal consequences resulting from the use of this software. Use it at your own risk and ensure compliance with all applicable laws and regulations.

Installation

Minimum requirements

The code is written and tested with following requirements:

OS Python
macOS Sequoia Static
macOS Sequoia Static
macOS Sequoia Static
macOS Sequoia Static
macOS Sequoia Static
Debian 12 Static
Debian 12 Static
Debian 12 Static
Debian 12 Static
Debian 12 Static
Unihiker M10 Static
Unihiker M10 Static
Unihiker M10 Static
Unihiker M10 Static
Unihiker M10 Static

Quick installation

# clone repository
$ git clone https://github.com/Lupin3000/Tello-Python.git

# change into cloned root directory
$ cd Tello-Python/

# create Python virtualenv (optional but recommended)
$ python3 -m venv venv

# activate Python virtualenv
$ source venv/bin/activate

# update pip (optional)
(venv) $ pip3 install -U pip

# install required dependencies
(venv) $ pip3 install -r <SYSTEM>-requirements.txt

# show packages (optional)
(venv) $ pip3 freeze

For more details, have a look on the Wiki. There, various systems are discussed in more detail.

Usage

Run application and fly

  1. Mandatory: Connect controller by USB or Bluetooth (verify correct mapping configuration config/*.ini).
  2. Mandatory: Turn on Tello Drone (in best case the drone is 100% charged).
  3. Mandatory: Connect WLAN of your computer to the Tello Drone AP (Default is: TELLO-??????).
  4. Optional: Decide whether you want to enable or disable the HUD (for video streaming).
  5. Optional: Check your surroundings to see if you can fly the drone safely.
  6. Mandatory: Run the Python application (use file main.py).

Have a look on this Wiki page for more details about WLAN connection (to the Tello drone).

# run application
(venv) $ python3 main.py

After takeoff, the Tello sensors require a few seconds to calibrate. During this time, the drone will not respond to controller inputs.

Configuration

Predefined controllers

Controllers

OS Controller Configuration
macOS Google Stadia-Controller stadia_macos.ini
macOS Sony DualSense Wireless Controller dualsense_macos.ini
Linux Google Stadia-Controller stadia_linux.ini
Linux Sony DualSense Wireless Controller dualsense_linux.ini

Assignment

  • Stadia [Y] - DualSense [▲]: for drone takeoff.
  • Stadia [A] - DualSense [X]: for drone landing.
  • Stadia [X] - DualSense [◼]: for capture a photo (picture will be saved as PNG into directory "photos").
  • Left analog stick: move up, move down, rotation clockwise and rotation counterclockwise.
  • Right analog stick: move forward, move backward, move left and move right.

The photos are created as PNG files (with timestamp in name) during the live stream. The resolution and quality therefore depend on the live stream. The photos folder will be created automatically if it doesn't already exist. If you turn off the stream, you cannot save pictures!

Own configuration

In the Wiki you will find more details to create your own configurations.

Notes

Compatibility

Currently, this project is only fully supported on macOS and Linux. Users on other operating systems might encounter compatibility issues or limitations when running the project. Please ensure you are using macOS or Linux for the best experience.

Open items

  • Add more controller actions (eq. drone flip, video recording, etc.)

Languages