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()
# Retrieve All Drone State Information
get_states()
# Retrieve a Specific State
get_state(field: str)
# Retrieve System & Environment States
get_battery()
get_flight_time()
get_temp()
get_barometer()
# Retrieve Positional States
get_height()
get_distance_tof()
get_ax()
get_ay()
get_az()
get_vx()
get_vy()
get_vz()
# Retrieve 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.2.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file rktellolib-1.0.2.tar.gz
.
File metadata
- Download URL: rktellolib-1.0.2.tar.gz
- Upload date:
- Size: 7.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 136e3cac93014e21d4def89b1ff680a41ae71569f151c1ab19b1c3e2aecccd5d |
|
MD5 | 3b2f2dc97c05794da065a2d2675067a1 |
|
BLAKE2b-256 | 57316de510d010d2a64f74965ae53f4fbf49988d391b53145e19655bf25a2579 |
File details
Details for the file rktellolib-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: rktellolib-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1262f2a6577e105c8e1374ba1d39183382bb0b8c530c95247a25543650cc88bb |
|
MD5 | 180c45b4490f5d188ac002ec5938b76e |
|
BLAKE2b-256 | 4d81f5e9faa9182ccaabc0f91b9c24758c099b52f99473bd2ccaae17c118b08c |