This commit is contained in:
raiot 2024-06-06 18:43:28 +08:00
commit c1b7c7c3af
3 changed files with 21 additions and 0 deletions

21
main.py Normal file
View File

@ -0,0 +1,21 @@
from djitellopy import Tello
import cv2
my_drone = Tello()
my_drone.connect()
print(my_drone.get_battery())
my_drone.streamon()
my_drone.set_video_direction(Tello.CAMERA_DOWNWARD)
while True:
# Read a frame from the video stream
img = my_drone.get_frame_read().frame
img = cv2.resize(img, (360, 240))
# Display the frame
cv2.imshow("Image", img)
# Check for key press to exit
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
my_drone.streamoff()
# my_drone.land()

BIN
picture.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

BIN
video.avi Normal file

Binary file not shown.