-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add PointCloudSamplerWithNormal #339
Conversation
[#847] FAILED on kinetic
|
[#848] FAILED on melodic
[#848] PASSED on noeticTested on Alpine ROS [#848] PASSED on kineticAll tests passed
|
[#849] FAILED on melodic
[#849] PASSED on noeticTested on Alpine ROS [#849] PASSED on kineticAll tests passed
|
[#850] FAILED on noeticTested on Alpine ROS [#850] PASSED on melodicAll tests passed
[#850] PASSED on kineticAll tests passed
[#850] PASSED on noeticTested on Alpine ROS |
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
==========================================
- Coverage 94.56% 94.01% -0.55%
==========================================
Files 32 34 +2
Lines 1729 1806 +77
==========================================
+ Hits 1635 1698 +63
- Misses 94 108 +14
Continue to review full report at Codecov.
|
@at-wat PTAL. |
[#851] PASSED on noeticTested on Alpine ROS [#851] PASSED on melodicAll tests passed
[#851] PASSED on kineticAll tests passed
|
using SamplerType = PointCloudRandomSampler<PointType>; | ||
|
||
LidarMeasurementModelBase() | ||
: sampler_() |
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 think it's better to be set by a constructor argument (from derived class constructor) as it will cause null pointer error if setRandomSampler
is not called.
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.
Or, it can be passed as an argument of LidarMeasurementModel::filter()
.
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.
PointCloudUniformSampler is set as a default.
return output; | ||
} | ||
|
||
const double eigen_value_ratio = std::sqrt(eigen_values_[2]) / std::sqrt(eigen_values_[1]); |
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.
const double eigen_value_ratio = std::sqrt(eigen_values_[2]) / std::sqrt(eigen_values_[1]); | |
const double eigen_value_ratio = std::sqrt(eigen_values_[2] / eigen_values_[1]); |
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.
Done.
{ | ||
acos_angle = 1.0; | ||
} | ||
const double angle = std::acos(acos_angle); |
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'd like to avoid trigonometric functions in the loop of the input points as much as possible.
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 agree, but it takes less than 0.2ms to process this block on my laptop, and the optimization benefits will be small if it is removed. (It takes around 10ms to estimate normals.)
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.
It looks fine as it is not a default option.
Maybe it's better to add short description to algorithm and parameter documents later.
[#852] PASSED on noeticTested on Alpine ROS [#852] PASSED on melodicAll tests passed
[#852] PASSED on kineticAll tests passed
|
@at-wat Please take another look. |
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
When the first principal component of particle positions are much larger than the second, PointCloudSamplerWithNormal selectively samples scan points that have small angular difference between their normals and the first principal component.
After a robot moves along a long corridor without features to estimate travel distance, particles can be converged quickly with this algorithm soon after the robot finds a side way.