AC_AttitudeControl: use multiply instead of divide

This commit is contained in:
Randy Mackay 2018-03-15 20:31:03 +09:00
parent 548a7f8fcf
commit 33f437a72c

View File

@ -957,7 +957,7 @@ float AC_AttitudeControl::stopping_point(float first_ord_mag, float p, float sec
return first_ord_mag/p; return first_ord_mag/p;
} else { } else {
float linear_dist = second_ord_lim/sq(p); float linear_dist = second_ord_lim/sq(p);
float overshoot = (linear_dist/2.0f) + sq(first_ord_mag)/(2.0f*second_ord_lim); float overshoot = (linear_dist*0.5f) + sq(first_ord_mag)/(2.0f*second_ord_lim);
if (is_positive(first_ord_mag)){ if (is_positive(first_ord_mag)){
return overshoot; return overshoot;
} else { } else {