File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -220,8 +220,9 @@ bool VelodyneDriver::poll(void)
220
220
while (true )
221
221
{
222
222
int rc = input_->getPacket (&tmp_packet, config_.time_offset );
223
- if (rc == 0 ) break ; // got a full packet?
223
+ if (rc == 1 ) break ; // got a full packet?
224
224
if (rc < 0 ) return false ; // end of file reached?
225
+ if (rc == 0 ) continue ; // timeout?
225
226
}
226
227
scan->packets .push_back (tmp_packet);
227
228
@@ -255,8 +256,9 @@ bool VelodyneDriver::poll(void)
255
256
{
256
257
// keep reading until full packet received
257
258
int rc = input_->getPacket (&scan->packets [i], config_.time_offset );
258
- if (rc == 0 ) break ; // got a full packet?
259
+ if (rc == 1 ) break ; // got a full packet?
259
260
if (rc < 0 ) return false ; // end of file reached?
261
+ if (rc == 0 ) continue ; // timeout?
260
262
}
261
263
}
262
264
}
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ namespace velodyne_driver
189
189
if (retval == 0 ) // poll() timeout?
190
190
{
191
191
ROS_WARN (" Velodyne poll() timeout" );
192
- return - 1 ;
192
+ return 0 ;
193
193
}
194
194
if ((fds[0 ].revents & POLLERR)
195
195
|| (fds[0 ].revents & POLLHUP)
@@ -243,7 +243,7 @@ namespace velodyne_driver
243
243
pkt->stamp = rosTimeFromGpsTimestamp (&(pkt->data [1200 ]));
244
244
}
245
245
246
- return 0 ;
246
+ return 1 ;
247
247
}
248
248
249
249
// //////////////////////////////////////////////////////////////////////
@@ -339,7 +339,7 @@ namespace velodyne_driver
339
339
pkt->stamp = rosTimeFromGpsTimestamp (&(pkt->data [1200 ]), header);
340
340
}
341
341
empty_ = false ;
342
- return 0 ; // success
342
+ return 1 ; // success
343
343
}
344
344
345
345
if (empty_) // no data in file?
You can’t perform that action at this time.
0 commit comments