import tkinter, time, winsound def warning(): for n in range(4): # 4 short beeps winsound.Beep(1500, 500) time.sleep(0.5) winsound.Beep(1500, 1000) # 1 long beep tello = Tello() tello.connect() # Activate the mission pads tello.enable_mission_pads() tello.set_mission_pad_detection_direction(0) # use downward camera # Take off warning() tello.takeoff() tello.send_rc_control(0, 30, 0, 0) # Move forward pad = tello.get_mission_pad_id() # Look for a mission pad while pad != 1: # While we don't see pad 1 if pad == 4: # If we see pad 4 winsound.Beep(2500, 500) pad = tello.get_mission_pad_id() # Take another look # Land tello.disable_mission_pads() tello.land() tello.end()
from djitellopy import Tello # create and connect tello = Tello() tello.connect() # configure drone tello.enable_mission_pads() tello.set_mission_pad_detection_direction(1) # forward detection only tello.takeoff() pad = tello.get_mission_pad_id() # detect and react to pads until we see pad #1 while pad != 1: if pad == 3: tello.move_back(30) tello.rotate_clockwise(90) if pad == 4: tello.move_up(30) tello.flip_forward() pad = tello.get_mission_pad_id() # graceful termination tello.disable_mission_pads() tello.land() tello.end()
print("Beginning Move:", time.process_time()) # me.__send_stick_command() me.move_forward(100) print("Done Move:", time.process_time()) ''' # mission pad detection # me.mon() me.enable_mission_pads() me.set_mission_pad_detection_direction(0) ''' if me.get_mission_pad_id() > 0: me.flip_back() break ''' while me.get_mission_pad_id() != 4: me.move_forward(100) d += 100 if d == 500: me.move_back(d) me.end() print("Haven't found mission pad\n") print("Found mission pad\n") # me.flip_back() me.move_back(d) me.end() break #print("Beginning Move Back:", time.process_time()) # me.move_back(100) #print("Done Move Back:", time.process_time())
from djitellopy import Tello import time from PIL import Image ###################################################################### patrol_width = 120 # WIDTH OF THE Patrol (normally set to 120 cm for 4 feet (121.92) patrol_height = 180 # HEIGHT OF THE Patrol (normally set to 180 cm for 4 feet (182.88) drone_width = 15 # Normally set to 15 cm (7 inches) drone_pauses = 5 # number of seconds at each corner ###################################################################### # CONNECT me = Tello() time.sleep(drone_pauses) me.connect() time.sleep(drone_pauses) me.takeoff() time.sleep(drone_pauses) me.enable_mission_pads() time.sleep(drone_pauses) mission_status = me.get_mission_pad_id() print(me.get_mission_pad_id()) time.sleep(drone_pauses) # while mission_status < 8: # time.sleep(drone_pauses) # if (mission_status==1) # print()