-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 ICP misbehavior in the "failure after maximum iterations" mode #2892
Fix ICP misbehavior in the "failure after maximum iterations" mode #2892
Conversation
- Exit loop with convergence state instead of `converged_` in icp - Add new convergence state `CONVERGENCE_CRITERIA_FAILURE_AFTER_MAX_ ITERATIONS` - When `failure_after_max_iter_` is set true, `hasConverged()` checks all similarity before returning a failure. - Even though one iteration has several similar conditions, counts `iterations_similar_transforms_` up only 1. - If transform becomes large, `iterations_similar_transforms_` reset to 0. Only consecutive similar iterations are allowed to converge. - Edit a description about the change above in API docs. - When new alignment restarts after a convergence or a failure, `iterations_similar_transforms_` also reset to 0.
registration/include/pcl/registration/impl/default_convergence_criteria.hpp
Outdated
Show resolved
Hide resolved
registration/include/pcl/registration/impl/default_convergence_criteria.hpp
Outdated
Show resolved
Hide resolved
registration/include/pcl/registration/impl/default_convergence_criteria.hpp
Outdated
Show resolved
Hide resolved
registration/include/pcl/registration/impl/default_convergence_criteria.hpp
Show resolved
Hide resolved
registration/include/pcl/registration/impl/default_convergence_criteria.hpp
Show resolved
Hide resolved
No. Just remove else case in case there is a return in the other case. This is not the case here |
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.
Hi, sorry for the long delay. Except to my inline comment, looks good to me.
registration/include/pcl/registration/impl/default_convergence_criteria.hpp
Outdated
Show resolved
Hide resolved
Because there is a reset right after hasConverged() is 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.
Awesome, thank you!
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. @taketwo I would propose a squash with a more meaningful commit message and it's probably better for you to actually write it since I didn't follow this issue properly. 😅
Edit: Forgot to add the question. Should we tag this as a behavioural change? We are adding more statuses...
Yes, this certainly qualifies for behavior change. |
Executive summary:
This updates
ICP
andDefaultConvergenceCriteria
classes to fix misbehavior in the "failure after maximum iterations" mode. (Prior to this change the registration loop would hang in an infinite loop #1598). It also refines "maximum iterations similar transforms" option to mean consequtive transforms.If you use
DefaultConvergenceCriteria
in your registration code, you need to make an adjustment similar to what this PR does in "icp.hpp".It follows #1598. I try to implement as possible as i can. But I didn't understand what taketwo said about reset similar transforms, so I implement my solution.
converged_
in icp.CONVERGENCE_CRITERIA_FAILURE_AFTER_MAX_ ITERATIONS
.failure_after_max_iter_
is set true,hasConverged()
checks all similarity before returning a failure.iterations_similar_transforms_
up only 1.iterations_similar_transforms_
reset to 0. Only consecutive similar iterations are allowed to converge.iterations_similar_transforms_
also reset to 0.