Fix up structure and README

This commit is contained in:
Andrew Johnson
2025-04-03 20:31:10 +02:00
parent 1480a75a61
commit 3b5ab2f7cd
19 changed files with 7 additions and 1 deletions

47
examples/8_rotate.py Executable file
View File

@@ -0,0 +1,47 @@
from tello_sim.tello_sim_client import TelloSimClient
import time
ROTATION_DEGREES = 180
# Create a Tello instance
tello = TelloSimClient()
# Connect to Tello
tello.connect()
print("Starting flying in ...")
for i in range(3, 0, -1):
print(i)
time.sleep(1)
def pause():
print("Hovering for...")
for i in range(3, 0, -1):
print(i)
time.sleep(1)
# Takeoff
print("Take off")
tello.takeoff()
pause()
print(f"Rotating clockwise {ROTATION_DEGREES} degrees")
tello.rotate_clockwise(ROTATION_DEGREES)
pause()
print(f"Rotating counter clockwise {ROTATION_DEGREES} degrees")
tello.rotate_counter_clockwise(ROTATION_DEGREES)
pause()
print("Landing")
# Land
tello.land()
# End the connection
tello.end()