From 41a354790032f07b56be8e447675a4e550be8c13 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 20 Aug 2023 17:20:27 +1000 Subject: [PATCH] fieldcheck: fix for modern ArduPlane and mission_item_protocol changes --- .../modules/mavproxy_fieldcheck/__init__.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/MAVProxy/modules/mavproxy_fieldcheck/__init__.py b/MAVProxy/modules/mavproxy_fieldcheck/__init__.py index 921ec6c10c..07f8a2d985 100755 --- a/MAVProxy/modules/mavproxy_fieldcheck/__init__.py +++ b/MAVProxy/modules/mavproxy_fieldcheck/__init__.py @@ -70,17 +70,17 @@ def flightdata_filepath(self, filename): def loadRally(self): filepath = self.flightdata_filepath(self.fc_settings.rally_filename) rallymod = self.module('rally') - rallymod.cmd_rally(["load", filepath]) + rallymod.cmd_load([filepath]) def loadFoamyFence(self): filepath = self.flightdata_filepath(self.fc_settings.fence_filename) fencemod = self.module('fence') - fencemod.cmd_fence(["load", filepath]) + fencemod.cmd_load([filepath]) def loadFoamyMission(self, filename): filepath = self.flightdata_filepath(filename) wpmod = self.module('wp') - wpmod.cmd_wp(["load", filepath]) + wpmod.cmd_load([filepath]) def loadFoamyMissionCW(self): self.loadFoamyMission(self.fc_settings.mission_filename_cw) @@ -106,7 +106,7 @@ def check_parameters(self, fix=False): '''check key parameters''' want_values = { "FENCE_ACTION": 4, - "FENCE_MAXALT": self.fc_settings.param_fence_maxalt, + "FENCE_ALT_MAX": self.fc_settings.param_fence_maxalt, "THR_FAILSAFE": 1, "FS_SHORT_ACTN": 0, "FS_LONG_ACTN": 1, @@ -133,18 +133,17 @@ def check_fence_location(self): if fencemod is None: self.whinge("Fence module not loaded") return False - if not fencemod.have_list: - self.whinge("No fence list") + if not fencemod.check_have_list(): if self.is_armed: return False now = time.time() if now - self.last_fence_fetch > 10: self.last_fence_fetch = now self.whinge("Running 'fence list'") - fencemod.list_fence(None) + fencemod.cmd_list(None) return False - count = fencemod.fenceloader.count() + count = fencemod.count() if count < 6: self.whinge("Too few fence points") return False @@ -163,7 +162,7 @@ def check_rally(self): if rallymod is None: self.whinge("No rally module") return False - if not rallymod.have_list: + if not rallymod.check_have_list(): self.whinge("No rally list") if self.is_armed: return False @@ -171,7 +170,7 @@ def check_rally(self): if now - self.last_rally_fetch > 10: self.last_rally_fetch = now self.whinge("Running 'rally list'") - rallymod.cmd_rally(["list"]) + rallymod.cmd_list([]) return False count = rallymod.rally_count()