Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fieldcheck: fix for modern ArduPlane and mission_item_protocol changes #1226

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions MAVProxy/modules/mavproxy_fieldcheck/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -163,15 +162,15 @@ 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
now = time.time()
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()
Expand Down