ArduCopter: Do not use is_zero() for non-float types

This function makes only sense for floating point types. However this
function was also used for ints.
This commit is contained in:
dgrat 2016-05-16 15:14:56 -03:00 committed by Lucas De Marchi
parent f8540f1a80
commit 3bc97ae356
2 changed files with 2 additions and 2 deletions

View File

@ -307,7 +307,7 @@ void Copter::autotune_run()
pos_control.relax_alt_hold_controllers(get_throttle_pre_takeoff(channel_throttle->get_control_in())-throttle_average);
}else{
// check if pilot is overriding the controls
if (!is_zero(target_roll) || !is_zero(target_pitch) || !is_zero(target_yaw_rate) || !is_zero(target_climb_rate)) {
if (!is_zero(target_roll) || !is_zero(target_pitch) || !is_zero(target_yaw_rate) || target_climb_rate != 0) {
if (!autotune_state.pilot_override) {
autotune_state.pilot_override = true;
// set gains to their original values

View File

@ -97,7 +97,7 @@ void Copter::rtl_climb_start()
wp_nav.wp_and_spline_init();
// RTL_SPEED == 0 means use WPNAV_SPEED
if (!is_zero(g.rtl_speed_cms)) {
if (g.rtl_speed_cms != 0) {
wp_nav.set_speed_xy(g.rtl_speed_cms);
}