Browse Source

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

master
nrt 3 years ago committed by Randy Mackay
parent
commit
2c58206a75
  1. 12
      libraries/AP_Scripting/examples/active_source_set.lua
  2. 1
      libraries/AP_Scripting/generator/description/bindings.desc

12
libraries/AP_Scripting/examples/active_source_set.lua

@ -0,0 +1,12 @@ @@ -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

1
libraries/AP_Scripting/generator/description/bindings.desc

@ -54,6 +54,7 @@ singleton AP_AHRS method set_home boolean Location @@ -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…
Cancel
Save