Plane: compiler warnings: apply is_zero(float) or is_equal(float)

This commit is contained in:
Tom Pittenger 2015-05-02 21:45:07 -07:00 committed by Andrew Tridgell
parent 820f0bf02a
commit 43006c0eec

View File

@ -286,7 +286,7 @@ static void stabilize_acro(float speed_scaler)
/*
check for special roll handling near the pitch poles
*/
if (g.acro_locking && roll_rate == 0) {
if (g.acro_locking && AP_Math::is_zero(roll_rate)) {
/*
we have no roll stick input, so we will enter "roll locked"
mode, and hold the roll we had when the stick was released
@ -313,7 +313,7 @@ static void stabilize_acro(float speed_scaler)
channel_roll->servo_out = rollController.get_rate_out(roll_rate, speed_scaler);
}
if (g.acro_locking && pitch_rate == 0) {
if (g.acro_locking && AP_Math::is_zero(pitch_rate)) {
/*
user has zero pitch stick input, so we lock pitch at the
point they release the stick
@ -459,7 +459,7 @@ static void calc_nav_yaw_ground(void)
if (flight_stage == AP_SpdHgtControl::FLIGHT_TAKEOFF) {
steer_rate = 0;
}
if (steer_rate != 0) {
if (!AP_Math::is_zero(steer_rate)) {
// pilot is giving rudder input
steer_state.locked_course = false;
} else if (!steer_state.locked_course) {