Skip to content

Commit

Permalink
mavproxy_wp: skip DO_LAND_START waypoints when splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Nov 10, 2024
1 parent f665668 commit 9fb72e2
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions MAVProxy/modules/mavproxy_wp.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,18 +556,23 @@ def cmd_split(self, args):
print("wp is not a location command")
return

prev = num - 1
if prev < 1 or prev > self.wploader.count():
print("Bad item %u" % num)
return
prev_wp = self.wploader.wp(prev)
if prev_wp is None:
print("Could not get previous wp %u" % prev)
return
prev_loc = self.get_loc(prev_wp)
if prev_loc is None:
print("previous wp is not a location command")
return
prev = num
while True:
prev = prev - 1
if prev < 1 or prev > self.wploader.count():
print("Bad item %u" % num)
return
prev_wp = self.wploader.wp(prev)
if prev_wp is None:
print("Could not get previous wp %u" % prev)
return
if prev_wp.command == mavutil.mavlink.MAV_CMD_DO_LAND_START:
continue
prev_loc = self.get_loc(prev_wp)
if prev_loc is None:
print("previous wp is not a location command")
return
break

if wp.frame != prev_wp.frame:
print("waypoints differ in frame (%u vs %u)" %
Expand Down

0 comments on commit 9fb72e2

Please sign in to comment.