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

fix(occupancy_grid_map_outlier_filter): add intensity field #6797

Conversation

badai-nguyen
Copy link
Contributor

@badai-nguyen badai-nguyen commented Apr 11, 2024

Description

  • To add intensity field for occupancy_grid_map_outlier_filter to solve the issue Add intensity for poincloud processing in perception and an intensity_based_unknown_validator #6785
  • This PR will avoid fixed pointcloud type like pcl::PointXYZ or pcl::PointXYZI.
  • Almost of all calculations are replaced and done directly in Pointcloud2 except kd_tree_->radiusSearch. So that the pointcloud type will be coppied through the node by reference point_step of input topic so that the pointcloud type which is processed and output depends and is the same as input pointcloud type.

Related links

Tests performed

Confirmed by logging_simulator that the intensity is added into the current empty padding fiedl (offset 12)
image

  • Testing on the sample rosbag shows the processing time isn't affected much, even seems get slightly faster.
Before After
image image
  • Here is testing result when pcl::PointXYZ pointcloud type is input into the node. It shows that the node also work well with PointXYZ type input
    image

Notes for reviewers

Interface changes

Effects on system behavior

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Apr 11, 2024
@badai-nguyen badai-nguyen force-pushed the fix/add_intensity/occupancy_grid_map_outlier_filter branch from eeab1b2 to 6eea3e7 Compare April 12, 2024 15:42
Signed-off-by: badai-nguyen <[email protected]>
Signed-off-by: badai-nguyen <[email protected]>
This reverts commit d16b3e0.
Signed-off-by: badai-nguyen <[email protected]>
Signed-off-by: badai-nguyen <[email protected]>
@badai-nguyen badai-nguyen force-pushed the fix/add_intensity/occupancy_grid_map_outlier_filter branch from 7a4ac14 to fa0543c Compare April 12, 2024 16:15
@badai-nguyen badai-nguyen marked this pull request as ready for review April 12, 2024 16:46
@@ -46,18 +46,17 @@ using geometry_msgs::msg::Pose;
using nav_msgs::msg::OccupancyGrid;
using sensor_msgs::msg::PointCloud2;
using std_msgs::msg::Header;
using PclPointCloud = pcl::PointCloud<pcl::PointXYZ>;
using PclPointCloud = pcl::PointCloud<pcl::PointXYZI>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to support XYZ so that it works with XYZ and XYZI?
If it doesn't work without XYZI, it will be difficult to use it with other sensors.

Copy link
Contributor Author

@badai-nguyen badai-nguyen Apr 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yukkysaito Sorry that line is just typo. I fixed here 0aed0ad

In summary, this PR will avoid fixed pointcloud type like pcl::PointXYZ or pcl::PointXYZI.
Almost of all calculations are replaced and done directly in Pointcloud2 except kd_tree_->radiusSearch. So that the pointcloud type will be coppied through the node by reference point_step of input topic. Then the pointcloud type which is processed and output depends and is the same as input pointcloud type.
Here is testing result of output when I input pcl::PointXYZ type into the node.
Left: input topic
Right output topic

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yukkysaito do you have other concerns related with this?

Signed-off-by: badai-nguyen <[email protected]>
@badai-nguyen badai-nguyen added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 15, 2024
Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late review, I wrote 1 major comment and 1 minor comment.

output.height = input.height;
output.is_bigendian = input.is_bigendian;
output.is_dense = input.is_dense;
output.width = output.data.size() / output.point_step / output.height;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I know that normally height and point_step would not become 0, I prefer adding some error handling here.

  // you can write it with rclcpp error handling
  if (output.height == 0 || output.point_step == 0) {
    std::cerr << "Error: output.height or output.point_step cannot be zero." << std::endl;
    return;
  }

Signed-off-by: badai-nguyen <[email protected]>
Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@badai-nguyen
Copy link
Contributor Author

I aslo confirmed that the output of occupancy_grid_map_outlier_filter node are the same before and after change in case input PointXYZ topics at here

@badai-nguyen badai-nguyen merged commit 1fecd17 into autowarefoundation:main May 7, 2024
20 of 22 checks passed
badai-nguyen added a commit to tier4/autoware.universe that referenced this pull request May 9, 2024
…foundation#6797)

* fix(occupancy_grid_map_outlier_filter): add intensity field

Signed-off-by: badai-nguyen <[email protected]>

* fix: add intensity

Signed-off-by: badai-nguyen <[email protected]>

* fix: using empty padding field

Signed-off-by: badai-nguyen <[email protected]>

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* Revert "refactor"

This reverts commit d16b3e0.

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* fix: radius filter

Signed-off-by: badai-nguyen <[email protected]>

* chore: typo

Signed-off-by: badai-nguyen <[email protected]>

* fix: typo

Signed-off-by: badai-nguyen <[email protected]>

---------

Signed-off-by: badai-nguyen <[email protected]>
vividf pushed a commit to vividf/autoware.universe that referenced this pull request May 16, 2024
…foundation#6797)

* fix(occupancy_grid_map_outlier_filter): add intensity field

Signed-off-by: badai-nguyen <[email protected]>

* fix: add intensity

Signed-off-by: badai-nguyen <[email protected]>

* fix: using empty padding field

Signed-off-by: badai-nguyen <[email protected]>

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* Revert "refactor"

This reverts commit d16b3e0.

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* fix: radius filter

Signed-off-by: badai-nguyen <[email protected]>

* chore: typo

Signed-off-by: badai-nguyen <[email protected]>

* fix: typo

Signed-off-by: badai-nguyen <[email protected]>

---------

Signed-off-by: badai-nguyen <[email protected]>
Signed-off-by: vividf <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…foundation#6797)

* fix(occupancy_grid_map_outlier_filter): add intensity field

Signed-off-by: badai-nguyen <[email protected]>

* fix: add intensity

Signed-off-by: badai-nguyen <[email protected]>

* fix: using empty padding field

Signed-off-by: badai-nguyen <[email protected]>

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* Revert "refactor"

This reverts commit d16b3e0.

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* fix: radius filter

Signed-off-by: badai-nguyen <[email protected]>

* chore: typo

Signed-off-by: badai-nguyen <[email protected]>

* fix: typo

Signed-off-by: badai-nguyen <[email protected]>

---------

Signed-off-by: badai-nguyen <[email protected]>
badai-nguyen added a commit to tier4/autoware.universe that referenced this pull request Jun 14, 2024
…foundation#6797)

* fix(occupancy_grid_map_outlier_filter): add intensity field

Signed-off-by: badai-nguyen <[email protected]>

* fix: add intensity

Signed-off-by: badai-nguyen <[email protected]>

* fix: using empty padding field

Signed-off-by: badai-nguyen <[email protected]>

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* Revert "refactor"

This reverts commit d16b3e0.

* refactor

Signed-off-by: badai-nguyen <[email protected]>

* fix: radius filter

Signed-off-by: badai-nguyen <[email protected]>

* chore: typo

Signed-off-by: badai-nguyen <[email protected]>

* fix: typo

Signed-off-by: badai-nguyen <[email protected]>

---------

Signed-off-by: badai-nguyen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants