/
Sangak
/
ardupilot
Обзор
Документация
Войти
/
Sangak
/
ardupilot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
libraries/AP_Scripting/examples/get-target-location-mount-backend.lua
29 строк
770 B
neo-0007
AP_Scripting: add example script to test target location
27 ноя 2025, 02:14
27 ноя 2025, 02:14
16a79f5
Код
Авторство
О чём код?
-- Test mount scripting backend local UPDATE_MS = 100 local REPORT_INTERVAL_MS = 2000 local last_report_ms = millis() function update() -- Keep mount healthy mount:set_attitude_euler(0, 0, -30, 0) -- Test get_location_target every 2 seconds local now_ms = millis() if now_ms - last_report_ms >= REPORT_INTERVAL_MS then last_report_ms = now_ms local mode = mount:get_mode(0) local target = mount:get_location_target(0) if target then gcs:send_text(6, string.format("Mode %d: %.6f,%.6f", mode, target:lat()/1e7, target:lng()/1e7)) else gcs:send_text(6, string.format("Mode %d: No target", mode)) end end return update, UPDATE_MS end return update()