Skip to main content

A simple library to interface with the DJI Tello drone

Project description

RKTelloLib

In light of the many poorly-designed libraries to interact with the DJI (Ryze) Tello drone that either do way more than they should or don't do enough, I have taken the initiative to create this small library. It's a simple interface built upon the official Tello SDK that allows you to control and interact with the drone with minimal effort.

Installation

Install using PIP

$ pip install rktellolib

Install from Source

$ git clone https://github.com/ramujin/rktellolib.git
$ cd rktellolib
$ pip install -e .

Example Usage to Fly in a Square Pattern

from rktellolib import Tello

drone = Tello(debug=True, has_video=False)

drone.connect()
drone.takeoff()

drone.forward(100)
drone.cw(90)
drone.forward(100)
drone.cw(90)
drone.forward(100)
drone.cw(90)
drone.forward(100)
drone.cw(90)

drone.land()
drone.disconnect()

Example Usage to Stream Video

from rktellolib import Tello
import cv2

drone = Tello(debug=True, has_video=True)

drone.connect()

while True:
  frame = drone.get_frame()
  if frame is None:
    break

  cv2.imshow('rktellolib', frame)

  if cv2.waitKey(1) == 27: # ESC key
    break

drone.disconnect()

Available Commands

# Operational Commands
connect()
disconnect()
takeoff()
land()

# Discrete Action Commands
up(distance: int)
down(distance: int)
left(distance: int)
right(distance: int)
forward(distance: int)
back(distance: int)
cw(degree: int)
ccw(degree: int)

# RC Control Command
rc(v_lr: int, v_fb: int, v_ud: int, v_yaw: int)

# Camera Command
get_frame()

# State Retrieval Commands
# All States
get_state()

# System & Environment States
get_battery()
get_flight_time()
get_temp()
get_barometer()

# Positional States
get_height()
get_distance_tof()
get_ax()
get_ay()
get_az()
get_vx()
get_vy()
get_vz()

# Rotational States
get_roll()
get_pitch()
get_yaw()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rktellolib-1.0.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

rktellolib-1.0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file rktellolib-1.0.1.tar.gz.

File metadata

  • Download URL: rktellolib-1.0.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for rktellolib-1.0.1.tar.gz
Algorithm Hash digest
SHA256 642c03e96df9ec3454d2c370380dd4e6976c091a7dd7f7c56ffe1df8de119172
MD5 1f408db84931fde0c1c2ae16bad5e0cd
BLAKE2b-256 3caf25887e38ea42914fdc069d96c3814a6e5a5b5ea6d0b1719e0aadaea3943d

See more details on using hashes here.

File details

Details for the file rktellolib-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: rktellolib-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for rktellolib-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 432db921e5bb00db8a77f21ac259c7829ce76bfad3ed3bc5153e88d1f35185ca
MD5 c1d9eb6d6efe27b2b32bd07d5e2bc2ac
BLAKE2b-256 cb3520478fd6dfd2421cbf9107b82751192a2b9cb00955b0602713ed7f7ebfed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page