From 785c8d6e8cbde25f31b3d0d99d3eca44c4fe27ee Mon Sep 17 00:00:00 2001 From: shulanbushangshu <102840938+shulanbushangshu@users.noreply.github.com> Date: Tue, 14 Jun 2022 19:13:51 +0800 Subject: [PATCH] fix(obstacle_cruise_planner): use absolute value in lateraloffset to filter on obstacles (#1083) * use-absolute-value-in-lateraloffset-to-filter-on-Obstacles Signed-off-by: jack.song * ci(pre-commit): autofix Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- planning/obstacle_cruise_planner/src/node.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/planning/obstacle_cruise_planner/src/node.cpp b/planning/obstacle_cruise_planner/src/node.cpp index 0fe668a8f6e6f..6c1ce70480510 100644 --- a/planning/obstacle_cruise_planner/src/node.cpp +++ b/planning/obstacle_cruise_planner/src/node.cpp @@ -533,7 +533,9 @@ std::vector ObstacleCruisePlannerNode::filterObstacles( const double dist_from_obstacle_to_traj = [&]() { return tier4_autoware_utils::calcLateralOffset(decimated_traj.points, object_pose.position); }(); - if (dist_from_obstacle_to_traj > obstacle_filtering_param_.rough_detection_area_expand_width) { + if ( + std::fabs(dist_from_obstacle_to_traj) > + obstacle_filtering_param_.rough_detection_area_expand_width) { RCLCPP_INFO_EXPRESSION( get_logger(), is_showing_debug_info_, "Ignore obstacles since it is far from the trajectory.");