AP_HAL_SITL: use fabs on double values

This commit is contained in:
Peter Barker 2016-10-20 12:02:35 +11:00 committed by Lucas De Marchi
parent b561837b41
commit e9a0e98863

View File

@ -103,8 +103,8 @@ uint16_t SITL_State::_ground_sonar(void)
}
float voltage = 5.0f;
if (fabsf(_sitl->state.rollDeg) < 90 &&
fabsf(_sitl->state.pitchDeg) < 90) {
if (fabs(_sitl->state.rollDeg) < 90 &&
fabs(_sitl->state.pitchDeg) < 90) {
// adjust for apparent altitude with roll
altitude /= cosf(radians(_sitl->state.rollDeg)) * cosf(radians(_sitl->state.pitchDeg));