From e0e49be0b07240e9c2097ed726397badeb983dfd Mon Sep 17 00:00:00 2001 From: Ryuta Kambe Date: Sun, 12 May 2024 13:20:17 +0900 Subject: [PATCH 1/3] remove redundant if branch Signed-off-by: Ryuta Kambe --- .../src/scene_no_stopping_area.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp b/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp index 92afd25026a70..e791090ec03e5 100644 --- a/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp +++ b/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp @@ -87,11 +87,8 @@ boost::optional NoStoppingAreaModule::getStopLineGeometry2d( const LineString2d line{{p0.x, p0.y}, {p1.x, p1.y}}; std::vector collision_points; bg::intersection(area_poly, line, collision_points); - if (collision_points.empty()) { - continue; - } - const double yaw = tier4_autoware_utils::calcAzimuthAngle(p0, p1); if (!collision_points.empty()) { + const double yaw = tier4_autoware_utils::calcAzimuthAngle(p0, p1); geometry_msgs::msg::Point left_point; const double w = planner_data_->vehicle_info_.vehicle_width_m; const double l = stop_line_margin; From 021129ad8079f4c90443d6b2b6ee6c5ba0a208e2 Mon Sep 17 00:00:00 2001 From: Ryuta Kambe Date: Sun, 12 May 2024 13:20:33 +0900 Subject: [PATCH 2/3] remove unused variable Signed-off-by: Ryuta Kambe --- .../src/scene_no_stopping_area.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp b/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp index e791090ec03e5..ea70c72b8954f 100644 --- a/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp +++ b/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp @@ -89,7 +89,6 @@ boost::optional NoStoppingAreaModule::getStopLineGeometry2d( bg::intersection(area_poly, line, collision_points); if (!collision_points.empty()) { const double yaw = tier4_autoware_utils::calcAzimuthAngle(p0, p1); - geometry_msgs::msg::Point left_point; const double w = planner_data_->vehicle_info_.vehicle_width_m; const double l = stop_line_margin; stop_line.emplace_back( From 0eb34eb5470efc652051f3851fdea0fdf773671a Mon Sep 17 00:00:00 2001 From: Ryuta Kambe Date: Sun, 12 May 2024 13:23:40 +0900 Subject: [PATCH 3/3] remove redundant initialization Signed-off-by: Ryuta Kambe --- .../src/scene_no_stopping_area.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp b/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp index ea70c72b8954f..7b886fea09b34 100644 --- a/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp +++ b/planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp @@ -302,7 +302,6 @@ Polygon2d NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon( const int num_ignore_nearest = 1; // Do not consider nearest lane polygon size_t ego_area_start_idx = closest_idx + num_ignore_nearest; - size_t ego_area_end_idx = ego_area_start_idx; // return if area size is not intentional if (no_stopping_area_reg_elem_.noStoppingAreas().size() != 1) { return ego_area; @@ -326,7 +325,7 @@ Polygon2d NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon( } double dist_from_area_sum = 0.0; // decide end idx with extract distance - ego_area_end_idx = ego_area_start_idx; + size_t ego_area_end_idx = ego_area_start_idx; for (size_t i = ego_area_start_idx; i < pp.size() - 1; ++i) { dist_from_start_sum += tier4_autoware_utils::calcDistance2d(pp.at(i), pp.at(i - 1)); const auto & p = pp.at(i).point.pose.position;