From aff01c6d09cd25da1418460c39f96e836fe91620 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Jan 2015 22:26:53 +1100 Subject: [PATCH] AP_OpticalFlow: fixed reversed timestamp thanks to Randy --- libraries/AP_OpticalFlow/OpticalFlow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_OpticalFlow/OpticalFlow.cpp b/libraries/AP_OpticalFlow/OpticalFlow.cpp index 7262c72f08..708e8ace7b 100644 --- a/libraries/AP_OpticalFlow/OpticalFlow.cpp +++ b/libraries/AP_OpticalFlow/OpticalFlow.cpp @@ -65,7 +65,7 @@ void OpticalFlow::update(void) backend->update(); } // 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)