diff --git a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp index 3e3945a7205af2cd201bf4a35cf2e1c42f0dbc57..b9690e2d8fed449b57552d08e147d7c3fa1e717d 100644 --- a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp +++ b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp @@ -125,13 +125,15 @@ PylonDevice::PylonDevice(nlohmann::json &config) monitor_ = true; 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 << ")"; - // TODO: stop if camera temperature exceeds threshold + // TODO: check actual temperature status. + if (temperature > 65.0) { + LOG(FATAL) << "Cameras are overheating"; + } return true; }); @@ -140,6 +142,7 @@ PylonDevice::PylonDevice(nlohmann::json &config) PylonDevice::~PylonDevice() { monitor_ = false; temperature_monitor_.cancel(); + lcam_->Close(); rcam_->Close(); }