AP_Scripting: added Lua example demonstrating the use of active source set

This commit is contained in:
nrt 2022-08-06 20:35:06 +05:30 committed by Randy Mackay
parent 507dbb0d61
commit 2c58206a75
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,12 @@
--returns active source set used by EKF3
-- can be used for infering the current source set in use without RC for autonomous source switching
function update() -- this is the loop which periodically runs
gcs:send_text(0, string.format("current source set in use :%d", ahrs:get_posvelyaw_source_set()))
return update, 1000 -- 1000ms reschedules the loop (1Hz)
end
return update() -- run immediately before starting to reschedule

View File

@ -54,6 +54,7 @@ singleton AP_AHRS method set_home boolean Location
singleton AP_AHRS method get_origin boolean Location'Null
singleton AP_AHRS method set_origin boolean Location
singleton AP_AHRS method initialised boolean
singleton AP_AHRS method get_posvelyaw_source_set uint8_t
include AP_Arming/AP_Arming.h