Code Monkey home page Code Monkey logo

djitellopy's Introduction

DJITelloPy

DJI Tello drone python interface using the official Tello SDK and Tello EDU SDK. Yes, this library has been tested with the drone. Please see example.py for a working example controlling the drone as a remote controller with the keyboard and the video stream in a window.

Tested with Python 3.6, but it also may be compatabile with other versions.

Install through git clone

$ pip install --upgrade pip
$ git clone https://github.com/damiafuentes/TelloSDKPy.git
$ cd TelloSDKPy
$ pip install -r requirements.txt

Sometimes you need to update the virtual environment indexes and skeletons in order for the example.py file to work with `pygame. If you are working with PyCharm, this can be done to File > Invalidate Caches

Install through pip

NOTICE: The python package at PyPi library is hardly every maintained. I would recommend to install it through git clone.

$ pip install djitellopy

Usage

Simple example

from TelloSDKPy.djitellopy import Tello
import cv2
import time

tello = Tello()

tello.connect()
tello.takeoff()

tello.move_left(100)
tello.rotate_counter_clockwise(45)

tello.land()
tello.end()

Example using pygame and the video stream

Please see example.py.

The controls are:

  • T: Takeoff
  • L: Land
  • Arrow keys: Forward, backward, left and right.
  • A and D: Counter clockwise and clockwise rotations
  • W and S: Up and down.

Swarm example

Only for Tello EDU's.

from TelloSDKPy.djitellopy import TelloSwarm

swarm = TelloSwarm.fromIps([
    "192.168.178.42",
    "192.168.178.43",
    "192.168.178.44"
])

swarm.connect()
swarm.takeoff()

# run in parallel on all tellos
swarm.move_up(100)

# run by one tello after the other
swarm.sequential(lambda i, tello: tello.move_forward(i * 20))

# making each tello do something unique in parallel
swarm.parallel(lambda i, tello: tello.move_left(i * 100))

swarm.land()
swarm.end()

Notes

  • If you are using the streamon command and the response is Unknown command means you have to update the Tello firmware. That can be done through the Tello app.
  • Mission pad detection and navigation is only supported by the Tello EDU.
  • Connecting to an existing wifi network is only supported by the Tello EDU.
  • When connected to an existing wifi network video streaming is not available.

Author

  • Damià Fuentes Escoté

License

This project is licensed under the MIT License - see the LICENSE.md file for details

djitellopy's People

Contributors

damiafuentes avatar m4gnv5 avatar parakh08 avatar hyansuper avatar koenigscode avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.