From 428d6f1fb88ee33ec463e9d135ae82312305a0b7 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Wed, 16 Mar 2011 11:12:57 +0100 Subject: [PATCH] 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. --- src/uas/UASWaypointManager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index 9172d17c3..4bdaf6bbe 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -737,8 +737,13 @@ void UASWaypointManager::writeWaypoints() if (cur_s->getCurrent() && noCurrent) 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) sendWaypointCount(); } -- 2.22.0