From af54acd202e1a600c84a457e6aec609b09857732 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Thu, 1 Sep 2022 14:52:15 +0930 Subject: [PATCH] AC_WPNav: AC_Loiter: Fix loiter level bug --- libraries/AC_WPNav/AC_Loiter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AC_WPNav/AC_Loiter.cpp b/libraries/AC_WPNav/AC_Loiter.cpp index 8c6f447e14..5ba0a245bd 100644 --- a/libraries/AC_WPNav/AC_Loiter.cpp +++ b/libraries/AC_WPNav/AC_Loiter.cpp @@ -118,8 +118,8 @@ void AC_Loiter::init_target() _pos_control.set_correction_speed_accel_xy(LOITER_VEL_CORRECTION_MAX, _accel_cmss); _pos_control.set_pos_error_max_xy_cm(LOITER_POS_CORRECTION_MAX); - // initialise position controller - _pos_control.init_xy_controller(); + // initialise position controller and move target accelerations smoothly towards zero + _pos_control.relax_velocity_controller_xy(); // initialise predicted acceleration and angles from the position controller _predicted_accel.x = _pos_control.get_accel_target_cmss().x;