diff --git a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp index 9851ab4c0528a30bf974f9060bcf3a741b16c680..515aadda3bb84642a9710bdd2463a0e8e079507b 100644 --- a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp +++ b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp @@ -96,6 +96,15 @@ PylonDevice::PylonDevice(nlohmann::json &config) left_hm_ = cv::cuda::HostMem(height_, width_, CV_8UC4); right_hm_ = cv::cuda::HostMem(height_, width_, CV_8UC4); hres_hm_ = cv::cuda::HostMem(fullheight_, fullwidth_, CV_8UC4); + + on("exposure", [this](const ftl::config::Event &e) { + if (lcam_->GetDeviceInfo().GetModelName() != "Emulation") { + lcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds + } + if (rcam_ && rcam_->GetDeviceInfo().GetModelName() != "Emulation") { + rcam_->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds + } + }); } PylonDevice::~PylonDevice() { @@ -149,7 +158,7 @@ void PylonDevice::_configureCamera(CBaslerUniversalInstantCamera *cam) { if (cam->GetDeviceInfo().GetModelName() != "Emulation") { // Emulated device throws exception with these - cam->ExposureTime.SetValue(24000.0f); // Exposure time in microseconds + cam->ExposureTime.SetValue(value("exposure", 24000.0f)); // Exposure time in microseconds cam->LightSourcePreset.SetValue(Basler_UniversalCameraParams::LightSourcePreset_Tungsten2800K); // White balance option } }