Ignore empty laser scan message. (#767)

FIXES=#766
master
gaschler 2018-03-26 14:58:21 +02:00 committed by GitHub
parent 8dc0352d43
commit 881fa76150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -181,6 +181,9 @@ void SensorBridge::HandleLaserScan(
const std::string& sensor_id, const carto::common::Time time, const std::string& sensor_id, const carto::common::Time time,
const std::string& frame_id, const std::string& frame_id,
const carto::sensor::PointCloudWithIntensities& points) { const carto::sensor::PointCloudWithIntensities& points) {
if (points.points.empty()) {
return;
}
CHECK_LE(points.points.back()[3], 0); CHECK_LE(points.points.back()[3], 0);
// TODO(gaschler): Use per-point time instead of subdivisions. // TODO(gaschler): Use per-point time instead of subdivisions.
for (int i = 0; i != num_subdivisions_per_laser_scan_; ++i) { for (int i = 0; i != num_subdivisions_per_laser_scan_; ++i) {