diff --git a/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp b/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp index 28569f724a5b7..a651477eddb88 100644 --- a/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp +++ b/perception/ground_segmentation/src/scan_ground_filter_nodelet.cpp @@ -257,8 +257,8 @@ void ScanGroundFilterComponent::checkContinuousGndGrid( gnd_buff_z_mean += it->avg_height; } - gnd_buff_radius /= static_cast(gnd_grid_buffer_size_ - 1); - gnd_buff_z_mean /= static_cast(gnd_grid_buffer_size_ - 1); + gnd_buff_radius /= static_cast(gnd_grid_buffer_size_); + gnd_buff_z_mean /= static_cast(gnd_grid_buffer_size_); float tmp_delta_mean_z = gnd_grids_list.back().avg_height - gnd_buff_z_mean; float tmp_delta_radius = gnd_grids_list.back().radius - gnd_buff_radius;