From 142795a83650738f00e42a66dc5cb2077d6100c9 Mon Sep 17 00:00:00 2001 From: kobayu858 <129580202+kobayu858@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:49:54 +0900 Subject: [PATCH] fix(autoware_pointcloud_preprocessor): fix variableScope (#8447) * fix:variableScope Signed-off-by: kobayu858 * refactor:use const Signed-off-by: kobayu858 --------- Signed-off-by: kobayu858 --- .../src/distortion_corrector/distortion_corrector.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sensing/autoware_pointcloud_preprocessor/src/distortion_corrector/distortion_corrector.cpp b/sensing/autoware_pointcloud_preprocessor/src/distortion_corrector/distortion_corrector.cpp index a7a48180bf64a..868dd96088a65 100644 --- a/sensing/autoware_pointcloud_preprocessor/src/distortion_corrector/distortion_corrector.cpp +++ b/sensing/autoware_pointcloud_preprocessor/src/distortion_corrector/distortion_corrector.cpp @@ -217,13 +217,12 @@ void DistortionCorrector::undistortPointCloud( // If there is a point in a pointcloud that cannot be associated, record it to issue a warning bool is_twist_time_stamp_too_late = false; bool is_imu_time_stamp_too_late = false; - double global_point_stamp; for (; it_x != it_x.end(); ++it_x, ++it_y, ++it_z, ++it_time_stamp) { bool is_twist_valid = true; bool is_imu_valid = true; - global_point_stamp = + const double global_point_stamp = pointcloud.header.stamp.sec + 1e-9 * (pointcloud.header.stamp.nanosec + *it_time_stamp); // Get closest twist information