-
-
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
[feat] gicp: add convergence criteria and correspondence estimation #5287
base: master
Are you sure you want to change the base?
[feat] gicp: add convergence criteria and correspondence estimation #5287
Conversation
@@ -102,6 +114,9 @@ class GeneralizedIterativeClosestPoint | |||
|
|||
using Vector6d = Eigen::Matrix<double, 6, 1>; | |||
|
|||
typename pcl::registration::GICPConvergenceCriteria<float>::Ptr |
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.
GeneralizedIterativeClosestPoint
inherits from IterativeClosestPoint<PointSource, PointTarget, Scalar = float>
so use float
here.
* GeneralizedIterativeClosestPoint class. This allows to check the convergence state after the | ||
* align() method as well as to configure GICPConvergenceCriteria's parameters not | ||
* available through the GICP API before the align() method is called. Please note that | ||
* the align method sets max_iterations_, transformation_epsilon_ and |
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.
ICP version: max_iterations_
, euclidean_fitness_epsilon_
, transformation_epsilon_
GICP version: max_iterations_
, transformation_epsilon_
, rotation_epsilon_
} | ||
|
||
convergence_criteria_->setMaximumIterations(max_iterations_); | ||
//convergence_criteria_->setRelativeMSE(euclidean_fitness_epsilon_); |
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.
Original gicp didn't check relative rmse
convergence_criteria_->setMaximumIterations(max_iterations_); | ||
//convergence_criteria_->setRelativeMSE(euclidean_fitness_epsilon_); | ||
convergence_criteria_->setTranslationThreshold(transformation_epsilon_); | ||
convergence_criteria_->setRotationThreshold(rotation_epsilon_); |
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.
In ICP this line is:
if (transformation_rotation_epsilon_ > 0)
convergence_criteria_->setRotationThreshold(transformation_rotation_epsilon_);
else
convergence_criteria_->setRotationThreshold(1.0 - transformation_epsilon_);
But gicp has its own rotation_epsilon_
so changed to something like this.
input_transformed_blob.reset(new PCLPointCloud2); | ||
toPCLPointCloud2(*input_transformed, *input_transformed_blob); | ||
} | ||
|
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.
In ICP, here's:
// Save the previously estimated transformation
previous_transformation_ = transformation_;
But there's previous_transformation_ = transformation_;
below in GICP, so delete this two lines.
const pcl::Correspondences& correspondences) | ||
: iterations_(iterations) | ||
, transformation_(transform) | ||
, previous_transformation_ (previous_transform) |
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.
Unlike ICP, in GICP transformation_
and previous_transformation_
are both transform from input cloud. To get the transformation in each iteration, we need both of them.
, max_iterations_(100) // 100 iterations | ||
, failure_after_max_iter_(false) | ||
, rotation_threshold_(0.99999) // 0.256 degrees | ||
, rotation_epsilon_ (2e-3) |
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.
Copied from gicp.h
convergence_state_ = CONVERGENCE_CRITERIA_NOT_CONVERGED; | ||
} | ||
|
||
bool is_similar = false; |
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.
Althrough in original gicp, it exit once delta < 1
, but maybe exiting after max_iterations_similar_transforms_
iterations (like icp) would be better.
if (c_delta > delta) | ||
delta = c_delta; | ||
} | ||
} |
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.
Copied from gicp.hpp
return (true); | ||
} | ||
is_similar = true; | ||
} |
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.
There's no absolute mse and relative mse check in original gicp's code.
@mvieth Do you have any idea how long it will it take to review this pull request? Because I would like to create another PR that would revise gicp.hpp a lot(adding Scalar template variable). |
seems useful, is there anything in particular blocking this other than lack of time or attention? |
@mvieth If this PR is planned to be reviewed, I could resolve the conflicts recently. |
Attempt to fix #3329.