AP_OpticalFlow: fixed reversed timestamp

thanks to Randy
This commit is contained in:
Andrew Tridgell 2015-01-02 22:26:53 +11:00
parent d2634a26bd
commit aff01c6d09

View File

@ -65,7 +65,7 @@ void OpticalFlow::update(void)
backend->update(); backend->update();
} }
// only healthy if the data is less than 0.5s old // only healthy if the data is less than 0.5s old
_flags.healthy = (_last_update_ms - hal.scheduler->millis() < 500); _flags.healthy = (hal.scheduler->millis() - _last_update_ms < 500);
} }
void OpticalFlow::setHIL(const struct OpticalFlow::OpticalFlow_state &state) void OpticalFlow::setHIL(const struct OpticalFlow::OpticalFlow_state &state)