From 5d4e20937982e449cba83f53f87bb2e1635faf7a Mon Sep 17 00:00:00 2001 From: Jasbir Harnal Date: Wed, 8 May 2019 20:54:34 -0400 Subject: [PATCH] added check for LOG_PATH env var in camera manager so calibration can still be retrieved for log analysis --- camera/camera_manager.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/camera/camera_manager.cc b/camera/camera_manager.cc index 4333b1c..0ca09fb 100644 --- a/camera/camera_manager.cc +++ b/camera/camera_manager.cc @@ -62,7 +62,11 @@ std::optional CameraManager::follow_v4l_path(const std::string& path) const const std::string v4l_path = fs::canonical(path, ec).string(); const int index = v4l_path.back() - '0'; // note that this will break for >10 cameras if (ec) { - return std::nullopt; + if (getenv("LOG_PATH")) { // if LOG_PATH is set, we can assume that we're in playback mode and the video index won't be used + return 0; + } else { + return std::nullopt; + } } else { return index; }