Skip to content

Commit

Permalink
fix(autoware_behavior_path_planner_common): fix bugprone-errors (#9700)
Browse files Browse the repository at this point in the history
fix: bugprone-error

Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 authored Dec 20, 2024
1 parent 857aa71 commit a7314b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,7 @@ std::vector<lanelet::ConstPoint3d> getBoundWithHatchedRoadMarkings(
get_corresponding_polygon_index(*current_polygon, bound_point.id()));
}
} else {
if (!polygon) {
will_close_polygon = true;
} else if (polygon.value().id() != current_polygon.value().id()) {
if (!polygon || polygon.value().id() != current_polygon.value().id()) {
will_close_polygon = true;
} else {
current_polygon_border_indices.push_back(
Expand Down Expand Up @@ -1496,9 +1494,9 @@ std::vector<geometry_msgs::msg::Point> postProcess(
[](const lanelet::ConstLineString3d & points, std::vector<geometry_msgs::msg::Point> & bound) {
for (const auto & bound_p : points) {
const auto cp = lanelet::utils::conversion::toGeomMsgPt(bound_p);
if (bound.empty()) {
bound.push_back(cp);
} else if (autoware::universe_utils::calcDistance2d(cp, bound.back()) > overlap_threshold) {
if (
bound.empty() ||
autoware::universe_utils::calcDistance2d(cp, bound.back()) > overlap_threshold) {
bound.push_back(cp);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void OccupancyGridBasedCollisionDetector::setMap(const nav_msgs::msg::OccupancyG
for (uint32_t i = 0; i < height; i++) {
is_obstacle_table.at(i).resize(width);
for (uint32_t j = 0; j < width; j++) {
const int cost = costmap_.data[i * width + j];
const int cost = costmap_.data[i * width + j]; // NOLINT

if (cost < 0 || param_.obstacle_threshold <= cost) {
is_obstacle_table[i][j] = true;
Expand Down

0 comments on commit a7314b6

Please sign in to comment.