mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 17:18:28 -04:00
AC_AttitudeControl: use multiply instead of divide
This commit is contained in:
parent
548a7f8fcf
commit
33f437a72c
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user