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 (#8564)

* fix: add runtime error

Signed-off-by: vividf <[email protected]>

* Update blockage_diag_node.cpp

Co-authored-by: badai nguyen  <[email protected]>

* fix: add RCLCPP error logging

Signed-off-by: vividf <[email protected]>

* chore: remove unused variable

Signed-off-by: vividf <[email protected]>

---------

Signed-off-by: vividf <[email protected]>
Co-authored-by: badai nguyen <[email protected]>
  • Loading branch information
vividf and badai-nguyen authored Aug 27, 2024
1 parent a64566e commit d08dcfe
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 d08dcfe

Please sign in to comment.