From 7fb34a1e4290050377bece2865966ff02e78f1a8 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 1 Jun 2020 20:15:00 +0300
Subject: [PATCH] Fix incorrect vision timestamp

---
 .../rgbd-sources/src/sources/stereovideo/stereovideo.cpp       | 3 ++-
 .../rgbd-sources/src/sources/stereovideo/stereovideo.hpp       | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp
index 8f8297c58..dd4e2dc3e 100644
--- a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp
+++ b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp
@@ -275,6 +275,7 @@ void StereoVideoSource::updateParameters() {
 }
 
 bool StereoVideoSource::capture(int64_t ts) {
+	capts_ = timestamp_;
 	timestamp_ = ts;
 	lsrc_->grab();
 	return true;
@@ -338,7 +339,7 @@ bool StereoVideoSource::compute(int n, int b) {
 		if (!frame.hasChannel(Channel::Left)) { return false; }
 	}
 
-	host_->notify(timestamp_, frame);
+	host_->notify(capts_, frame);
 	return true;
 }
 
diff --git a/components/rgbd-sources/src/sources/stereovideo/stereovideo.hpp b/components/rgbd-sources/src/sources/stereovideo/stereovideo.hpp
index 4b6b60e63..52ec6f393 100644
--- a/components/rgbd-sources/src/sources/stereovideo/stereovideo.hpp
+++ b/components/rgbd-sources/src/sources/stereovideo/stereovideo.hpp
@@ -38,6 +38,7 @@ class StereoVideoSource : public detail::Source {
 
 	LocalSource *lsrc_;
 	Calibrate *calib_;
+	int64_t capts_;
 
 	cv::Size color_size_;
 	cv::Size depth_size_;
-- 
GitLab