From aae730eddddcbe8076c3bb4eab97e84354a45d47 Mon Sep 17 00:00:00 2001
From: Sebastian Hahta <joseha@utu.fi>
Date: Thu, 13 Aug 2020 13:08:21 +0300
Subject: [PATCH] calib file

---
 .../src/sources/stereovideo/stereovideo.cpp           | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp
index b572e0e4e..aade34c89 100644
--- a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp
+++ b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp
@@ -1,5 +1,7 @@
 #include <loguru.hpp>
 
+#include <ftl/file.hpp>
+
 #include <unordered_set>
 
 #include <Eigen/Eigen>
@@ -42,6 +44,7 @@ using ftl::codecs::Channel;
 using std::string;
 using ftl::rgbd::Capability;
 
+using ftl::file::config_dir;
 
 static cv::Mat rmat(const cv::Vec3d &rvec) {
 	cv::Mat R(cv::Size(3, 3), CV_64FC1);
@@ -165,10 +168,12 @@ void StereoVideoSource::init(const string &file) {
 	}
 	else {
 		fname_calib_ = fname_config ?	*fname_config :
-										string(FTL_LOCAL_CONFIG_ROOT) + "/"
-										+ std::string("calibration.yml");
+										(config_dir() / "ftl" / "calibration.yml").string();
 
-		LOG(ERROR) << "No calibration file found, calibration will be saved to " + fname;
+		LOG(ERROR)	<< "No calibration file found in "
+					<< fname_calib_
+					<< ". Calibration will be saved to "
+					<< fname;
 	}
 
 	// Generate camera parameters for next frame
-- 
GitLab