From 55235630b6d96d475c8a355350bbff24e5204478 Mon Sep 17 00:00:00 2001
From: Randy Mackay <rmackay9@yahoo.com>
Date: Sun, 12 May 2013 14:51:02 +0900
Subject: [PATCH] Copter: bug fix for slow loiter repositioning

---
 libraries/AC_WPNav/AC_WPNav.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/AC_WPNav/AC_WPNav.cpp b/libraries/AC_WPNav/AC_WPNav.cpp
index 8a50c19d1..f8860f754 100644
--- a/libraries/AC_WPNav/AC_WPNav.cpp
+++ b/libraries/AC_WPNav/AC_WPNav.cpp
@@ -168,7 +168,7 @@ void AC_WPNav::translate_loiter_target_movements(float nav_dt)
 
     // constrain the velocity vector and scale if necessary
     vel_delta_total = safe_sqrt(target_vel_adj.x*target_vel_adj.x + target_vel_adj.y*target_vel_adj.y);
-    vel_max = MAX_LOITER_POS_ACCEL*nav_dt;
+    vel_max = 2.0*MAX_LOITER_POS_ACCEL*nav_dt;
     if( vel_delta_total >  vel_max) {
         target_vel_adj.x = vel_max * target_vel_adj.x/vel_delta_total;
         target_vel_adj.y = vel_max * target_vel_adj.y/vel_delta_total;
-- 
GitLab