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