Add a part of the new rigid registration method [FRICP] #6199
Add a part of the new rigid registration method [FRICP] #6199yaoyx689 wants to merge 31 commits into
Conversation
|
Hello, thanks for the pull request. A few things:
I assume you mean
I am not completely sure what you mean with this. Would you have to duplicate code from this pull request to |
|
Please update the license as per https://pcl.readthedocs.io/projects/tutorials/en/latest/writing_new_classes.html#licenses and use the |
|
Thanks for your reply. I will modify them as you said.
In cases where the two point clouds used for registration have partial overlap or noise, our robust ICP algorithm can achieve higher accuracy compared to traditional ICP algorithms. On one hand, this is due to using the Welsch function instead of the L2-norm as the objective function. It reduces the impact of outliers, which is similar to the idea that ICP uses a distance threshold to filter outlier points, but it can achieve better results by giving each correspondence a different threshold instead of just 0,1. On the other hand, the Welsch function can provide a coarse-to-fine result by adjusting parameters (
By default, it will be set based on the maximum distance between corresponding points. This means it has the same effect as setting
In our method, an important part is that the parameters of the Welsch function can be adaptively adjusted. During the iteration process, the parameter |
|
Hello, We have recently added a subclass However, our PR is currently failing the automated checks because the server used for code verification runs out of disk space. Specifically, we are seeing the following error: It seems that #6364encountered a similar issue before. Could you please clean up the disk space on the server corresponding to the Ubuntu 24.04 GCC build environment so that our PR can proceed successfully? Thank you very much for your help. |
|
Hi, thanks for adding the new class. I will take a closer look and test your changes as soon as I have time, but that might take a few weeks. |
mvieth
left a comment
There was a problem hiding this comment.
Hello, I have finally found some time to test your code in detail. With several point clouds, FRICP was indeed able to find a more accurate alignment than other registration algorithms. So I think it would be great to have it in PCL, but first, here are a few review comments I would ask you to address. Thank you!
|
Thanks for the detailed review — I’ve addressed all actionable comments from your latest review.
|
Co-authored-by: Markus Vieth <39675748+mvieth@users.noreply.github.com>
|
Ok,I think I have addressed all the comments. |
mvieth
left a comment
There was a problem hiding this comment.
Then I am happy with the changes. Thank you!
|
|
| * All rights reserved. | ||
| */ | ||
|
|
||
| #ifndef PCL_REGISTRATION_IMPL_FRICP_HPP_ |
There was a problem hiding this comment.
Prefer #pragma once instead.
| return; | ||
| } | ||
|
|
||
| std::vector<int> source_indices; |
There was a problem hiding this comment.
| std::vector<int> source_indices; | |
| std::vector<pcl::index_t> source_indices; |
generally use pcl:index_t for indices.
There was a problem hiding this comment.
Or maybe even better pcl::uindex_t - if you don't check for negative indexes.
| (*target_centered)[i].z = static_cast<float>(target_mat(2, i)); | ||
| } | ||
|
|
||
| pcl::search::KdTree<pcl::PointXYZ> tree_data; |
There was a problem hiding this comment.
Can we use the autoselect function for search object type here @mvieth ?
There was a problem hiding this comment.
Probably, yes. However, I have to take a close look at the whole registration module regarding pcl::search::KdTree vs pcl::search::autoSelectMethod anyway in the future. So I am fine with leaving this part as it is currently, and then I will check again in the future.
|
AI had suggestions to use () instead of [] at some eigen indexing. |
The whole Out of interest, which LLM did you use?
Not sure where the difference/advantage is?
|
Ahh, doh. I just thought the indexing of the method after :: was odd, but it seemingly is so.
Copilot - but what specific model, unsure. Either GPT 5 mini, Haiku 4.5 or GPT 4.1.
AIs own reply when I asked about the same. Short answer: use residuals(i) because () is the canonical, unambiguous Eigen element-access operator and is preferred for matrices/vectors and expression-proxy types.
|
|
Thanks for the review and suggestions. I’ll update the PR accordingly, including the index type changes, Eigen access style cleanup, and the residual handling improvements. |
…duals, Eigen::Index
|
I just asked GPT 5.3-codes - and it came up with the following issues(discussions): Findings (ordered by severity) I haven't reviewed them closely, but I think some of them should be looked at. |
|
I have tested in a program that I'm currently working on and it works really well, so its a nice addition btw 👍 |
|
The clang-tidy warning in concave_hull.cpp is a pre‑existing issue in the codebase and might be addressed separately. |
@larshg So which of these points do you think make sense, and which ones do you think we should ignore (or postpone)? For example I think "FRICP ignores max correspondence distance from the Registration/ICP API" -- this is fine because FRICP has its own mechanism of rejecting correspondences with high distance. At most, we could consider adding a note in the documentation or warning if the max correspondence distance has been set to a non-default value. |
I see no warning in concave_hull.cpp, but I see the following: |
My apologies — Copilot gave me an incorrect explanation. I correct this issue and submit it. Sorry for the confusion and the trouble caused. |
I agree, it was also my own initial thought. But maybe it should be overwritten and output a warning that it doesn't have any effect in this algorithm?
I guess this is fine - it seems faster already anways.
Maybe just document that you can't add the other correspondence estimators/rejectors since they are not used.
If it is expected not to handle this, its fine as is (maybe add assert for it?) and document that it can't handle NAN/Inf
Minor adjustment to documentation.
Easy to add
We have changed many to field initialization, so lets do that here and remove the values from the init-list. |
…ocumentation - Add Ptr/ConstPtr type aliases to FRICP class header - Add assert for finite source/target points (no NaN/Inf) - Document that FRICP ignores maxCorrespondenceDistance, correspondence estimators/rejectors, and that maxIterations controls inner-loop iterations only - Fix setDynamicWelschDecay() doc to note 0 maps to 0.5 - Remove redundant ctor init-list values (robust_function_, nu_end_ratio_ already have in-class defaults)
…it-list Previously removed robust_function_ from constructor init-list along with nu_end_ratio_, but robust_function_ had no in-class initializer, leading to default-initialization of an enum class (indeterminate value). Add explicit in-class default to WELSCH to preserve correct behavior.
Hi, thanks for the suggestions of the contributor (#6061 (comment)), I added a class,
TransformationEstimationPointToPointRobust, which contains the implementation of the robust ICP part of the FRICP (https://github.com/yaoyx689/Fast-Robust-ICP).Compared with
TransformationEstimation, I added a parameter setting function, because its adaptive setting is very important for the results. If there is no additional setting for the parameter, I define a default setting.If possible, I hope to add a
FastRobustIterativeClosestPointclass later, similar toIterativeClosestPoint, to perform adaptive parameter adjustment and pass it into theTransformationEstimationPointToPointRobustclass.Furthermore, for Anderson acceleration, it is not enough to just create an accelerated class of
TransformationEstimation. The iterative process needs to be modified. If possible, these parts can also be organized inFastRobustIterativeClosestPoint.