From aefa319fc4538b70b29fc39690ad69cedc2b0962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 2 Aug 2016 09:04:44 +0200 Subject: [PATCH] fw_pos_control_l1: fix compiler problem (implicit float conversion) (#5198) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit issue (GCC 6.1.1): ../src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp:1284:27: error: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Werror=double-promotion] if ((fabs(air_gnd_angle) > M_PI) || (ground_speed_2d.length() < 3.0f)) { --- src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index 572d4c1847..d956bfcdfd 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -1281,7 +1281,7 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi float air_gnd_angle = acosf((air_speed_2d * ground_speed_2d) / (air_speed_2d.length() * ground_speed_2d.length())); // if angle > 90 degrees or groundspeed is less than threshold, replace groundspeed with airspeed projection - if ((fabs(air_gnd_angle) > M_PI) || (ground_speed_2d.length() < 3.0f)) { + if ((fabsf(air_gnd_angle) > (float)M_PI) || (ground_speed_2d.length() < 3.0f)) { nav_speed_2d = air_speed_2d; } else {