From b05cffeaaebefdb53e7f90b587168a50b65934e7 Mon Sep 17 00:00:00 2001 From: muramura Date: Mon, 24 Apr 2023 23:56:02 +0900 Subject: [PATCH] AC_WPNav: Initialize near use --- libraries/AC_WPNav/AC_WPNav.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/AC_WPNav/AC_WPNav.cpp b/libraries/AC_WPNav/AC_WPNav.cpp index 251e852ad9..e63b9fc445 100644 --- a/libraries/AC_WPNav/AC_WPNav.cpp +++ b/libraries/AC_WPNav/AC_WPNav.cpp @@ -587,8 +587,6 @@ int32_t AC_WPNav::get_wp_bearing_to_destination() const /// update_wpnav - run the wp controller - should be called at 100hz or higher bool AC_WPNav::update_wpnav() { - bool ret = true; - // check for changes in speed parameter values if (_check_wp_speed_change) { if (!is_equal(_wp_speed_cms.get(), _last_wp_speed_cms)) { @@ -606,6 +604,7 @@ bool AC_WPNav::update_wpnav() } // advance the target if necessary + bool ret = true; if (!advance_wp_target_along_track(_pos_control.get_dt())) { // To-Do: handle inability to advance along track (probably because of missing terrain data) ret = false;