У нас вы можете посмотреть бесплатно Communicating to flight controller using a third-party application или скачать в максимальном доступном качестве, которое было загружено на ютуб. Для скачивания выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса savevideohd.ru
In this vedio we try to explain how a third-party application and the ground station application (QGroundControl) running in the ground station connecting to the flight controller using telemetry radios. Since the ground station is a windows based computer, we use an additional raspberryPi in order to run MAVProxy. The third-party application can run on the wondows computer or the raspberryPi. The third-party application is supposed to change the mode of the flight controller using a press of a button. python code: Set up MAVLink connection master = mavutil.mavlink_connection('udpin:192.168.0.5:14553') print("waiting for heartbeat...") master.wait_heartbeat() print(f"Heartbeat received from (system: {master.target_system}, component {master.target_component})") Function to set custom flight mode def set_custom_mode(custom_mode, VID): master.mav.set_mode_send( VID, mavutil.mavlink.MAV_MODE_FLAG_CUSTOM_MODE_ENABLED, custom_mode ) Set GUIDED mode function def guided_mode(): print("Setting to GUIDED mode") vehicle_ID = int(droneID.get()) custom_mode = 4 # GUIDED mode set_custom_mode(custom_mode, vehicle_ID) result_label.config(text=f"Vehicle {vehicle_ID} set to GUIDED mode") Set STABILIZED mode function def stabilized_mode(): print("Setting to STABILIZED mode") vehicle_ID = int(droneID.get()) custom_mode = 0 # STABILIZED mode set_custom_mode(custom_mode, vehicle_ID) result_label.config(text=f"Vehicle {vehicle_ID} set to STABILIZED mode") Create the main window root = tk.Tk() root.title("Drone Control") Drone ID input droneID_label = tk.Label(root, text="Enter drone ID") droneID_label.pack(pady=10) droneID = tk.Entry(root) droneID.pack(pady=10) droneID.insert(0, "100") # Default value Guided Mode button guided_button = tk.Button(root, text="Set GUIDED Mode", command=guided_mode) guided_button.pack(pady=10) Stabilized Mode button stabilized_button = tk.Button(root, text="Set STABILIZED Mode", command=stabilized_mode) stabilized_button.pack(pady=10) Result label to display the output result_label = tk.Label(root, text="") result_label.pack(pady=10) Start the main event loop root.mainloop() Ground station raspberryPi should activate its virtual environment containing MAVProxy and run, mavproxy.py --master=/dev/ttyUSB0 --baud=57600 --out=udp:192.168.0.5:14550 --out=udp:192.168.0.5:14553 where, 192.168.0.5 :IP of the ground station 14550 : Port at which QGroundControl is communicating 14553: Port at which third-party application is communicating RaspberryPi attached to the flight controller should run, mavproxy.py --master=/dev/ttyACM1 --baud=57600 --out=/dev/ttyUSB1 --out=udp:192.168.0.5:14550 --out=udp:127.0.0.1:14551 --out=udp:192.168.0.5:14553 /dev/ttyACM1: Serial interface between the flight controller and the raspberryPi /dev/ttyUSB1: USB interface between the telemetry radio and raspberryPi