diff --git a/src/processor_motion.cpp b/src/processor_motion.cpp index f4dd03469f11e00cfddcd44b8bb2d46c7b9dc2e6..5adb3f9228f60506a7a88cafe74a5955ee786a6c 100644 --- a/src/processor_motion.cpp +++ b/src/processor_motion.cpp @@ -250,6 +250,16 @@ bool ProcessorMotion::keyFrameCallback(FrameBasePtr _new_keyframe, const Scalar& assert(existing_capture != nullptr && "ProcessorMotion::keyFrameCallback: no motion capture containing the required TimeStamp found"); + // If the difference between the found capture time-stamp and the new capture time-stamp + // is greater than the time tolerance, abort. + if (std::abs(new_ts - existing_capture->getTimeStamp()) > _time_tol_other) + { + WOLF_DEBUG("Not joinning the key-frame due to time tol : ", + std::abs(new_ts - existing_capture->getTimeStamp()), + " > ", _time_tol_other); + return false; + } + // Find the frame acting as the capture's origin FrameBasePtr new_keyframe_origin = existing_capture->getOriginFramePtr();