commit c1b7c7c3afaa2f902d5516e4111aac38d6b4ae37 Author: raiot Date: Thu Jun 6 18:43:28 2024 +0800 init diff --git a/main.py b/main.py new file mode 100644 index 0000000..98a00e0 --- /dev/null +++ b/main.py @@ -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() \ No newline at end of file diff --git a/picture.png b/picture.png new file mode 100644 index 0000000..4404e7d Binary files /dev/null and b/picture.png differ diff --git a/video.avi b/video.avi new file mode 100644 index 0000000..0ada873 Binary files /dev/null and b/video.avi differ