Skip to content

Commit

Permalink
pymavlink: better display of waypoints with jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Tridgell committed Sep 30, 2012
1 parent 3fdee8e commit 786cc49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pymavlink/mavwp.py
Expand Up @@ -270,12 +270,17 @@ def polygon(self, done=None):
idx += 1

while idx < self.count():
w = self.wp(idx)
if idx in done:
if w.x != 0 or w.y != 0:
points.append((w.x, w.y))
break
done.add(idx)
w = self.wp(idx)
if w.command == mavutil.mavlink.MAV_CMD_DO_JUMP:
idx = int(w.param1)
w = self.wp(idx)
if w.x != 0 or w.y != 0:
points.append((w.x, w.y))
continue
idx += 1
if (w.x != 0 or w.y != 0) and w.command in [mavutil.mavlink.MAV_CMD_NAV_WAYPOINT,
Expand Down

0 comments on commit 786cc49

Please sign in to comment.