def init_tello():
    global drone, battery1, battery2
    my_tellos = list()
    if n_drones == 1:
        my_tellos.append('0TQDG2KEDB94U4')
    elif n_drones == 2:
        my_tellos.append('0TQDG2KEDB94U4')
        my_tellos.append('0TQDG2KEDBFP39')
    drone = FlyTello(my_tellos, get_status=True)
    drone.pad_detection_on()
    drone.set_pad_detection(direction='downward')
    if n_drones == 1:
        battery1 = int(drone.get_status(key='bat', tello=1))
    elif n_drones == 2:
        battery1 = int(drone.get_status(key='bat', tello=1))
        battery2 = int(drone.get_status(key='bat', tello=2))
#
# SIMPLE EXAMPLE - TWO TELLOs FLYING IN SYNC, DEMO'ING ALL KEY TELLO CAPABILITIES
#
# SETUP: Tello both facing away from controller, first Tello on the left, approx 0.5-1m apart
#

#
# MAIN FLIGHT CONTROL LOGIC
#

# Define the Tello's we're using, in the order we want them numbered
my_tellos.append('0TQDFC6EDBBX03')
my_tellos.append('0TQDFC6EDB4398')

# Control the flight
with FlyTello(my_tellos) as fly:
    fly.takeoff()
    fly.forward(dist=50)
    fly.back(dist=50)
    fly.reorient(height=100, pad='m-2')
    with fly.sync_these():
        fly.left(dist=50, tello=1)
        fly.right(dist=50, tello=2)
    with fly.sync_these():
        fly.flip(direction='right', tello=1)
        fly.flip(direction='left', tello=2)
    fly.reorient(height=100, pad='m-2')
    fly.straight(x=75, y=75, z=0, speed=100)
    fly.curve(x1=-55, y1=-20, z1=0, x2=-75, y2=-75, z2=0, speed=60)
    with fly.sync_these():
        fly.rotate_cw(angle=360, tello=1)
def saute(i,j):
        # Le i se lève de 100
    fly.up(100,i)
    # Le j tourne sur lui même
    fly.rotate_ccw(360,j)
    # Le i avance de 150
    fly.forward(200,i)
    # Le i descend de 150
    fly.down(100,i)
    # synchronise
    fly.wait_sync()
    # Premier tour


# Control the flight
with FlyTello(my_tellos, get_status=True) as fly:
    fly.print_status(sync=True)
    fly.takeoff(sync=True)
    #fly.pad_detection_on()
    fly.up(50)
    k = 2
    while k > 0:
        saute(1,2)
        saute(2,1)
        fly.back(200,sync=True)
        k -=1
    #fly.straight_from_pad(x=0,y=10,z=20,speed=10,pad="m3",tello=1)
    #fly.straight_from_pad(x=0,y=10,z=20,speed=10,pad="m7",tello=2)
    fly.land()
    fly.pause(2)
    #fly.print_status(sync=True)
Exemple #4
0
from fly_tello import FlyTello

fly = FlyTello(["0TQDG3KEDBG371"])
from fly_tello import FlyTello

#
# SIMPLE EXAMPLE - TWO TELLOs FLYING IN SYNC, DEMO'ING ALL KEY TELLO CAPABILITIES
#
# SETUP: Tello both facing away from controller, first Tello on the left, approx 0.5-1m apart
#

#
# MAIN FLIGHT CONTROL LOGIC
#

# Read all serial numbers from a serial_numbers.txt file
tello_sn_list = FlyTello.read_serial_numbers_from_file()
# Control the flight
with FlyTello(tello_sn_list) as fly:
    fly.takeoff()
    fly.forward(dist=50)
    fly.back(dist=50)
    fly.reorient(height=100, pad='m-2')
    with fly.sync_these():
        fly.left(dist=50, tello=1)
        fly.right(dist=50, tello=2)
    with fly.sync_these():
        fly.flip(direction='right', tello=1)
        fly.flip(direction='left', tello=2)
    fly.reorient(height=100, pad='m-2')
    fly.straight(x=75, y=75, z=0, speed=100)
    fly.curve(x1=-55, y1=-20, z1=0, x2=-75, y2=-75, z2=0, speed=60)
    with fly.sync_these():
        fly.rotate_cw(angle=360, tello=1)
