Skip to content
Snippets Groups Projects
Commit 55235630 authored by Randy Mackay's avatar Randy Mackay
Browse files

Copter: bug fix for slow loiter repositioning

parent 01da926f
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ void AC_WPNav::translate_loiter_target_movements(float nav_dt) ...@@ -168,7 +168,7 @@ void AC_WPNav::translate_loiter_target_movements(float nav_dt)
// constrain the velocity vector and scale if necessary // 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_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) { if( vel_delta_total > vel_max) {
target_vel_adj.x = vel_max * target_vel_adj.x/vel_delta_total; 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; target_vel_adj.y = vel_max * target_vel_adj.y/vel_delta_total;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment