Created
February 25, 2025 12:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from pyardrone import ARDrone | |
# https://afq984.github.io/pyardrone/intro.html | |
drone = ARDrone() | |
print("connected to", drone.host, "on port", drone.at_port) | |
drone.navdata_ready.wait() # wait until NavData is ready | |
print(drone.navdata) | |
while True: | |
print("Enter command: ") | |
print("t: takeoff") | |
print("l: land") | |
print("r: rotate") | |
print("s: stop") | |
cmd = input("> ") | |
if cmd == "t": | |
print("Taking off") | |
drone.takeoff() | |
if cmd == "l": | |
print("Landing") | |
drone.land() | |
if cmd == "r": | |
print("forward") | |
drone.move(cw=0.8) | |
if cmd == "s": | |
print("stop") | |
drone.move(cw=0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment