From 0bea3f7fddcabcff094ae1bcccabb9e7247517d9 Mon Sep 17 00:00:00 2001 From: NorahXiong Date: Fri, 17 Jan 2025 13:23:04 +0800 Subject: [PATCH] fix(autoware_utils): duplicate variable name and function name in the same namespace will cause compile error when triggering template specilization Signed-off-by: NorahXiong --- .../include/autoware_utils/geometry/geometry.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoware_utils/include/autoware_utils/geometry/geometry.hpp b/autoware_utils/include/autoware_utils/geometry/geometry.hpp index e66adc1..adbaf61 100644 --- a/autoware_utils/include/autoware_utils/geometry/geometry.hpp +++ b/autoware_utils/include/autoware_utils/geometry/geometry.hpp @@ -525,15 +525,15 @@ geometry_msgs::msg::Pose calc_interpolated_pose( if (set_orientation_from_position_direction) { const double input_poses_dist = calc_distance2d(get_point(src_pose), get_point(dst_pose)); - const bool is_driving_forward = is_driving_forward(src_pose, dst_pose); + const bool is_driving_forward_flag = is_driving_forward(src_pose, dst_pose); // Get orientation from interpolated point and src_pose - if ((is_driving_forward && clamped_ratio > 1.0 - (1e-6)) || input_poses_dist < 1e-3) { + if ((is_driving_forward_flag && clamped_ratio > 1.0 - (1e-6)) || input_poses_dist < 1e-3) { output_pose.orientation = get_pose(dst_pose).orientation; - } else if (!is_driving_forward && clamped_ratio < 1e-6) { + } else if (!is_driving_forward_flag && clamped_ratio < 1e-6) { output_pose.orientation = get_pose(src_pose).orientation; } else { - const auto & base_pose = is_driving_forward ? dst_pose : src_pose; + const auto & base_pose = is_driving_forward_flag ? dst_pose : src_pose; const double pitch = calc_elevation_angle(get_point(output_pose), get_point(base_pose)); const double yaw = calc_azimuth_angle(get_point(output_pose), get_point(base_pose)); output_pose.orientation = create_quaternion_from_rpy(0.0, pitch, yaw);