-
Notifications
You must be signed in to change notification settings - Fork 664
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(autoware_ground_segmentation): grid data structure revision for efficiency improvement #9297
feat(autoware_ground_segmentation): grid data structure revision for efficiency improvement #9297
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
d5420a1
to
6d76680
Compare
b63d4f1
to
980e054
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9297 +/- ##
===========================================
- Coverage 30.09% 13.86% -16.23%
===========================================
Files 1340 84 -1256
Lines 103652 5935 -97717
Branches 40362 1394 -38968
===========================================
- Hits 31190 823 -30367
+ Misses 69450 4984 -64466
+ Partials 3012 128 -2884
☔ View full report in Codecov by Sentry. |
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Outdated
Show resolved
Hide resolved
858256b
to
17f6ad2
Compare
Signed-off-by: Taekjin LEE <[email protected]>
…ode.cpp Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
… size refactor: Update Grid class initialization to use radians for azimuth size refactor: Update Grid class initialization to use radians for azimuth size Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
…efficiency Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
…hod for efficiency" This reverts commit a4ab70b. Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
17f6ad2
to
b98e0ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you work. I added some comments. Please check it.
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Outdated
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Outdated
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid_ground_filter.cpp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment.
I prefer adding brief explanation before cpp function definition so that developers can easily get into it.
Here is a sample output I asked chat AI to explain grid_ground_filter
.
// Converts the input point cloud into grid cells by assigning each point to its corresponding cell.
void GridGroundFilter::convert();
// Preprocesses the grid by setting up grid connections and removing empty cells.
void GridGroundFilter::preprocess();
// Recursively searches for ground cells up to a specified count and collects their indices.
bool GridGroundFilter::recursiveSearch(const int check_idx, const int search_cnt, std::vector<int> & idx) const;
// Fits a line to the ground cells using least squares to compute slope (a) and intercept (b).
void GridGroundFilter::fitLineFromGndGrid(const std::vector<int> & idx, float & a, float & b) const;
// Initializes ground cells by analyzing points in each cell and marking ground and non-ground points.
void GridGroundFilter::initializeGround(pcl::PointIndices & out_no_ground_indices);
// Segments points in continuous cells into ground and non-ground based on height and slope thresholds.
void GridGroundFilter::SegmentContinuousCell(const Cell & cell, PointsCentroid & ground_bin, pcl::PointIndices & out_no_ground_indices);
// Segments points in discontinuous cells into ground and non-ground categories.
void GridGroundFilter::SegmentDiscontinuousCell(const Cell & cell, PointsCentroid & ground_bin, pcl::PointIndices & out_no_ground_indices);
// Segments points in break cells into ground and non-ground categories.
void GridGroundFilter::SegmentBreakCell(const Cell & cell, PointsCentroid & ground_bin, pcl::PointIndices & out_no_ground_indices);
// Classifies grid cells by segmenting points into ground and non-ground categories.
void GridGroundFilter::classify(pcl::PointIndices & out_no_ground_indices);
// Processes the input point cloud to classify points as ground or non-ground.
void GridGroundFilter::process(const PointCloud2ConstPtr & in_cloud, pcl::PointIndices & out_no_ground_indices);
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]> refactor: improve efficiency of recursiveSearch function Fix function parameter type in GridGroundFilter
486150f
to
118d18d
Compare
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Explanation of the methods are added f9034ac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
perception/autoware_ground_segmentation/src/scan_ground_filter/grid.hpp
Outdated
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid.hpp
Outdated
Show resolved
Hide resolved
perception/autoware_ground_segmentation/src/scan_ground_filter/grid.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: Taekjin LEE <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Change data structure of grid for calculation efficiency improvement.
This PR do not change main logic of the
scan_ground_filter
.This performance improvement only will be implemented when the option
elevation_grid_mode
is true.How the efficiency is improved
Drawbacks
Drawback mitigation
set the parameter
grid_size_m
to 0.5PR autowarefoundation/autoware_launch#1223
Related links
Parent Issue:
How was this PR tested?
Performance test (check degradation)
TIER IV INTERNAL
Tested with
grid_size_m
of 0.5 and there was no degradation confirmed.Processing time
Before
Computation time difference by grid size is negligible.
After
The larger grid size, the lower computation time.
! performance test will be updated
Visualization
ground-sgmt-old2-01.mp4
ground-sgmt-new2-05.mp4
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.