Skip to content

Commit 6524f38

Browse files
authored
fix(autoware_probabilistic_occupancy_grid_map): fix bugprone-branch-clone (#9652)
fix: bugprone-error Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
1 parent f8ef146 commit 6524f38

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_fixed.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ void OccupancyGridMapFixedBlindSpot::updateWithPointCloud(
144144
transformPointAndCalculate(pt, pt_map, angle_bin_index, range);
145145

146146
// Ignore obstacle points exceed the range of the raw points
147-
if (raw_pointcloud_angle_bins.at(angle_bin_index).empty()) {
148-
continue; // No raw point in this angle bin
149-
} else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
150-
continue; // Obstacle point exceeds the range of the raw points
147+
// No raw point in this angle bin, or obstacle point exceeds the range of the raw points
148+
if (
149+
raw_pointcloud_angle_bins.at(angle_bin_index).empty() ||
150+
range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
151+
continue;
151152
}
152153
obstacle_pointcloud_angle_bins.at(angle_bin_index).emplace_back(range, pt_map[0], pt_map[1]);
153154
}

perception/autoware_probabilistic_occupancy_grid_map/lib/costmap_2d/occupancy_grid_map_projective.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,11 @@ void OccupancyGridMapProjectiveBlindSpot::updateWithPointCloud(
153153
const double dz = scan_z - obstacle_z;
154154

155155
// Ignore obstacle points exceed the range of the raw points
156-
if (raw_pointcloud_angle_bins.at(angle_bin_index).empty()) {
157-
continue; // No raw point in this angle bin
158-
} else if (range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
159-
continue; // Obstacle point exceeds the range of the raw points
156+
// No raw point in this angle bin, or obstacle point exceeds the range of the raw points
157+
if (
158+
raw_pointcloud_angle_bins.at(angle_bin_index).empty() ||
159+
range > raw_pointcloud_angle_bins.at(angle_bin_index).back().range) {
160+
continue;
160161
}
161162

162163
if (dz > projection_dz_threshold_) {

0 commit comments

Comments
 (0)