mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 11:37:06 +08:00
fix some warnings, fabs instead of abs
This commit is contained in:
@@ -510,8 +510,8 @@ void autopilot_check_in_flight(bool_t motors_on)
|
||||
if (autopilot_in_flight_counter > 0) {
|
||||
/* probably in_flight if thrust, speed and accel above IN_FLIGHT_MIN thresholds */
|
||||
if ((stabilization_cmd[COMMAND_THRUST] <= AUTOPILOT_IN_FLIGHT_MIN_THRUST) &&
|
||||
(abs(stateGetSpeedNed_f()->z) < AUTOPILOT_IN_FLIGHT_MIN_SPEED) &&
|
||||
(abs(stateGetAccelNed_f()->z) < AUTOPILOT_IN_FLIGHT_MIN_ACCEL)) {
|
||||
(fabsf(stateGetSpeedNed_f()->z) < AUTOPILOT_IN_FLIGHT_MIN_SPEED) &&
|
||||
(fabsf(stateGetAccelNed_f()->z) < AUTOPILOT_IN_FLIGHT_MIN_ACCEL)) {
|
||||
autopilot_in_flight_counter--;
|
||||
if (autopilot_in_flight_counter == 0) {
|
||||
autopilot_in_flight = FALSE;
|
||||
|
||||
@@ -267,7 +267,7 @@ void stabilization_attitude_read_rc_setpoint_eulers_f(struct FloatEulers *sp, bo
|
||||
//Take v = 9.81/1.3 m/s
|
||||
float omega;
|
||||
const float max_phi = RadOfDeg(85.0);
|
||||
if (abs(sp->phi) < max_phi) {
|
||||
if (fabsf(sp->phi) < max_phi) {
|
||||
omega = 1.3 * tanf(sp->phi);
|
||||
} else { //max 60 degrees roll, then take constant omega
|
||||
omega = 1.3 * 1.72305 * ((sp->phi > 0) - (sp->phi < 0));
|
||||
|
||||
@@ -191,7 +191,7 @@ void nps_set_time_factor(float time_factor)
|
||||
if (time_factor < 0.0 || time_factor > 100.0) {
|
||||
return;
|
||||
}
|
||||
if (abs(nps_main.host_time_factor - time_factor) < 0.01) {
|
||||
if (fabs(nps_main.host_time_factor - time_factor) < 0.01) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user