46 const calibration_msgs::CalibrationPattern& features,
47 calibration_msgs::Interval& result)
49 const unsigned int N = features.image_points.size();
51 vector<ros::Time> min_times, max_times;
57 result.start = snapshot.header.stamp;
58 result.end = snapshot.header.stamp;
63 for (
unsigned int i=0; i<N; i++)
66 int x_rounded = (int) features.image_points[i].x;
67 int y_rounded = (
int) features.image_points[i].y;
72 if (features.image_points[i].y <= 0.0 || y_rounded >= (
int) snapshot.num_scans-1)
74 ROS_ERROR(
"Image point #%u (%.2f, %.2f) is outside of Y range (0.00, %u)", i,
75 features.image_points[i].x, features.image_points[i].y, snapshot.num_scans-1);
79 ros::Time min_scan_start =
min( snapshot.scan_start[y_rounded],
80 snapshot.scan_start[y_rounded+1] );
81 ros::Time max_scan_start = max( snapshot.scan_start[y_rounded],
82 snapshot.scan_start[y_rounded+1] );
84 min_times[i] = min_scan_start +
ros::Duration(snapshot.time_increment * x_rounded);
85 max_times[i] = max_scan_start + ros::Duration(snapshot.time_increment * (x_rounded+1));
92 for (
unsigned int i=0; i<N; i++)
94 min_time =
min (min_time, min_times[i]);
95 max_time = max (max_time, max_times[i]);
98 result.start = min_time;
99 result.end = max_time;
static bool computeInterval(const calibration_msgs::DenseLaserSnapshot &snapshot, const calibration_msgs::CalibrationPattern &features, calibration_msgs::Interval &result)