avoid double promotions

This commit is contained in:
Daniel Agar
2017-04-01 20:19:28 +02:00
committed by Lorenz Meier
parent 412f956636
commit 4b8bedef48
12 changed files with 53 additions and 60 deletions
+6 -5
View File
@@ -40,11 +40,12 @@
*/
#include "vtol_type.h"
#include "drivers/drv_pwm_output.h"
#include <px4_defines.h>
#include <float.h>
#include "vtol_att_control_main.h"
#include <cfloat>
#include <px4_defines.h>
#include <matrix/math.hpp>
VtolType::VtolType(VtolAttitudeControl *att_controller) :
_attc(att_controller),
_vtol_mode(ROTARY_WING)
@@ -209,7 +210,7 @@ void VtolType::check_quadchute_condition()
// fixed-wing maximum pitch angle
if (_params->fw_qc_max_pitch > 0) {
if (fabs(euler.theta()) > fabs(math::radians(_params->fw_qc_max_pitch))) {
if (fabsf(euler.theta()) > fabsf(math::radians(_params->fw_qc_max_pitch))) {
_attc->abort_front_transition("Maximum pitch angle exceeded");
}
}
@@ -217,7 +218,7 @@ void VtolType::check_quadchute_condition()
// fixed-wing maximum roll angle
if (_params->fw_qc_max_roll > 0) {
if (fabs(euler.phi()) > fabs(math::radians(_params->fw_qc_max_roll))) {
if (fabsf(euler.phi()) > fabsf(math::radians(_params->fw_qc_max_roll))) {
_attc->abort_front_transition("Maximum roll angle exceeded");
}
}