Skip to content

Commit

Permalink
fix(autoware_probabilistic_occupancy_grid_map): fix bugprone-branch-c…
Browse files Browse the repository at this point in the history
…lone (autowarefoundation#9652)

fix: bugprone-error

Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 authored Dec 18, 2024
1 parent f8ef146 commit 6524f38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ void OccupancyGridMapFixedBlindSpot::updateWithPointCloud(
transformPointAndCalculate(pt, pt_map, angle_bin_index, range);

// Ignore obstacle points exceed the range of the raw points
if (raw_pointcloud_angle_bins.at(angle_bin_index).empty()) {
continue; // No raw point in this angle bin
} else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
continue; // Obstacle point exceeds the range of the raw points
// No raw point in this angle bin, or obstacle point exceeds the range of the raw points
if (
raw_pointcloud_angle_bins.at(angle_bin_index).empty() ||
range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
continue;
}
obstacle_pointcloud_angle_bins.at(angle_bin_index).emplace_back(range, pt_map[0], pt_map[1]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ void OccupancyGridMapProjectiveBlindSpot::updateWithPointCloud(
const double dz = scan_z - obstacle_z;

// Ignore obstacle points exceed the range of the raw points
if (raw_pointcloud_angle_bins.at(angle_bin_index).empty()) {
continue; // No raw point in this angle bin
} else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
continue; // Obstacle point exceeds the range of the raw points
// No raw point in this angle bin, or obstacle point exceeds the range of the raw points
if (
raw_pointcloud_angle_bins.at(angle_bin_index).empty() ||
range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
continue;
}

if (dz > projection_dz_threshold_) {
Expand Down

0 comments on commit 6524f38

Please sign in to comment.