| 91 | } |
| 92 | |
| 93 | void image_callback(const sensor_msgs::ImageConstPtr &image_msg) |
| 94 | { |
| 95 | //ROS_INFO("image_callback!"); |
| 96 | if(!LOOP_CLOSURE) |
| 97 | return; |
| 98 | m_buf.lock(); |
| 99 | image_buf.push(image_msg); |
| 100 | m_buf.unlock(); |
| 101 | //printf(" image time %f \n", image_msg->header.stamp.toSec()); |
| 102 | |
| 103 | // detect unstable camera stream |
| 104 | if (last_image_time == -1) |
| 105 | last_image_time = image_msg->header.stamp.toSec(); |
| 106 | else if (image_msg->header.stamp.toSec() - last_image_time > 1.0 || image_msg->header.stamp.toSec() < last_image_time) |
| 107 | { |
| 108 | ROS_WARN("image discontinue! detect a new sequence!"); |
| 109 | new_sequence(); |
| 110 | } |
| 111 | last_image_time = image_msg->header.stamp.toSec(); |
| 112 | } |
| 113 | |
| 114 | void point_callback(const sensor_msgs::PointCloudConstPtr &point_msg) |
| 115 | { |
nothing calls this directly
no test coverage detected