HAL_SITL: don't advance clock on garbage SIM input

This commit is contained in:
Andrew Tridgell 2015-05-21 21:17:22 +10:00
parent 4c96ec26e5
commit cd66ce1c74

View File

@ -242,10 +242,6 @@ void SITL_State::_fdm_input(void)
return;
}
hal.scheduler->stop_clock(d.fg_pkt.timestamp_us);
_synthetic_clock_mode = true;
got_fg_input = true;
if (d.fg_pkt.latitude == 0 ||
d.fg_pkt.longitude == 0 ||
d.fg_pkt.altitude <= 0) {
@ -253,6 +249,10 @@ void SITL_State::_fdm_input(void)
return;
}
hal.scheduler->stop_clock(d.fg_pkt.timestamp_us);
_synthetic_clock_mode = true;
got_fg_input = true;
if (_sitl != NULL) {
_sitl->state = d.fg_pkt;
// prevent bad inputs from SIM from corrupting our state