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

Tello lagging when doing image capture

a.jin820206

New member
Joined
Jan 20, 2022
Messages
4
Reaction score
0
Hello guys,

I'm new to python and trying to do image capture when the Tello executes my code.
However, I encountered a problem and if someone can take a look of my code,
I'll be really appreciated it!

Basically, I'm telling my drone to move 10cm first in the x-direction, then take a picture, and then land it.
It turns out that the drone moves approximately 50cm(or more, seems like a huge lag happened) at first, and I have no idea how to fix it.

Meet Google Drive – One place for all your files



this is my code:

from djitellopy import tello
from time import sleep
import cv2
import time

global img



me = tello.Tello()
me.connect()
print(me.get_battery())
me.streamon()
me.takeoff()


me.send_rc_control(-10, 0, 0, 0)
me.send_rc_control(0, 0, 0, 0)

img = me.get_frame_read().frame
img = cv2.resize(img, (360, 240))

sleep(2)
cv2.imwrite(f'Resources/Images/{time.time()}.jpg', img)

me.land()




if anyone knows how to fix my code, plz kindly let me know,
Thank you!
 

Hacky

Well-known member
Joined
Jul 19, 2021
Messages
255
Reaction score
105
Location
Germany
send_rc_control is used to control the velocity programmatically as you would control it manually with the sticks of your remote controller. Its described here: Tello - DJITelloPy API Reference

If you send...
me.send_rc_control(-10, 0, 0, 0)
me.send_rc_control(0, 0, 0, 0)
...without any delay between these commands, the second command will immediately "overwrite" the value you sent right before.

For absolute movements you should use the go_xyz_... command.
 
  • Like
Reactions: a.jin820206

a.jin820206

New member
Joined
Jan 20, 2022
Messages
4
Reaction score
0
send_rc_control is used to control the velocity programmatically as you would control it manually with the sticks of your remote controller. Its described here: Tello - DJITelloPy API Reference

If you send...
me.send_rc_control(-10, 0, 0, 0)
me.send_rc_control(0, 0, 0, 0)
...without any delay between these commands, the second command will immediately "overwrite" the value you sent right before.

For absolute movements you should use the go_xyz_... command.
Thanks! it works!
 

New Threads

Members online

No members online now.

Forum statistics

Threads
5,445
Messages
38,863
Members
15,453
Latest member
poldita