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,42 @@
from tello_sim.tello_sim_client import TelloSimClient
import time
TEST_DISTANCE = 500
# Create a Tello instance
tello = TelloSimClient()
# Connect to Tello
tello.connect()
def pause(next_action: str):
print(f"Hovering before {next_action}")
for i in range(3, 0, -1):
print(i)
time.sleep(1)
print("Starting flying in ...")
for i in range(3, 0, -1):
print(i)
time.sleep(1)
# Takeoff
print("Take off")
tello.takeoff()
pause("ascending")
tello.move_up(100)
for speed in range(10, 101, 10):
pause(f"speed change to {speed} cm/s")
print("Setting speed to", speed, "cm/s")
tello.set_speed(speed)
print(f"Testing forward and back at {speed} cm/s")
tello.move_forward(1000)
tello.move_back(TEST_DISTANCE)
time.sleep(1)
pause("landing")
print("Finished Landing")
tello.land()