mirror of https://github.com/ArduPilot/ardupilot
Plane: compiler warnings: apply is_zero(float) or is_equal(float)
This commit is contained in:
parent
3f614534b3
commit
c2eeed7d85
|
@ -182,7 +182,7 @@ static void update_fbwb_speed_height(void)
|
|||
|
||||
change_target_altitude(g.flybywire_climb_rate * elevator_input * delta_us_fast_loop * 0.0001f);
|
||||
|
||||
if (elevator_input == 0.0f && last_elevator_input != 0.0f) {
|
||||
if (AP_Math::is_zero(elevator_input) && !AP_Math::is_zero(last_elevator_input)) {
|
||||
// the user has just released the elevator, lock in
|
||||
// the current altitude
|
||||
set_target_altitude_current();
|
||||
|
|
|
@ -37,7 +37,7 @@ static bool auto_takeoff_check(void)
|
|||
|
||||
// Check for launch acceleration or timer started. NOTE: relies on TECS 50Hz processing
|
||||
if (!launchTimerStarted &&
|
||||
g.takeoff_throttle_min_accel != 0.0f &&
|
||||
!AP_Math::is_zero(g.takeoff_throttle_min_accel) &&
|
||||
SpdHgt_Controller->get_VXdot() < g.takeoff_throttle_min_accel) {
|
||||
goto no_launch;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ static bool auto_takeoff_check(void)
|
|||
}
|
||||
|
||||
// Check ground speed and time delay
|
||||
if (((gps.ground_speed() > g.takeoff_throttle_min_speed || g.takeoff_throttle_min_speed == 0.0f)) &&
|
||||
if (((gps.ground_speed() > g.takeoff_throttle_min_speed || AP_Math::is_zero(g.takeoff_throttle_min_speed))) &&
|
||||
((now - last_tkoff_arm_time) >= wait_time_ms)) {
|
||||
gcs_send_text_fmt(PSTR("Triggered AUTO, GPSspd = %.1f"), gps.ground_speed());
|
||||
launchTimerStarted = false;
|
||||
|
|
Loading…
Reference in New Issue