From 94280cb50803d19dc844a9f9327204c117cdc321 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Thu, 20 Aug 2020 23:21:05 +0300
Subject: [PATCH] Set pylon temp selection

---
 components/rgbd-sources/src/sources/stereovideo/pylon.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp
index b9690e2d8..6901837f6 100644
--- a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp
+++ b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp
@@ -127,11 +127,12 @@ PylonDevice::PylonDevice(nlohmann::json &config)
 	temperature_monitor_ = ftl::timer::add(ftl::timer::timerlevel_t::kTimerIdle1, 10.0, [this](int64_t ts) {
 		float temperature = (rcam_) ? std::max(lcam_->DeviceTemperature(), rcam_->DeviceTemperature()) : lcam_->DeviceTemperature();
 
-		LOG_IF(WARNING, temperature > 53.0)
-			<< "Camera temperature over 50C (value: " << temperature << ")";
+		// Note: this is core not housing temperature
+		LOG_IF(WARNING, temperature > 60.0)
+			<< "Camera temperature over 60C (value: " << temperature << ")";
 
 		// TODO: check actual temperature status.
-		if (temperature > 65.0) {
+		if (temperature > 70.0) {
 			LOG(FATAL) << "Cameras are overheating";
 		}
 
@@ -206,6 +207,7 @@ void PylonDevice::_configureCamera(CBaslerUniversalInstantCamera *cam) {
 		cam->LightSourcePreset.SetValue(Basler_UniversalCameraParams::LightSourcePreset_Tungsten2800K);  // White balance option
 		cam->BalanceWhiteAuto.SetValue(Basler_UniversalCameraParams::BalanceWhiteAuto_Once);
 		cam->GainAuto.SetValue(Basler_UniversalCameraParams::GainAuto_Once);
+		cam->DeviceTemperatureSelector.SetValue(Basler_UniversalCameraParams::DeviceTemperatureSelector_Coreboard);
 	}
 }
 
-- 
GitLab