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

Continuous commands or hovering while streaming video [PYTHON]

BigBoi_Help

New member
Joined
Jun 11, 2020
Messages
1
Reaction score
0
I've been trying to stream the video while at the same time sending flight commands to the Tello drone.
The problem is I need "time.delay(x)" to allow the drone to catch up but the video will only display once every "time.sleep(x)" code has been executed.

Additionally, now I would like the drone to just hover for as long as the I want/as long as the video stream is still ongoing.
Would be great if anyone knows a workaround these

Library: DJItellopy
Python v3.8.3
 
Have a look at threading.Timer. It runs your function in a new thread without using sleep().

from threading import Timer

Code:
def hello():
    print "hello, world"


t = Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be printed

The second method to delay would be using the implicit wait method:

Code:
driver.implicitly_wait(5)

The third method is more useful when you have to wait until a particular action is completed or until an element is found:

Code:
self.wait.until(EC.presence_of_element_located((By.ID, 'UserName'))
 

New Posts

Members online

No members online now.

Forum statistics

Threads
5,690
Messages
39,934
Members
17,023
Latest member
Repiv

New Posts