Skip to content
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

[registration] Possible incorrect use of transformation_epsilon in ICP #5750

Closed
themightyoarfish opened this issue Jun 19, 2023 · 5 comments
Closed
Labels

Comments

@themightyoarfish
Copy link
Contributor

I'm not 100% sure if this is a bug, considering the code has been there for 11 years, but I'm wondering if this code is wrong:

convergence_criteria_->setRotationThreshold(1.0 - transformation_epsilon_);

It uses the transformation_epsilon_ value, which is otherwise used as convergence criterion for the translational part of the transform. But if transformation_rotation_epsilon_ is negative (default of -1), it is instead put into an expression for the rotational epsilon. How does this make sense? The translational epsilon may even exceed the possible value range of cos(), and even if it doesn't this seems to mix units.

Context

There is no concrete problem I have, but I stumbled upon this and it seems wrong, but I may be missing something.

The code was added here ca930cd and has been there since, so I suspect I just do not understand what it is supposed to do.

Expected behavior

n/a

Current Behavior

n/a

@themightyoarfish themightyoarfish added kind: bug Type of issue status: triage Labels incomplete labels Jun 19, 2023
@mvieth
Copy link
Member

mvieth commented Jun 21, 2023

I don't think this is a big problem, but I agree that it is strange. We could just delete the else case: then, if transformation_rotation_epsilon_ is unset, convergence_criteria_ will use its default value for the rotation threshold (0.99999). Or do you have another suggestion?

@themightyoarfish
Copy link
Contributor Author

That would seem to be the intuitive change here, but there must be some reason why this code is here, as it seems nonsensical.

@mvieth
Copy link
Member

mvieth commented Jun 28, 2023

@themightyoarfish Maybe this line was added before transformation_rotation_epsilon_ existed, so transformation_epsilon_ was used for both?
A previous PCL maintainer apparently also had doubts about that line: #1724 (comment)
I don't think there is a particular reason for that code. I am fine with removing the else case, feel free to open a pull request.

@themightyoarfish
Copy link
Contributor Author

#5755

@mvieth
Copy link
Member

mvieth commented Jul 9, 2023

Fixed by #5755

@mvieth mvieth closed this as completed Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants