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!
 
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
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 Posts

Members online

No members online now.

Forum statistics

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

New Posts