Skip to content

Commit a1ec64c

Browse files
committed
fix(blockage_diag): output blockage angle range bug fix (autowarefoundation#6445)
* fix: blockage_range_angle bug Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * chore: refactor Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * Revert "chore: refactor" This reverts commit fc43094. --------- Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
1 parent 44b25d3 commit a1ec64c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sensing/pointcloud_preprocessor/src/blockage_diag/blockage_diag_nodelet.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,11 @@ void BlockageDiagComponent::filter(
255255

256256
if (ground_blockage_ratio_ > blockage_ratio_threshold_) {
257257
cv::Rect ground_blockage_bb = cv::boundingRect(ground_no_return_mask);
258-
ground_blockage_range_deg_[0] = static_cast<float>(ground_blockage_bb.x) + angle_range_deg_[0];
258+
ground_blockage_range_deg_[0] =
259+
ground_blockage_bb.x * horizontal_resolution_ + angle_range_deg_[0];
259260
ground_blockage_range_deg_[1] =
260-
static_cast<float>(ground_blockage_bb.x + ground_blockage_bb.width) + angle_range_deg_[0];
261+
(ground_blockage_bb.x + ground_blockage_bb.width) * horizontal_resolution_ +
262+
angle_range_deg_[0];
261263
if (ground_blockage_count_ <= 2 * blockage_count_threshold_) {
262264
ground_blockage_count_ += 1;
263265
}
@@ -266,9 +268,9 @@ void BlockageDiagComponent::filter(
266268
}
267269
if (sky_blockage_ratio_ > blockage_ratio_threshold_) {
268270
cv::Rect sky_blockage_bx = cv::boundingRect(sky_no_return_mask);
269-
sky_blockage_range_deg_[0] = static_cast<float>(sky_blockage_bx.x) + angle_range_deg_[0];
271+
sky_blockage_range_deg_[0] = sky_blockage_bx.x * horizontal_resolution_ + angle_range_deg_[0];
270272
sky_blockage_range_deg_[1] =
271-
static_cast<float>(sky_blockage_bx.x + sky_blockage_bx.width) + angle_range_deg_[0];
273+
(sky_blockage_bx.x + sky_blockage_bx.width) * horizontal_resolution_ + angle_range_deg_[0];
272274
if (sky_blockage_count_ <= 2 * blockage_count_threshold_) {
273275
sky_blockage_count_ += 1;
274276
}

0 commit comments

Comments
 (0)