Skip to content

Commit c6e0c23

Browse files
authored
Fixing bug when trying to compile node without trigger_msgs package (#116)
Co-authored-by: Vikrant Shah <[email protected]>
1 parent cd430bd commit c6e0c23

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

src/capture.cpp

+20-9
Original file line numberDiff line numberDiff line change
@@ -1176,20 +1176,31 @@ void acquisition::Capture::write_queue_to_disk(queue<ImagePtr>* img_q, int cam_n
11761176
while (imageCnt < k_numImages){
11771177
// ROS_DEBUG_STREAM(" Write Queue to Disk for cam: "<< cam_no <<" size = "<<img_q->size());
11781178

1179-
// sleep for 5 milliseconds if the queue is empty
1180-
if(img_q->empty() || sync_message_queue_vector_.at(cam_no).empty()){
1181-
boost::this_thread::sleep(boost::posix_time::milliseconds(5));
1182-
continue;
1183-
}
1179+
#ifdef trigger_msgs_FOUND
1180+
// sleep for 5 milliseconds if the queue is empty
1181+
if(img_q->empty() || sync_message_queue_vector_.at(cam_no).empty()){
1182+
boost::this_thread::sleep(boost::posix_time::milliseconds(5));
1183+
continue;
1184+
}
1185+
#endif
1186+
1187+
#ifndef trigger_msgs_FOUND
1188+
if(img_q->empty()){
1189+
boost::this_thread::sleep(boost::posix_time::milliseconds(5));
1190+
continue;
1191+
}
1192+
#endif
11841193

11851194
ROS_DEBUG_STREAM(" Write Queue to Disk for cam: "<< cam_no <<" size = "<<img_q->size());
11861195

11871196
if (img_q->size()>100)
11881197
ROS_WARN_STREAM(" Queue "<<cam_no<<" size is :"<< img_q->size());
1189-
1190-
if (abs((int)img_q->size() - (int)sync_message_queue_vector_.at(cam_no).size()) > 100){
1191-
ROS_WARN_STREAM(" The camera image size is increasing, the sync trigger messages are not coming at the desired rate");
1192-
}
1198+
1199+
#ifdef trigger_msgs_FOUND
1200+
if (abs((int)img_q->size() - (int)sync_message_queue_vector_.at(cam_no).size()) > 100){
1201+
ROS_WARN_STREAM(" The camera image queue size is increasing, the sync trigger messages are not coming at the desired rate");
1202+
}
1203+
#endif
11931204

11941205
ImagePtr convertedImage = img_q->front();
11951206

0 commit comments

Comments
 (0)