Browse Source

Fixed a bug where it was possible to "write" a waypoint list without any "current" waypoint. Now the last waypoint is set as "current" in this case.

QGC4.4
pixhawk 14 years ago
parent
commit
428d6f1fb8
  1. 5
      src/uas/UASWaypointManager.cc

5
src/uas/UASWaypointManager.cc

@ -737,8 +737,13 @@ void UASWaypointManager::writeWaypoints()
if (cur_s->getCurrent() && noCurrent) if (cur_s->getCurrent() && noCurrent)
noCurrent = false; noCurrent = false;
if (i == (current_count - 1) && noCurrent == true) //not a single waypoint was set as "current"
cur_d->current = true; // set the last waypoint as current. Or should it better be the first waypoint ?
} }
//send the waypoint count to UAS (this starts the send transaction) //send the waypoint count to UAS (this starts the send transaction)
sendWaypointCount(); sendWaypointCount();
} }

Loading…
Cancel
Save