Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(detected_object_validation): add 3d pointcloud based validator #5327
fix(detected_object_validation): add 3d pointcloud based validator #5327
Changes from 3 commits
1afed95
c0bca36
d5b7bed
e3cbf6c
c3317b6
e3389ee
7ad22a7
731e768
be15671
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
CodeRabbit
The
addNeighborPointcloud
method in theDebugger
class is added to add points from an input point cloud to theneighbor_pointcloud_
member variable. However, there are a couple of improvements that can be made:It would be more efficient to reserve space for the new points in the
neighbor_pointcloud_
before adding them. This can be done using thereserve
method to avoid unnecessary reallocations.It's important to check if the input pointer is valid before accessing its contents. This can be done by adding a null check before the loop.
Here's the updated code:
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.
@badai-nguyen I think the point is a decent one and we might as well reflect it.
Check warning on line 1 in perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
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.
The formula here is correct in 2D, but incorrect in 3D.
I don't think it will be a big problem with the 2D formula since it is after height crop, but you should leave it in the comments just in case.
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.
@yukkysaito
IMO:
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.
@badai-nguyen I agree.
Could you please leave a light comment in the code? 🙏
Check warning on line 190 in perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Code Duplication
Check warning on line 190 in perception/detected_object_validation/src/obstacle_pointcloud_based_validator.cpp
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
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.
Since most of them are the same as callback functions of XY-plane, callback functions may be common.
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.
@yukkysaito thank you for your comment. I changed at e3cbf6c
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.
I'm sorry, I didn't communicate it well.
It was a little different from my image.
Most parts of the callback function are the same for 2D and 3D, so I would be happy if you could abstract and absorb only the parts that make a difference in the interface (using template, function pointer, etc.). If it is difficult, it might be better to have separate callbacks.
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.
@yukkysaito I am sorry for late response. Currently, I did not find the efficient way to refactor as your comment yet, so I would like revert to the separate callbacks way first. I will consider to refactor this ASAP in another PR.