Skip to content

Commit

Permalink
refactor(behavior_velocity_no_stopping_area_module): cppcheck warnings (
Browse files Browse the repository at this point in the history
#6986)

* remove redundant if branch

Signed-off-by: Ryuta Kambe <[email protected]>

* remove unused variable

Signed-off-by: Ryuta Kambe <[email protected]>

* remove redundant initialization

Signed-off-by: Ryuta Kambe <[email protected]>

---------

Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc authored May 21, 2024
1 parent aa8767b commit 982b5c9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,8 @@ boost::optional<LineString2d> NoStoppingAreaModule::getStopLineGeometry2d(
const LineString2d line{{p0.x, p0.y}, {p1.x, p1.y}};
std::vector<Point2d> 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()) {
geometry_msgs::msg::Point left_point;
const double yaw = tier4_autoware_utils::calcAzimuthAngle(p0, p1);
const double w = planner_data_->vehicle_info_.vehicle_width_m;
const double l = stop_line_margin;
stop_line.emplace_back(
Expand Down Expand Up @@ -306,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;
Expand All @@ -330,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;
Expand Down

0 comments on commit 982b5c9

Please sign in to comment.