35 #define DEBUG_PRINTS 1
40 : nh_(nh), nhp_(nhp), it_(nhp), cam_(
ros::this_node::
getName())
61 info_man_ = std::shared_ptr<camera_info_manager::CameraInfoManager>(
80 sensor_msgs::Image img;
83 sensor_msgs::CameraInfo ci =
info_man_->getCameraInfo();
89 vimba_frame_ptr->GetTimestamp(frame_timestamp);
94 ci.header.stamp = ros_time;
96 img.header.frame_id = ci.header.frame_id;
97 img.header.stamp = ci.header.stamp;
102 ROS_WARN_STREAM(
"Function frameToImage returned 0. No image published.");
127 Config config = newconfig;
131 catch (
const std::exception& e)
140 sensor_msgs::CameraInfo ci =
info_man_->getCameraInfo();
143 int binning_or_decimation_x = std::max(config.binning_x, config.decimation_x);
144 int binning_or_decimation_y = std::max(config.binning_y, config.decimation_y);
150 if (sensor_width == -1 || sensor_height == -1)
152 ROS_ERROR(
"Could not determine sensor pixel dimensions, camera_info will be wrong");
155 ci.width = sensor_width;
156 ci.height = sensor_height;
157 ci.binning_x = binning_or_decimation_x;
158 ci.binning_y = binning_or_decimation_y;
161 ci.roi.width = config.width * binning_or_decimation_x;
162 ci.roi.height = config.height * binning_or_decimation_y;
163 ci.roi.x_offset = config.offset_x * binning_or_decimation_x;
164 ci.roi.y_offset = config.offset_y * binning_or_decimation_y;
166 bool roi_is_full_image = (ci.roi.width == ci.width && ci.roi.height == ci.height);
167 ci.roi.do_rectify = !roi_is_full_image;