Skip to content

Learn to control a DJI Tello Drone using Python and djitellopy. Includes basic scripts for connection, flight, camera streaming, and movements. Perfect for beginners.

Notifications You must be signed in to change notification settings

NoumanT1247/Tello-Drone-Basics

Repository files navigation

Tello-Drone-Basics

This repository contains basic Python scripts to control a Tello Drone using the djitellopy library.
It is designed for beginners who want to learn how to connect, command, and fly the Tello drone.

Installation

  1. Install the required library:

    pip install djitellopy
  2. Connect your computer to the Tello drone’s Wi-Fi network.

Usage

Run the scripts provided in this repo to perform basic operations:

  • Connect to drone

    python connect.py

    Establishes connection between your system and the drone.

  • Check battery level

    python get-battery.py

    Prints the battery percentage.

  • Takeoff and land

    python takeoff-land.py

    Makes the drone take off, hover for a short time, then land.

  • Get altitude

    python get-altitude.py

    Prints the drone’s current altitude.

  • Tello Camera Stream

    python tello-stream.py

    Creates an opencv window showing the Tello's videostream.

  • Basic movement

    python basic-movement.py

    Moves the drone using the send_rc_control command.

Core Commands

Here are some of the main djitellopy functions used in the scripts:

from djitellopy import Tello

me = Tello()
me.connect()                 # Connect to drone
me.takeoff()                 # Take off
me.land()                    # Land

print(me.get_battery())      # Get battery percentage
print(me.get_altitude())     # Get current altitude

me.streamon()                # Starts publishing the tello videostream frames

# Control movement (lr = left/right, fb = forward/backward,
# ud = up/down, yaw = rotation)
me.send_rc_control(lr, fb, ud, yaw)

Notes

  • Ensure your system is connected to the Tello Wi-Fi before running any script.
  • If connection fails, try restarting both the drone and Wi-Fi connection.
  • Only one device can connect to the drone at a time.

License

This project is open-source and free to use.

About

Learn to control a DJI Tello Drone using Python and djitellopy. Includes basic scripts for connection, flight, camera streaming, and movements. Perfect for beginners.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages