Skip to content

Commit

Permalink
fix(blockage_diag): output blockage angle range bug fix (autowarefoun…
Browse files Browse the repository at this point in the history
…dation#6445) (autowarefoundation#1151)

* fix: blockage_range_angle bug



* chore: refactor



* Revert "chore: refactor"

This reverts commit fc43094.

---------

Signed-off-by: badai-nguyen <[email protected]>
  • Loading branch information
badai-nguyen authored Feb 20, 2024
1 parent fb12a44 commit e679085
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ void BlockageDiagComponent::filter(

if (ground_blockage_ratio_ > blockage_ratio_threshold_) {
cv::Rect ground_blockage_bb = cv::boundingRect(ground_no_return_mask);
ground_blockage_range_deg_[0] = static_cast<float>(ground_blockage_bb.x) + angle_range_deg_[0];
ground_blockage_range_deg_[0] =
ground_blockage_bb.x * horizontal_resolution_ + angle_range_deg_[0];
ground_blockage_range_deg_[1] =
static_cast<float>(ground_blockage_bb.x + ground_blockage_bb.width) + angle_range_deg_[0];
(ground_blockage_bb.x + ground_blockage_bb.width) * horizontal_resolution_ +
angle_range_deg_[0];
if (ground_blockage_count_ <= 2 * blockage_count_threshold_) {
ground_blockage_count_ += 1;
}
Expand All @@ -266,9 +268,9 @@ void BlockageDiagComponent::filter(
}
if (sky_blockage_ratio_ > blockage_ratio_threshold_) {
cv::Rect sky_blockage_bx = cv::boundingRect(sky_no_return_mask);
sky_blockage_range_deg_[0] = static_cast<float>(sky_blockage_bx.x) + angle_range_deg_[0];
sky_blockage_range_deg_[0] = sky_blockage_bx.x * horizontal_resolution_ + angle_range_deg_[0];
sky_blockage_range_deg_[1] =
static_cast<float>(sky_blockage_bx.x + sky_blockage_bx.width) + angle_range_deg_[0];
(sky_blockage_bx.x + sky_blockage_bx.width) * horizontal_resolution_ + angle_range_deg_[0];
if (sky_blockage_count_ <= 2 * blockage_count_threshold_) {
sky_blockage_count_ += 1;
}
Expand Down

0 comments on commit e679085

Please sign in to comment.