Skip to content

Commit

Permalink
fieldcheck: add option to enforce RC option assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jan 2, 2024
1 parent 2d3c7db commit 22a13d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions MAVProxy/modules/mavproxy_fieldcheck/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,23 @@ def check_parameters(self, fix=False):
self.whinge('Setting %s to %f' % (key, want))
self.mav_param.mavset(self.master, key, want, retries=3)

# ensure there is a fence enable/disable switch configured:
required_options = {
11: "Fence Enable/Disable",
}
for required_option in required_options.keys():
found = False
for chan in range(1, 17):
rc_option_param_name = f"RC{chan}_OPTION"
got = self.mav_param.get(rc_option_param_name, None)
if got == required_option:
found = True
break
if not found:
self.whinge("RC channel option %u (%s) must be configured" %
(required_option, required_options[required_option]))
ret = False

return ret

def check_fence_location(self):
Expand Down

0 comments on commit 22a13d0

Please sign in to comment.