2021-08-14 21:35:15 -03:00
|
|
|
-- switch between DCM and EKF3 on a switch
|
|
|
|
|
2024-05-03 15:22:25 -03:00
|
|
|
---@diagnostic disable: need-check-nil
|
|
|
|
|
2021-08-14 21:35:15 -03:00
|
|
|
local scripting_rc1 = rc:find_channel_for_option(300)
|
2022-09-12 20:39:03 -03:00
|
|
|
local EKF_TYPE = Parameter('AHRS_EKF_TYPE')
|
2021-08-14 21:35:15 -03:00
|
|
|
|
|
|
|
function update()
|
|
|
|
local sw_pos = scripting_rc1:get_aux_switch_pos()
|
|
|
|
if sw_pos == 0 then
|
|
|
|
EKF_TYPE:set(3)
|
|
|
|
else
|
|
|
|
EKF_TYPE:set(0)
|
|
|
|
end
|
|
|
|
return update, 100
|
|
|
|
end
|
|
|
|
|
|
|
|
return update()
|