From 2b2f92b6546510b675d3673fb06f0e335c58e69c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 28 Nov 2023 08:16:12 +0900 Subject: [PATCH] Rover: boats keep navigating at WP if loiter fails --- Rover/mode_auto.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Rover/mode_auto.cpp b/Rover/mode_auto.cpp index 552ced2db5..a93d53f19b 100644 --- a/Rover/mode_auto.cpp +++ b/Rover/mode_auto.cpp @@ -77,13 +77,13 @@ void ModeAuto::update() case Auto_WP: { // boats loiter once the waypoint is reached + bool keep_navigating = true; if (rover.is_boat() && g2.wp_nav.reached_destination() && !g2.wp_nav.is_fast_waypoint()) { - start_loiter(); + keep_navigating = !start_loiter(); + } - // update distance to destination - _distance_to_destination = rover.current_loc.get_distance(g2.wp_nav.get_destination()); - } else { - // update navigation controller + // update navigation controller + if (keep_navigating) { navigate_to_waypoint(); } break;