Skip to content

Commit

Permalink
fix(autoware_pointcloud_preprocessor): blockage diag node add runtime…
Browse files Browse the repository at this point in the history
… error when the parameter is wrong (autowarefoundation#8564)

* fix: add runtime error

Signed-off-by: vividf <yihsiang.fang@tier4.jp>

* Update blockage_diag_node.cpp

Co-authored-by: badai nguyen  <94814556+badai-nguyen@users.noreply.github.com>

* fix: add RCLCPP error logging

Signed-off-by: vividf <yihsiang.fang@tier4.jp>

* chore: remove unused variable

Signed-off-by: vividf <yihsiang.fang@tier4.jp>

---------

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Co-authored-by: badai nguyen <94814556+badai-nguyen@users.noreply.github.com>
  • Loading branch information
2 people authored and ktro2828 committed Sep 18, 2024
1 parent 3e400c9 commit 5229ad7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ void BlockageDiagComponent::filter(
sky_blockage_range_deg_[1] = angle_range_deg_[1];
} else {
for (const auto p : pcl_input->points) {
if (p.channel >= vertical_bins) {
RCLCPP_ERROR(
this->get_logger(),
"p.channel: %d is larger than vertical_bins: %d .Please check the parameter "
"'vertical_bins'.",
p.channel, vertical_bins);
throw std::runtime_error("Parameter is not valid");
}
double azimuth_deg = p.azimuth * (180.0 / M_PI);
if (
((azimuth_deg > angle_range_deg_[0]) &&
Expand Down

0 comments on commit 5229ad7

Please sign in to comment.