From a10c63083f2603ef067101a83b3c93ca76abc302 Mon Sep 17 00:00:00 2001 From: Sebastian Hahta <joseha@utu.fi> Date: Fri, 10 Jul 2020 11:17:55 +0300 Subject: [PATCH] hack for emulated pylon devices --- .../rgbd-sources/src/sources/stereovideo/pylon.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp index 33acac114..47b568d86 100644 --- a/components/rgbd-sources/src/sources/stereovideo/pylon.cpp +++ b/components/rgbd-sources/src/sources/stereovideo/pylon.cpp @@ -50,9 +50,9 @@ PylonDevice::PylonDevice(nlohmann::json &config) } if (dev_left_num == i) { - LOG(INFO) << " - found Pylon device - " << d.GetSerialNumber() << "(" << d.GetModelName() << ") [primary]"; + LOG(INFO) << " - found Pylon device - " << d.GetSerialNumber() << " (" << d.GetModelName() << ") [primary]"; } else { - LOG(INFO) << " - found Pylon device - " << d.GetSerialNumber() << "(" << d.GetModelName() << ")"; + LOG(INFO) << " - found Pylon device - " << d.GetSerialNumber() << " (" << d.GetModelName() << ")"; } ++i; @@ -147,8 +147,11 @@ void PylonDevice::_configureCamera(CBaslerUniversalInstantCamera *cam) { LOG(WARNING) << "Could not change pixel format"; } - cam->ExposureTime.SetValue(24000.0f); // Exposure time in microseconds - cam->LightSourcePreset.SetValue(Basler_UniversalCameraParams::LightSourcePreset_Tungsten2800K); // White balance option + if (cam->GetDeviceInfo().GetModelName() != "Emulation") { + // Emulated device throws exception with these + cam->ExposureTime.SetValue(24000.0f); // Exposure time in microseconds + cam->LightSourcePreset.SetValue(Basler_UniversalCameraParams::LightSourcePreset_Tungsten2800K); // White balance option + } } bool PylonDevice::grab() { -- GitLab