diff --git a/sensing/pointcloud_preprocessor/src/outlier_filter/dual_return_outlier_filter_nodelet.cpp b/sensing/pointcloud_preprocessor/src/outlier_filter/dual_return_outlier_filter_nodelet.cpp index ccceae9ab5186..ffbf322e669dc 100644 --- a/sensing/pointcloud_preprocessor/src/outlier_filter/dual_return_outlier_filter_nodelet.cpp +++ b/sensing/pointcloud_preprocessor/src/outlier_filter/dual_return_outlier_filter_nodelet.cpp @@ -231,10 +231,10 @@ void DualReturnOutlierFilterComponent::filter( if (deleted_azimuths.size() == 0) { continue; } - while ((uint)deleted_azimuths[current_deleted_index] < + while (current_deleted_index < deleted_azimuths.size() && + (uint)deleted_azimuths[current_deleted_index] < ((i + static_cast(min_azimuth / horizontal_resolution) + 1) * - horizontal_resolution) && - current_deleted_index < (deleted_azimuths.size() - 1)) { + horizontal_resolution)) { noise_frequency[i] = noise_frequency[i] + 1; current_deleted_index++; }