From 75391b21d735c6aacc9f8b07c839c3b4e51c1dff Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Tue, 2 Nov 2021 09:18:46 +0100
Subject: [PATCH] wip

---
 src/capture/capture_motion.cpp     | 2 +-
 src/processor/processor_motion.cpp | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/capture/capture_motion.cpp b/src/capture/capture_motion.cpp
index 16a535dc9..b87e4fb10 100644
--- a/src/capture/capture_motion.cpp
+++ b/src/capture/capture_motion.cpp
@@ -49,7 +49,7 @@ CaptureMotion::~CaptureMotion()
 
 bool CaptureMotion::containsTimeStamp (const TimeStamp& _ts, double _time_tolerance)
 {
-    assert(_ts.ok());
+    assert(_ts.ok() and this->time_stamp_.ok());
 
     // the same capture is within tolerance
     if (this->time_stamp_ - _time_tolerance <= _ts && _ts <= this->time_stamp_ + _time_tolerance)
diff --git a/src/processor/processor_motion.cpp b/src/processor/processor_motion.cpp
index 7af87c9ac..9b7f8da44 100644
--- a/src/processor/processor_motion.cpp
+++ b/src/processor/processor_motion.cpp
@@ -896,6 +896,7 @@ CaptureMotionPtr ProcessorMotion::findCaptureContainingTimeStamp(const TimeStamp
         capture = frame->getCaptureOf(sensor);
         if (capture != nullptr)
         {
+            assert(std::dynamic_pointer_cast<CaptureMotion>(capture) != nullptr);
             // Rule 1 satisfied! We found a Capture belonging to this processor's Sensor ==> it is a CaptureMotion
             capture_motion = std::static_pointer_cast<CaptureMotion>(capture);
 
-- 
GitLab