From 7601788c432eab14040c58e0938f9d3798bf921a Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 10 Jul 2016 12:44:00 +0200 Subject: [PATCH] INAV: clean up vision timestamps --- .../position_estimator_inav_main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/position_estimator_inav/position_estimator_inav_main.cpp b/src/modules/position_estimator_inav/position_estimator_inav_main.cpp index 66c75c8fcf..6c2f670762 100644 --- a/src/modules/position_estimator_inav/position_estimator_inav_main.cpp +++ b/src/modules/position_estimator_inav/position_estimator_inav_main.cpp @@ -769,8 +769,8 @@ int position_estimator_inav_thread_main(int argc, char *argv[]) static hrt_abstime last_vision_time = 0; - float vision_dt = (vision.timestamp_boot - last_vision_time) / 1e6f; - last_vision_time = vision.timestamp_boot; + float vision_dt = (vision.timestamp - last_vision_time) / 1e6f; + last_vision_time = vision.timestamp; if (vision_dt > 0.000001f && vision_dt < 0.2f) { vision.vx = (vision.x - last_vision_x) / vision_dt; @@ -951,14 +951,14 @@ int position_estimator_inav_thread_main(int argc, char *argv[]) } /* check for timeout on vision topic */ - if (vision_valid && (t > (vision.timestamp_boot + vision_topic_timeout))) { + if (vision_valid && (t > (vision.timestamp + vision_topic_timeout))) { vision_valid = false; warnx("VISION timeout"); mavlink_log_info(&mavlink_log_pub, "[inav] VISION timeout"); } /* check for timeout on mocap topic */ - if (mocap_valid && (t > (mocap.timestamp_boot + mocap_topic_timeout))) { + if (mocap_valid && (t > (mocap.timestamp + mocap_topic_timeout))) { mocap_valid = false; warnx("MOCAP timeout"); mavlink_log_info(&mavlink_log_pub, "[inav] MOCAP timeout");