Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(obstacle_pointcloud_based_validator_node): skip validation when obstacle pointcloud is empty #6684

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,19 @@
// objects_pub_->publish(*input_objects);
return;
}
bool validation_is_ready = true;
if (!validator_->setKdtreeInputCloud(input_obstacle_pointcloud)) {
RCLCPP_WARN_THROTTLE(this->get_logger(), *this->get_clock(), 5, "cannot receive pointcloud");
return;
RCLCPP_WARN_THROTTLE(

Check warning on line 332 in perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp

View check run for this annotation

Codecov / codecov/patch

perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp#L332

Added line #L332 was not covered by tests
this->get_logger(), *this->get_clock(), 5,
"obstacle pointcloud is empty! Can not validate objects.");
validation_is_ready = false;
}

for (size_t i = 0; i < transformed_objects.objects.size(); ++i) {
const auto & transformed_object = transformed_objects.objects.at(i);
const auto & object = input_objects->objects.at(i);
const auto validated = validator_->validate_object(transformed_object);
const auto validated =
validation_is_ready ? validator_->validate_object(transformed_object) : false;

Check warning on line 342 in perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp

View check run for this annotation

Codecov / codecov/patch

perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp#L342

Added line #L342 was not covered by tests
if (debugger_) {
debugger_->addNeighborPointcloud(validator_->getDebugNeighborPointCloud());
debugger_->addPointcloudWithinPolygon(validator_->getDebugPointCloudWithinObject());
Expand Down
Loading