Created
October 21, 2019 10:56
-
-
Save cziem/4715840461b0b0b74fed699bf0f97b9a to your computer and use it in GitHub Desktop.
main script to get the drone up and running
This file contains 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
from src.controller.services.delays import command_delays as delays | |
from src.controller.services.drone_services import Drone | |
from time import sleep | |
import sys | |
''' | |
'takeoff', 'land', 'time?', 'speed?', | |
''' | |
command_list = ['command', 'battery?'] | |
command_len = len(command_list) | |
# Instantiate new Drone | |
tello = Drone('Tello', command_len) | |
for i in range(command_len): | |
command = command_list[i] | |
wait = delays[command] | |
tello.send_msg(command) | |
tello.stream_resp() | |
sleep(wait) | |
tello.close_sock() | |
if __name__ == '__main__': | |
print('We got called') | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment