mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 08:03:34 +08:00
avoid double promotions
This commit is contained in:
committed by
Lorenz Meier
parent
412f956636
commit
4b8bedef48
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user