from fly_tello import FlyTello

#
# Sets the drone up to use the same WiFi network.
#
# Before running this file, you need to connect directly to the Tello EDU's ad-hoc network.
# This only needs to be run once per drone, or if the drone is reset.
#
# *NOTE*: Do not commit any changes to this file, or you will be sharing you WiFi information with the world!
#

with FlyTello(['XXX']) as fly:
    fly.set_ap_wifi(ssid='MY_SSID', password='******')
Exemple #7
0
from fly_tello import FlyTello

#
# SIMPLE EXAMPLE - MOST BASIC FLIGHT TO SHOW STATUS MESSAGES
#
# SETUP: Any number of Tellos
#

#
# MAIN FLIGHT CONTROL LOGIC
#

# Read all serial numbers from a serial_numbers.txt file
tello_sn_list = FlyTello.read_serial_numbers_from_file()
# Control the flight
with FlyTello(tello_sn_list, get_status=True) as fly:
    fly.print_status(sync=True)
    fly.takeoff()
    fly.print_status(sync=True)
    fly.land()
    fly.print_status(sync=True)
Exemple #8
0
from fly_tello import FlyTello
from playsound import playsound
from threading import Thread as thread
import time

fly = FlyTello([
    "0TQDG2KEDB4MCG",  # 1
    "0TQDG2KEDBT8F8",  # 2
    "0TQDG2KEDBU93L",  # 3
    "0TQDG2KEDBM40U",  # 4
    "0TQDG3KEDBY1J4"  # 5
])


def motion0():
    with fly.sync_these():
        fly.takeoff(tello=1)
        fly.takeoff(tello=2)
        fly.takeoff(tello=3)
        fly.takeoff(tello=4)
        fly.takeoff(tello=5)
    fly.reorient(50, pad='m-2')
    with fly.sync_these():
        fly.up(30, tello=1)
        fly.up(30, tello=2)
        fly.up(30, tello=3)
        fly.up(30, tello=4)
        fly.up(70, tello=5)


def motion1():
Exemple #9
0
from fly_tello import FlyTello

my_tellos = list()
my_tellos.append('0TQDFB9EUBG09Z')  # serial number

with FlyTello(
        my_tellos
) as fly:  # safe landing if errors occur when using a Context Manager
    fly.takeoff()

    fly.flip("forward")
    fly.up(20)
    fly.flip("forward")
    fly.forward(50)
    fly.up(20)  # execute a series of commands to move the drone
    fly.rotate_cw(90)
    fly.get_battery()
    fly.get_sdk()
    fly.rotate_ccw(90)
    fly.back(50)

    fly.land()
Exemple #10
0
from fly_tello import FlyTello


i = "0TQDG3KEDBG371"
fly = FlyTello([i])
fly.set_ap_wifi(ssid='plk83', password='******')
Exemple #11
0
from fly_tello import FlyTello
my_tellos = list()

# Define the Tello's we're using, in the order we want them numbered
my_tellos.append('0TQDG2KEDB94U4')

fly = FlyTello(my_tellos, get_status=True)

# Control the flight
#fly.pad_detection_on()
#fly.set_pad_detection(direction='downward')
#fly.get_battery(sync=True)
#fly.print_status()
battery = fly.get_status(key='bat', tello=1)
print(battery)
#fly.takeoff()
    #fly.forward(dist=50)
    #fly.back(dist=50)
#fly.reorient(height=120, pad='m1')
#fly.left(dist=80)
    #fly.flip(direction='left')
#fly.reorient(height=120, pad='m2')
    #fly.curve(x1=50, y1=30, z1=0, x2=100, y2=30, z2=-20, speed=60)
    #fly.curve(x1=-50, y1=-30, z1=0, x2=-100, y2=-30, z2=20, speed=60)
    #fly.reorient(height=100, pad='m1')
#fly.rotate_cw(angle=90, tello=1)
    #fly.straight_from_pad(x=30, y=0, z=75, speed=100, pad='m1')
    #fly.flip(direction='back')
#fly.reorient(height=60, pad='m2')
#fly.land()