Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

Question on keeping Tello drone on air

vn01118

New member
Joined
Oct 7, 2021
Messages
1
Reaction score
0
Hello,

I am new to python. I need your help on how to keep Tello on the air. My tello drone always land after some times. This is my code:
from djitellopy import Tello
import cv2


tello = Tello()
tello.connect()
tello.streamon()
telloVideo = cv2.VideoCapture("udp://@0.0.0.0:11111")
tello.takeoff()

# wait for frame
ret = False
# scale down
scale = 1

while(True):

# Capture frame-by-framestreamon
ret, frame = telloVideo.read()
if(ret):
# Our operations on the frame come here
height , width , layers = frame.shape
new_h=int(height/scale)
new_w=int(width/scale)
resize = cv2.resize(frame, (new_w, new_h)) # <- resize for improved performance
# Display the resulting frame
cv2.imshow('Tello',resize)

if cv2.waitKey(1) & 0xFF == ord('s'):
cv2.imwrite("test.jpg",resize) # writes image test.bmp to disk
print("Take Picture")

if cv2.waitKey(1) & 0xFF == ord('q'):
break

# When everything done, release the capture
telloVideo.release()
cv2.destroyAllWindows()



Thanks
 
You should send some kind of command within a certain period of time (may be 15 seconds or so). If Tello doesn't receive commands at least sporadically, it lands. This is to be considered as a safety feature in case your application crashed.
 

Members online

No members online now.

Forum statistics

Threads
5,697
Messages
39,959
Members
17,056
Latest member
97bugsinthecode