mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_Scripting: added Lua example demonstrating the use of active source set
This commit is contained in:
parent
507dbb0d61
commit
2c58206a75
12
libraries/AP_Scripting/examples/active_source_set.lua
Normal file
12
libraries/AP_Scripting/examples/active_source_set.lua
Normal 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
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user