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

Levenberg-Marquardt fitting for sensor calibration #18882

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NicolasM0
Copy link
Contributor

This PR aims to add a new Levenberg-Marquardt fitting for sensor calibration. It optimizes scales and offsets (without off-diagonals). It could be used for accel calibration as discussed here #18166.

As a first step, the existing code is factorized.
and then a new fitting ("ortogonal_ellipsoid") is added.

This is a draft and it can certainly be improved. I am not sure how to make it cleaner. I could define an "algorithm" class from which each specific algorithm can inherit.

Not tested much for now but I have done 3 mag calibrations: one with the actual code, one with my new implementation (should have the same results but as input data are not the same...), and one with the new orthogonal_ellipsoid method (not aimed to be used for mag calibration but just to see if it works).

  actual new orthogonal_ellipsoid
CAL_MAG0_XODIAG 0.001 -0.003 0.000
CAL_MAG0_XOFF 0.017 0.012 0.014
CAL_MAG0_XSCALE 1.011 0.999 1.003
CAL_MAG0_YODIAG -0.014 0.001 0.000
CAL_MAG0_YOFF -0.042 -0.043 -0.051
CAL_MAG0_YSCALE 0.981 0.983 0.974
CAL_MAG0_ZODIAG 0.088 0.078 0.000
CAL_MAG0_ZOFF -0.179 -0.187 -0.178
CAL_MAG0_ZSCALE 0.984 1.042 1.016

@NicolasM0 NicolasM0 marked this pull request as ready for review December 20, 2021 16:15
@NicolasM0 NicolasM0 marked this pull request as draft December 20, 2021 16:18
@dagar dagar requested review from dagar and bresch December 20, 2021 16:56
@dagar
Copy link
Member

dagar commented Dec 20, 2021

Once this settles I'll go back and update/finish #18166.

@julianoes julianoes changed the title Pr lm fit Levenberg-Marquardt fitting for sensor calibration Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants