Skip to content

Commit d1ae379

Browse files
committed
guard against min_exposure_time = max_exposure_time
1 parent 8615bb3 commit d1ae379

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

spinnaker_synchronized_camera_driver/src/master_exposure_controller.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ MasterExposureController::MasterExposureController(
3333
brightnessTarget_ = std::min(std::max(declare_param<int>("brightness_target", 120), 1), 255);
3434
currentBrightness_ = brightnessTarget_;
3535
brightnessTolerance_ = declare_param<int>("brightness_tolerance", 5);
36-
maxExposureTime_ = std::max(declare_param<int>("max_exposure_time", 1000), 1);
37-
minExposureTime_ = std::max(declare_param<int>("min_exposure_time", 10), 1);
36+
minExposureTime_ =
37+
std::max(static_cast<double>(declare_param<int>("min_exposure_time", 10)), 1.0);
38+
maxExposureTime_ = std::max(
39+
static_cast<double>(declare_param<int>("max_exposure_time", 1000)), minExposureTime_ + 1);
3840
maxGain_ = declare_param<double>("max_gain", 10);
3941
gainPriority_ = declare_param<bool>("gain_priority", false);
4042
maxFramesSkip_ = declare_param<int>("max_frames_skip", 10); // number of frames to wait

0 commit comments

Comments
 (0)