/
Sangak
/
ardupilot
Обзор
Документация
Войти
/
Sangak
/
ardupilot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
libraries/AP_Scripting/examples/motor_lost.lua
27 строк
711 B
Andrew Tridgell
AP_Scripting: added bindings for VTOL motor loss
13 июл 2023, 01:03
13 июл 2023, 01:03
0f8d618
Код
Авторство
О чём код?
--[[ display motor lost number from MotorsMatrix for multirotors --]] local last_motor_lost = -1 function update() local lost_index if not MotorsMatrix:get_thrust_boost() then -- when get_thrust_boost is false then we have not lost a motor lost_index = -1 else -- otherwise get the lost motor number lost_index = MotorsMatrix:get_lost_motor() end if lost_index ~= last_motor_lost then if lost_index == -1 then gcs:send_text(0, string.format("Motors: recovered")) else gcs:send_text(0, string.format("Motors: lost motor %d", lost_index+1)) end last_motor_lost = lost_index end return update, 100 end return update, 100