def start_tello(): ''' Connects to drone and sets velocities and speed to 0 Cycles drone stream ''' #makes drone and connects to it drone = Tello() drone.connect() #sets all drones velocity to 0 drone.forward_backward_velocity = 0 drone.left_right_velocity = 0 drone.up_down_velocity = 0 drone.yaw_velocity = 0 drone.speed = 0 #cycles drone stream off and on drone.streamoff() drone.streamon() #prints drone's battery at start time.sleep(5) print(drone.get_battery()) return drone
def __init__(self): self.width = 640 self.height = 480 me = Tello() me.connect() me.forward_backward_velocity = 0 me.left_right_velocity = 0 me.up_down_velocity = 0 me.yaw_velocity = 0 me.speed = 0 battery = me.get_battery() if battery <= 15: print("[ERROR] - battery under 15% ") sys.exit(0) me.streamoff() me.streamon() self.me = me self.takeoff = False self.frame = None