Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if camera supports sensor scaling before trying to set it #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ueye_cam_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,10 @@ INT UEyeCamNodelet::parseROSParams(ros::NodeHandle& local_nh) {
if ((is_err = setBinning(cam_params_.binning, false)) != IS_SUCCESS) return is_err;
if ((is_err = setResolution(cam_params_.image_width, cam_params_.image_height,
cam_params_.image_left, cam_params_.image_top, false)) != IS_SUCCESS) return is_err;
if ((is_err = setSensorScaling(cam_params_.sensor_scaling, false)) != IS_SUCCESS) return is_err;

SENSORSCALERINFO sensorScalerInfo; // Not all cameras support sensor scaling. Check if supported and only try to set it if supported
if (is_GetSensorScalerInfo(cam_handle_,&sensorScalerInfo, sizeof(sensorScalerInfo)) == IS_SUCCESS ) {
if ((is_err = setSensorScaling(cam_params_.sensor_scaling, false)) != IS_SUCCESS) return is_err;
}
// Force synchronize settings and re-allocate frame buffer for redundancy
// NOTE: although this might not be needed, assume that parseROSParams()
// is called only once per nodelet, thus ignore cost
Expand Down