Jai.GAY
(Jai GAY)
December 12, 2024, 1:29am
1
Besides battery:has_failsafed() and vehicle:has_ekf_failsafed() , are there failsafe LUA APIs for other failsafe notifications , such as Radio Failsafe, and GCS Failsafe?
In other words, a method to get notified when a Radio or GCS failsafe has been triggered.
1 Like
iampete
(Peter Hall)
December 12, 2024, 1:43am
2
We don’t have bindings for the actual failsafes. But you can check the validity to run your own checks.
---@return boolean
function rc:has_valid_input() end
-- Return the system time when a gcs with id of SYSID_MYGCS was last seen
---@return uint32_t_ud -- system time in milliseconds
function gcs:last_seen() end
1 Like
Jai.GAY
(Jai GAY)
December 12, 2024, 6:37am
3
What is wrong with this implementation? Arducopter 4.4.4.
local gcs_last_seen = gcs:last_seen()
gcs:send_text(6, "Monitor GCS fail safe last seen = " .. tostring(gcs_last_seen))
12/12/2024 14:32:39 : mpt to call a nil value (method 'last_seen')
12/12/2024 14:32:39 : Lua: /APM/scripts/test_rc_gcs_failsafe.lua:7: atte
FS_GCS_ENABLE,1
SYSID_MYGCS,255
iampete
(Peter Hall)
December 12, 2024, 12:44pm
4
Your on a version from before the binding was added. It will work on the current stable.
Jai.GAY
(Jai GAY)
December 12, 2024, 1:02pm
5
Is there a release note on LUA script supported for Ardupilot where user can track and follow?
How do user verify it is working for
gcs:last_seen()
? For rc:has_valid_input(), I can use gcs:send_text to verify.