Fix a crash, since subdivisions can be empty. (#543)

master
Holger Rapp 2017-10-17 13:12:24 +02:00 committed by GitHub
parent 38f1c4dc14
commit 6b22cfaf8d
1 changed files with 3 additions and 0 deletions

View File

@ -149,6 +149,9 @@ void SensorBridge::HandleLaserScan(
points.points.size() * (i + 1) / num_subdivisions_per_laser_scan_; points.points.size() * (i + 1) / num_subdivisions_per_laser_scan_;
const carto::sensor::PointCloud subdivision( const carto::sensor::PointCloud subdivision(
points.points.begin() + start_index, points.points.begin() + end_index); points.points.begin() + start_index, points.points.begin() + end_index);
if (start_index == end_index) {
continue;
}
const size_t middle_index = (start_index + end_index) / 2; const size_t middle_index = (start_index + end_index) / 2;
const carto::common::Time subdivision_time = const carto::common::Time subdivision_time =
start_time + start_time +