fix some warnings, fabs instead of abs

This commit is contained in:
Felix Ruess
2015-11-19 17:36:27 +01:00
parent 4456593211
commit 718abd61fc
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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));
+1 -1
View File
@@ -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;
}