def new_drone() -> Tello: drone = Tello() drone.connect() drone.for_back_velocity = 0 drone.left_right_velocity = 0 drone.up_down_velocity = 0 drone.yaw_velocity = 0 drone.speed = 0 drone.streamoff() drone.streamon() return drone
def initializeTello(): myDrone = Tello() myDrone.connect() myDrone.for_back_velocity = 0 myDrone.up_down_velocity = 0 myDrone.speed = 0 myDrone.left_right_velocity = 0 myDrone.yaw_velocity = 0 myDrone.streamoff() myDrone.stream_on return myDrone
def initializeTello(): JwTello = Tello() JwTello.connect() JwTello.for_back_velocity = 0 JwTello.left_right_velocity = 0 JwTello.up_down_velocity = 0 JwTello.yaw_velocity = 0 JwTello.speed = 0 print(JwTello.get_battery()) JwTello.streamoff() JwTello.streamon() return JwTello
def initializeTello(): tccdrone = Tello() tccdrone.connect() tccdrone.for_back_velocity = 0 tccdrone.left_right_velocity = 0 tccdrone.up_down_velocity = 0 tccdrone.yaw_velocity = 0 tccdrone.speed = 0 print(tccdrone.get_battery()) tccdrone.streamoff() tccdrone.streamon() return tccdrone
def initialize(self): myDrone = Tello() myDrone.connect() myDrone.for_back_velocity = 0 myDrone.left_right_velocity = 0 myDrone.up_down_velocity = 0 myDrone.yaw_velocity = 0 myDrone.speed = 0 print(myDrone.get_battery()) myDrone.streamoff() myDrone.streamon() return myDrone
def initializeDrone(): drone = Tello() drone.connect() drone.for_back_velocity = 0 drone.left_right_velocity = 0 drone.up_down_velocity = 0 drone.yaw_velocity = 0 drone.speed = 0 print(drone.get_battery()) drone.streamoff() drone.streamon() return drone
def intializeTello(): # CONNECT TO TELLO myDrone = Tello() myDrone.connect() myDrone.for_back_velocity = 0 myDrone.left_right_velocity = 0 myDrone.up_down_velocity = 0 myDrone.yaw_velocity = 0 myDrone.speed = 0 # print(myDrone.get_battery()) myDrone.streamoff() myDrone.streamon() return myDrone
def initTello(): tello = Tello() tello.connect() tello.for_back_velocity = 0 tello.left_right_velocity = 0 tello.up_down_velocity = 0 tello.yaw_velocity = 0 tello.speed = 0 print(tello.get_battery()) # tello.streamoff() tello.streamon() tello.takeoff() return tello
def initializeTello(): # METHOD: CONNECT TO TELLO myDrone = Tello() # Create a Tello object myDrone.connect() # Connect PC to Tello () # Set all velocity and speed of drone to 0 myDrone.for_back_velocity = 0 myDrone.left_right_velocity = 0 myDrone.up_down_velocity = 0 myDrone.yaw_velocity = 0 myDrone.speed = 0 print(myDrone.get_battery()) # Print out percentage of battery myDrone.streamoff() # Turn off video stream of drone myDrone.streamon() # Turn on video stream of drone print("battery: ", myDrone.get_battery()) return myDrone
def initializeTello(): drone = Tello() connection = drone.connect() if connection: drone.for_back_velocity = 0 drone.left_right_velocity = 0 drone.up_down_velocity = 0 drone.yaw_velocity = 0 drone.speed = 0 drone.streamoff() drone.streamon() print(f"\n\n\n\n\nBATTERY: {drone.get_battery()}") return connection, drone
def main(): # CONNECT TO TELLO me = Tello() me.connect() me.for_back_velocity = 0 me.left_right_velocity = 0 me.up_down_velocity = 0 me.yaw_velocity = 0 me.speed = 0 print(me.get_battery()) me.streamoff() me.streamon() ######################## me.takeoff() flyCurve(me, 160, 50) time.sleep(5) me.land()
def initTello(): myDrone = Tello() myDrone.connect() #set velicties to 0 myDrone.for_back_velocity = 0 myDrone.left_right_velocity = 0 myDrone.up_down_velocity = 0 myDrone.yaw_velocity = 0 myDrone.speed = 0 # get battery status print(myDrone.get_battery()) # turn off stream myDrone.streamoff() # stream on myDrone.streamon() return myDrone
from djitellopy import Tello import cv2 import numpy as np width = 640 height = 480 deadZone = 100 startCounter = 0 me = Tello() me.connect() me.for_back_velocity = 0 me.left_right_velocity = 0 me.up_down_velocity = 0 me.yaw_velocity = 0 me.speed = 0 print(me.get_battery()) me.streamoff() me.streamon() frameWidth = width frameHeight = height # cap = cv2.VideoCapture(1) # cap.set(3, frameWidth) # cap.set(4, frameHeight) # cap.set(10,200) global imgContour
ts = datetime.datetime.now() filename = "-{}.jpg".format(ts.strftime("%Y-%m-%d_%H-%M-%S")) #placeholder for input and dropout rate x = tf.placeholder(tf.float32, [1, 227, 227, 3]) keep_prob = tf.placeholder(tf.float32) imgCount = 0 startCounter = 0 S = 5 #Inicialize Tello mdrone = Tello() mdrone.connect() mdrone.for_back_velocity = 0 mdrone.left_right_velocity = 0 mdrone.up_down_velocity = 0 mdrone.yaw_velocity = 0 mdrone.speed = 0 mdrone.send_rc_control = False should_stop = False print(mdrone.get_battery()) mdrone.streamoff() mdrone.streamon() print("Press T to take-off") while True: cmd = input() if cmd == "":
#---------------------------------------------------------------------------------------------- def test_tello(): drone.move_left(20) time.sleep(3) drone.rotate_clockwise(90) time.sleep(3) drone.move_forward(10) #---------------------------------------------------------------------------------------------- if tello_drone: # init Tello drone = Tello() drone.connect() drone.for_back_velocity = 0 drone.left_right_velocity = 0 drone.up_down_velocity = 0 drone.yaw_velocity = 0 drone.speed = 0 print(drone.get_battery()) drone.streamoff() drone.streamon() else: cap = cv2.VideoCapture(0) width = 640 height = 480 fileOut = cv2.VideoWriter('detectionTello.avi',
from djitellopy import Tello import cv2 import numpy as np width = 480 # width of the image height = 360 # height of the image deadZone = 100 startCounter = 0 # startCounter = 1, Inspection Mode, startCounter = 0, Flight Mode # CONNECT TO TELLO # Tello Connect, Initial velocity settings us = Tello() us.connect() us.for_back_velocity = 0 us.left_right_velocity = 0 us.up_down_velocity = 0 us.yaw_velocity = 0 us.speed = 0 print(us.get_battery()) us.streamoff() us.streamon() ######################## frameWidth = width frameHeight = height # cap = cv2.VideoCapture(1)
from djitellopy import Tello import cv2 import time ###################################################################### width = 320 # WIDTH OF THE IMAGE height = 240 # HEIGHT OF THE IMAGE startCounter = 0 # 0 FOR FIGHT 1 FOR TESTING ###################################################################### # CONNECT TO TELLO tello = Tello() tello.connect() tello.for_back_velocity = 0 tello.left_right_velocity = 0 tello.up_down_velocity = 0 tello.yaw_velocity = 0 tello.speed = 0 while True: tello.streamon() # GET THE IMGAE FROM TELLO frame_read = tello.get_frame_read() myFrame = frame_read.frame img = cv2.resize(myFrame, (width, height)) # TO GO UP IN THE BEGINNING if startCounter == 0: tello.takeoff()
from djitellopy import Tello import cv2 import numpy as np width = 640 # 이미지의 초기 폭 height = 480 # 이미지의 초기 높이 deadZone = 100 # 경계값 startCounter =0 # 비행 모드 / 검사 모드 전환 변수, startCounter = 0 : Flight Mode # 텔로 연결, 초기 속도값 설정(전/후/좌/우, 상하, Yaw 속도 = 0) me = Tello() me.connect() me.for_back_velocity = 0 me.left_right_velocity = 0 me.up_down_velocity = 0 me.yaw_velocity = 0 me.speed = 0 print(me.get_battery()) # 텔로 잔여 배터리 값 출력 me.streamoff() # 텔로 카메라 off/on me.streamon() ################################################################# frameWidth = width frameHeight = height # 전역변수로 imgContour, dir(direction) 설정 global imgContour