From 11a5c8d2a442c5f7627871569d904d428cc57edf Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sat, 26 Feb 2022 13:50:22 +0000 Subject: [PATCH] Copter: nuke clang warnings --- ArduCopter/Attitude.cpp | 2 +- ArduCopter/mode_auto.cpp | 2 +- ArduCopter/mode_guided.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/Attitude.cpp b/ArduCopter/Attitude.cpp index c823849d86..5d4660c51d 100644 --- a/ArduCopter/Attitude.cpp +++ b/ArduCopter/Attitude.cpp @@ -28,7 +28,7 @@ void Copter::update_throttle_hover() // calc average throttle if we are in a level hover. accounts for heli hover roll trim if (throttle > 0.0f && fabsf(inertial_nav.get_velocity_z_up_cms()) < 60 && - labs(ahrs.roll_sensor-attitude_control->get_roll_trim_cd()) < 500 && labs(ahrs.pitch_sensor) < 500) { + fabsf(ahrs.roll_sensor-attitude_control->get_roll_trim_cd()) < 500 && labs(ahrs.pitch_sensor) < 500) { // Can we set the time constant automatically motors->update_throttle_hover(0.01f); #if HAL_GYROFFT_ENABLED diff --git a/ArduCopter/mode_auto.cpp b/ArduCopter/mode_auto.cpp index 9d2d1a590a..8e3a56c9f2 100644 --- a/ArduCopter/mode_auto.cpp +++ b/ArduCopter/mode_auto.cpp @@ -1980,7 +1980,7 @@ bool ModeAuto::verify_circle(const AP_Mission::Mission_Command& cmd) } // check if we have completed circling - return fabsf(copter.circle_nav->get_angle_total()/M_2PI) >= LOWBYTE(cmd.p1); + return fabsf(copter.circle_nav->get_angle_total()/float(M_2PI)) >= LOWBYTE(cmd.p1); } // verify_spline_wp - check if we have reached the next way point using spline diff --git a/ArduCopter/mode_guided.cpp b/ArduCopter/mode_guided.cpp index 0a26f0aa14..8ed8c8eacb 100644 --- a/ArduCopter/mode_guided.cpp +++ b/ArduCopter/mode_guided.cpp @@ -684,7 +684,7 @@ void ModeGuided::pos_control_run() float pos_offset_z_buffer = 0.0; // Vertical buffer size in m if (guided_pos_terrain_alt) { - pos_offset_z_buffer = MIN(copter.wp_nav->get_terrain_margin() * 100.0, 0.5 * fabsf(guided_pos_target_cm.z)); + pos_offset_z_buffer = MIN(copter.wp_nav->get_terrain_margin() * 100.0, 0.5 * fabsF(guided_pos_target_cm.z)); } pos_control->input_pos_xyz(guided_pos_target_cm, terr_offset, pos_offset_z_buffer);