Hey guys i recently purchased a Tello and its just Tello, not EDU or Robotmaster, there are some functions when I mess around with the Tello library that I find not working: set_video_direction, set_fps... etc, and I realize I am probably using the old firmware, so I try to update the newest firmware but my phone app keeps showing me it is already the latest version. Does that mean regular Tello can not compile these functions? Since I really need that bottom camera for navigation. Could anyone hold a regular tello run this code and let me know how did it go? Thanks
'''
This file contains the functions for Flight control
'''
import cv2
from djitellopy import tello
from ultralytics import YOLO
import threading
model = YOLO("yolov8n.pt")
t = tello.Tello()
t.connect() # connect to tello
print("connection established")
# problem occurs here=====================================
t.set_video_direction(1)
t.streamon()
print("streaming on")
battery = [t.get_battery()] # record starting battery volume
def video_stream():
while True:
frame = t.get_frame_read().frame
results = model(frame)
annotated_frame = results[0].plot()
cv2.imshow("f", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
t.streamoff()
t.land()
def drone_operation():
t.takeoff()
t.move_forward(20)
t.move_back(20)
t.land()
# operation_thread = threading.Thread(target=drone_operation)
# streaming_thread = threading.Thread(target=video_stream)
# operation_thread.start()
# streaming_thread.start()
# operation_thread.join()
# streaming_thread.join()
# while True:
# print(t.send_command_with_return('battery?'))
battery.append(t.get_battery()) # record finish battery level
print("Drone start battery is {}, drone end battery is {}".format(battery[0], battery[1]))
t.end()
'''
This file contains the functions for Flight control
'''
import cv2
from djitellopy import tello
from ultralytics import YOLO
import threading
model = YOLO("yolov8n.pt")
t = tello.Tello()
t.connect() # connect to tello
print("connection established")
# problem occurs here=====================================
t.set_video_direction(1)
t.streamon()
print("streaming on")
battery = [t.get_battery()] # record starting battery volume
def video_stream():
while True:
frame = t.get_frame_read().frame
results = model(frame)
annotated_frame = results[0].plot()
cv2.imshow("f", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
t.streamoff()
t.land()
def drone_operation():
t.takeoff()
t.move_forward(20)
t.move_back(20)
t.land()
# operation_thread = threading.Thread(target=drone_operation)
# streaming_thread = threading.Thread(target=video_stream)
# operation_thread.start()
# streaming_thread.start()
# operation_thread.join()
# streaming_thread.join()
# while True:
# print(t.send_command_with_return('battery?'))
battery.append(t.get_battery()) # record finish battery level
print("Drone start battery is {}, drone end battery is {}".format(battery[0], battery[1]))
t.end()