First Version (#1)

Co-authored-by: Anujith Muraleedharan <140189296+AnujithM@users.noreply.github.com>
This commit is contained in:
Andrew Johnson
2025-03-22 16:06:45 +01:00
committed by GitHub
parent 81a42fde3c
commit 26b19a909f
51 changed files with 2348 additions and 1030 deletions

View File

@@ -0,0 +1,31 @@
import os
import cv2
import time
import numpy as np
from tello_sim.tello_sim_client import TelloSimClient
# Initialize and connect
tello = TelloSimClient()
tello.connect()
tello.streamon()
# Takeoff
tello.takeoff()
time.sleep(5) # Let drone stabilize after takeoff
# Get frame object
frame_read = tello.get_frame_read()
tello.streamoff()
# Prepare directory to save
script_dir = os.path.dirname(__file__)
artifact_folder_path = os.path.join(script_dir, "../../artifacts/images")
os.makedirs(artifact_folder_path, exist_ok=True)
# Save the frame
save_path = os.path.join(artifact_folder_path, "picture.png")
cv2.imwrite(save_path, np.array(frame_read.frame))
# Land
tello.land()