Skip to content

Commit b7c8457

Browse files
committed
AP_Scripting: add an example which denies arming if home not set
1 parent 7003647 commit b7c8457

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- example script for ensuring home is set before allowing arming
2+
-- useful so users don't take off in stabilize before RTL will work.
3+
4+
---@dxiagnostic disable: param-type-mismatch
5+
6+
auth_id = arming:get_aux_auth_id()
7+
8+
function update ()
9+
10+
if not ahrs:home_is_set() then
11+
arming:set_aux_auth_failed(auth_id, "Home is not set")
12+
else
13+
arming:set_aux_auth_passed(auth_id)
14+
end
15+
16+
return update, 5000
17+
18+
end
19+
20+
return update()

0 commit comments

Comments
 (0)