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

how can i get the covariance matrix after matching? #20

Open
JokerJohn opened this issue Jun 19, 2020 · 5 comments
Open

how can i get the covariance matrix after matching? #20

JokerJohn opened this issue Jun 19, 2020 · 5 comments

Comments

@JokerJohn
Copy link

hello kode3, thanks for your work! i have a question.when i use your ndt omp library for localization, i do not know how to get the covariance matrix which can evaluate my result?

@idref
Copy link

idref commented Oct 5, 2021

Hello koide3, thanks for your great work!
I am working on the topic: covariance estimation of NDT-registrations. And I have the same question as JokerJohn.
How can I evaluate my registration results ? An estimated covariance matrix would be great for postprocessing.

There is no implementation of AndreaCensis work (2007) (covariance estimation), right?

In the ndt_omp_impl.hpp file (l: 935) is a function called calculateScore(). Is this the same implementation as the ndt score function of Magnusson2009 (negative logarithmic likelihood function) ?

@koide3
Copy link
Owner

koide3 commented Oct 6, 2021

There is no implementation of AndreaCensis work (2007) (covariance estimation), right?

No, I didn't implement Censi's method and haven't seen any open source implementation of it. If you want to implement it you can find the Hessian at the following line. You would need a slight modification to access to it though.

Eigen::Matrix<double, 6, 6> hessian;

In the ndt_omp_impl.hpp file (l: 935) is a function called calculateScore(). Is this the same implementation as the ndt score function of Magnusson2009 (negative logarithmic likelihood function) ?

Yes, it is the negative log likelihood defined in Magnusson2009. But, in my experience, it didn't help to assess the registration result because it got often small for corrupted registration results.

@idref
Copy link

idref commented Oct 11, 2021

Hey koide3,
thank you for your fast reply.

No, I didn't implement Censi's method and haven't seen any open source implementation of it. If you want to implement it you can find the Hessian at the following line. You would need a slight modification to access to it though.

Good to know you haven't found an implementation of Censi's work either. I found the hessian but what do you mean with "a slight modification to access to it"? What would be the best solution to access the hessian in your opinion? Something like getter-method or a global access?

Yes, it is the negative log likelihood defined in Magnusson2009. But, in my experience, it didn't help to assess the registration result because it got often small for corrupted registration results.

Alright - thanks for the information. I know it's not the best reference but I would like to include this score in a comparison.

@idref
Copy link

idref commented Oct 29, 2021

Hey koide3,
i wrote a getter-method for the last hessian after transformation.
I set the last lastHessianSeen ( lastHessianSeen = hessian;) under the folowing line.

trans_probability_ = score / static_cast<double> (input_->points.size ());

Is this is the right place to take off the Hessian?

When i invert the hessian matrix and calculate the eigenvalues with
// take the inverse
h = h.inverse();

// calculate eigenvalues

typedef Eigen::EigenSolver<Eigen::Matrix<double,6,6>> ESolv;
ESolv solver;
solver.compute(h);
ESolv::EigenvalueType eigenValues = solver.eigenvalues();

All six eigenvalues are negative. Can you give me a hint why this is so or whether i can simply use the absolute vlaue of the eigenvalues with
eigenValues = eigenValues.cwiseAbs();
The problem is that with Magnusson2009, the root of the largest eigenvalue is used to evaluate the registration quality. This is difficult with negative eigenvalues.

many thanks in advance

@koide3
Copy link
Owner

koide3 commented Nov 2, 2021

Hi @idref ,

Is this is the right place to take off the Hessian?

Yes, I think it's a correct place to get the final Hessian.

All six eigenvalues are negative. Can you give me a hint why this is so or whether i can simply use the absolute vlaue of the eigenvalues with

If I remember correctly, this NDT implementation does maximization rather than minimization. If so, it's ok that the eigenvalues of the Hessian are negative. If you need only the magnitude of the largest eigenvalue, I think you can just take an absolute.

koide3 pushed a commit that referenced this issue May 4, 2024
Needed so that `CMakeLists.txt` can access the `$ROS_VERSION` environment variable in the ROS buildfarm

Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
koide3 added a commit that referenced this issue May 4, 2024
build(ndt_omp): add ros_environment dependency (#20)
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

3 participants