From 02d13f4889bdad581492c0fa6271e93ab6f2244a Mon Sep 17 00:00:00 2001 From: Taekjin LEE Date: Thu, 31 Oct 2024 09:43:17 +0900 Subject: [PATCH] fix: bug fix for an average process --- .../ground_segmentation/src/scan_ground_filter_nodelet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;