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

Support three degrees of freedom #104

Open
caobingquan6 opened this issue Oct 9, 2022 · 5 comments
Open

Support three degrees of freedom #104

caobingquan6 opened this issue Oct 9, 2022 · 5 comments

Comments

@caobingquan6
Copy link

Can we support gicp registration with three degrees of freedom of x, y and yaw for 3D point sets?

@koide3
Copy link
Member

koide3 commented Oct 10, 2022

We do not officially support 3DoF estimation, but to fix XY rotation and Z translation, I think you can constrain the optimization by adding alpha * diag([1, 1, 0, 0, 0, 1]), where alpha is a large number (e.g., 1e6), to the Hessian matrix at the following line.

double y0 = linearize(x0, &H, &b);

@caobingquan6
Copy link
Author

What do you mean is that we need to change

double y0 = linearize(x0, &H, &b);

to:

double y0 = linearize(x0, &H, &b);
double diag=1e6;
H(0,0)+=diag;
H(1,1)+=diag;
H(5,5)+=diag;

Is that right? And what's the principle? I think the H matrix only represents the second gradient of the objective function, but how does it fix XY rotation and Z translation?

Looking forward to your reply. Thank you very much!

@koide3
Copy link
Member

koide3 commented Oct 11, 2022

Yes, it's right.
By adding a large value to a diagonal element of the Hessian matrix, the update vector of that dimension becomes small, and the estimate tries to stay at the current solution. The principle is the same as how the damping factor (lambda) of LM optimization works.

@caobingquan6
Copy link
Author

Thank you very much for your reply! I have another question to ask.

We can see that

double y0 = linearize(x0, &H, &b);

,that is, y0,b and the calculated H matrix correspond to each other. So if we only change the value of H matrix after the above equation (using H+=alpha * diag([1, 1, 0, 0, 0, 1])), while the values of y0 and b do not change, will this be a problem? And Is it theoretically correct?

@koide3
Copy link
Member

koide3 commented Oct 14, 2022

It doesn't matter. It can be interpreted as introducing a prior constraint that penalizes the displacement from the current estimate in the theoretical standpoint. It's often used to stabilize the optimization (as in LM optimization) and to fix gauge freedom (e.g., http://ais.informatik.uni-freiburg.de/teaching/ws11/robotics2/pdfs/ls-slam-tutorial.pdf).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants