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

Using data from get_calibration_ellipsoid.py #13

Open
fe64970103 opened this issue Sep 29, 2021 · 3 comments
Open

Using data from get_calibration_ellipsoid.py #13

fe64970103 opened this issue Sep 29, 2021 · 3 comments
Labels

Comments

@fe64970103
Copy link

Hello.

First thank you for the great work. It's been a while past my university graduation and I'm having issues with the matrices and all the math stuff. Anyway I?m trying to make sense of all of it.

One dumb question. Once I generate the ellipsoid parameters with get_calibration_ellipsoid.py, how do I then apply those parameters to real-time incoming data from a sensor? Can you add that example too?

Thanks, Marko

@aleksandrbazhin
Copy link
Owner

Thank you for kind words. It's been a while for me too.
As far as I remember the example is already there - the calibrated data is the data projected onto the sphere. I think, it's this line

data_on_sphere = TR.dot(data_centered_regularized.T).T

@zrafa
Copy link

zrafa commented Mar 16, 2024

Thank you for kind words. It's been a while for me too. As far as I remember the example is already there - the calibrated data is the data projected onto the sphere. I think, it's this line

data_on_sphere = TR.dot(data_centered_regularized.T).T

I think that Marko asks for an example in real-time. For example, when you are getting raw data from magnetometer, how do you use the [center, radii, evecs, Coefficients, etc] which get_calibration_ellipsoid showed you, for correcting every [x,y,z] which you are getting from magnetometer?. That example he wants I think.

@aleksandrbazhin
Copy link
Owner

aleksandrbazhin commented Mar 16, 2024

Yeah maybe it's not obvious enough. If anyone will read this, I think what you need is to save the output of ellipsoid_fit() or transformation (TR and center) on calibration, and when you receive new data, do something like

calibrated_data = TR.dot(data - center)

assuming data has [x, y, z] column vectors. Other transposes and stuff are specific to plotting, so add those when you need.
I think the transformation matrix TR obtained that way does not account for translation, that's why center is needed.
Unfortunately I can not verify or test it right - I do not have a development setup, and haven't touched the field for more than several years at that point. The code was just a snippet I thought can be useful when I worked on it.
If I am not correct - fix me.

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

3 participants