HAL_SITL: need to use fabs() for double checking

This commit is contained in:
Andrew Tridgell 2015-05-05 09:26:13 +10:00
parent b9abf30785
commit d8791134f9

View File

@ -258,7 +258,7 @@ void SITL_State::_fdm_input(void)
// prevent bad inputs from SIM from corrupting our state // prevent bad inputs from SIM from corrupting our state
double *v = &_sitl->state.latitude; double *v = &_sitl->state.latitude;
for (uint8_t i=0; i<17; i++) { for (uint8_t i=0; i<17; i++) {
if (isinf(v[i]) || isnan(v[i]) || fabsf(v[i]) > 1.0e10) { if (isinf(v[i]) || isnan(v[i]) || fabs(v[i]) > 1.0e10) {
v[i] = 0; v[i] = 0;
} }
} }