From 71bb462ad0493a34dea5eab88df1b8693d419e25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 15 Nov 2013 10:42:23 +1100 Subject: [PATCH] AP_InertialSensor: use fabsf() --- libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp index 5ae52020ec..a2694411d5 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp @@ -206,7 +206,7 @@ bool AP_InertialSensor_PX4::healthy(void) // gyros have not updated return false; } - if (fabs(_accel.x) > 30 && fabs(_accel.y) > 30 && fabs(_accel.z) > 30 && + if (fabsf(_accel.x) > 30 && fabsf(_accel.y) > 30 && fabsf(_accel.z) > 30 && (_previous_accel - _accel).length() < 0.01f) { // unchanging accel, large in all 3 axes. This is a likely // accelerometer failure of the LSM303d