ellipsoid_fit_python
ellipsoid_fit_python copied to clipboard
Using data from get_calibration_ellipsoid.py
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
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 https://github.com/aleksandrbazhin/ellipsoid_fit_python/blob/0366607584df22d68a399cd3d954cb8ccbaef94d/plot_ellipsoid.py#L23
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
https://github.com/aleksandrbazhin/ellipsoid_fit_python/blob/0366607584df22d68a399cd3d954cb8ccbaef94d/plot_ellipsoid.py#L23
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.
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.