Skip to content
Snippets Groups Projects
Commit 0d9a9161 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fatal error on camera overheat

parent 8606b284
No related branches found
No related tags found
1 merge request!338Resolves #375 full colour resolution
Pipeline #29340 passed
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment