def main(): drone = tello.Tello() drone.set_speed(100) print(drone_diag.dd_get_battery(drone)[1]) # drone.streamon() drone.takeoff() height = drone.get_height() while height < 18: d_height = drone_diag.dd_get_height(drone) height = d_height[0] print(d_height[1]) drone.up(20) while height > 3: d_height = drone_diag.dd_get_height(drone) height = d_height[0] print(d_height[1]) drone.down(20) drone.land() # drone.streamoff() return
def init_drone(): drone = tello.Tello() drone.takeoff() send_rc(drone, 0, 0, 0, 0) drone.up(150) drone.send_command('streamon') return drone, ControlStates.CENTER, time.time()
def main(): sys.stdout.write("---Top of the main method in tello.py---\n") countdown = time.time() print("Countdown initialized time of %s" % str(countdown)) clockwise = None connect_bool = False while not connect_bool: print("---Top of While---") drone = tello.Tello() print(drone) if drone != None: connect_bool = True print("Hello! Welcome to the program timer!") background_thread = Thread(target=timer, args=(drone, )) background_thread.start() drone.takeoff() print("---After takeoff---\n") for i in range(50): #clockwise = drone.cw(90) clockwise = "Null" print("Sleeping for %s seconds and clockwise status is %s---" % (str(i), str(clockwise))) time.sleep(1)
def __init__(self): self.frame = np.zeros([default_frame_size, default_frame_size], np.uint8) self.drone = tello.Tello(debug=False) self.drone.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.video_thread = threading.Thread(target=self._start_stream, daemon=True) self.video_thread.start()
def main(): drone = tello.Tello() print(drone_diag.dd_get_battery(drone)[1]) drone.streamon() drone.takeoff() drone.flip("f") drone.land() drone.streamoff() return
def main(): drone = tello.Tello() print(drone_diag.dd_get_battery(drone)[1]) drone.takeoff() while drone.get_tof() < 2000: drone.up(20) while drone.get_tof() > 500: drone.down(20) drone.land() return
def main(): drone = tello.Tello() print(drone_diag.dd_get_battery(drone)[1]) drone.streamon() drone.takeoff() drone.curve(75, -75, 0, 0, -150, 100, 60) drone.curve(-75, 75, 0, 0, 150, -100, 60) drone.land() drone.streamoff() return
def main(): drone = tello.Tello() print(drone_diag.dd_get_battery(drone)[1]) drone.takeoff() # forward drone.go(40, 0, 0, 20) time.sleep(2) # up drone.go(0, 0, 40, 20) time.sleep(2) # left drone.go(0, 40, 0, 20) time.sleep(2) # back to start drone.go(-40, -40, -40, 20) drone.land() return
def main(): drone = tello.Tello() print(drone_diag.dd_get_battery(drone)[1]) drone.streamon() drone.takeoff() time.sleep(5) ''' user_i = input("Check Altitude: ") while user_i != "exit": print(drone.get_attitude()) user_i = input("Check Altitude: ") ''' for i in range(4): drone.forward(100) drone.cw(92) drone.land() drone.streamoff() return
def main(): sys.stdout.write("---------Top of the main method in main.py-----------\n") engine = pyttsx3.init() sys.stdout.write("---------Attempting to connect with tello------------\n") connect_bool = False while not connect_bool: print("---Top of While---") drone = tello.Tello() if drone != None: connect_bool = True drone.takeoff() print("---After takeoff---\n") background_thread = Thread(target=timer, args=(drone, )) background_thread.start() # initialisation for computer's ability to speak operating = True while operating: #print("\n---Top of operating while loop---") speech_command, number, type = sr.Recognize() print( "---Resulting speech command in main.py: %s and the associated number: %s and the type: %s----" % (speech_command, str(number), type)) if 'end program' in speech_command.lower(): operating = False continue #drone = None #cs.Speak("Command attempting to execute", engine) #cs.Speak(speech_command, engine) pc.Process(speech_command, drone, type, number)
from easytello import tello import time my_drone = tello.Tello() print(my_drone.get_battery()) my_drone.takeoff() my_drone.wait(1) for i in range(4): my_drone.forward(100) my_drone.cw(90) my_drone.wait(1) my_drone.land() print(my_drone.get_battery()) #go(self, x: int, y: int, z: int, speed: int):
from easytello import tello import cv2 import time import random import numpy as np import threading LOCAL_IP = '192.168.10.1' LOCAL_PORT_VIDEO = '11111' addr = 'udp://' + LOCAL_IP + ':' + str(LOCAL_PORT_VIDEO) tello = tello.Tello() order_list = [ "up 40", "down 30", "left 40", "right 40", "forward 40", "back 40", "cw 360", "ccw 360" ] waiting_second = 5 is_wait = [True] tello.takeoff() tello.send_command("up 40") tello.send_command("streamon") def ohara_detect(image): low_threshold = (0, 0, 40) high_threshold = (20, 20, 255) red_per_max = 5 red_mask = cv2.inRange(image, low_threshold, high_threshold) red_white_pixels = cv2.countNonZero(red_mask)
from rabboni import * import sys import time from easytello import tello #Tello連線 myTello = tello.Tello() #物件宣告 #Rabboni連線設定 rabbo = Rabboni(mode="USB") #先宣告一個物件 rabbo.connect("F3:E6:9F:84:07:FD") #連接Rabboni print("Status:", rabbo.Status) #Rabboni資料讀取 rabbo.read_data() #等待Tello起飛手勢 print('系統啟動完成,Tello執行中') while True: print('請進行起飛動作') if rabbo.Accz > 2.5: print("起飛並開啟影像串流") myTello.streamon() myTello.takeoff() #起飛 time.sleep(3) #確保起飛時間及恢復動作 break #操作模式 while True: time.sleep(0.15) #減緩取樣頻率,避免過度取樣造成的動作 if rabbo.Accz > 1.8: