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.3.tar.gz
(7.3 kB
view details)
Built Distribution
File details
Details for the file rktellolib-1.0.3.tar.gz
.
File metadata
- Download URL: rktellolib-1.0.3.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0d87b755d62329ae10665a68151137ed83b562163f693458e0a4b653e63a404 |
|
MD5 | 8ecdaaf2b6de2d3da2ef1ba34173b047 |
|
BLAKE2b-256 | f764b1fec17e4a4ef292b2cc18bd14f96260772699919ea3b1e67629b7872ba9 |
File details
Details for the file rktellolib-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: rktellolib-1.0.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f0f2ff3d6cb860c95f6a580a1a13e9cb70c5d0fa48787c364502a1eebad861d |
|
MD5 | 1ccea1b6aa29460a8d46572d39af80a1 |
|
BLAKE2b-256 | 847d03ed8cb1c77ea0d3131b1e2848726ac5ea84abe52c2c02a087515755f228 |