xioTechnologies/Fusion

How to use the magnetometer data with different sampling frequency from the inertial sensors?

Closed this issue · 1 comments

Hi, I'm using the x-IMU3, and the magnetometer sampling frequency is only 20 Hz. I tried to interpolate, but it doesn't work well. Is there any suggestion using magnetometer data for the Fusion algorithm? Thank you!

You should call update for each new gyroscope measurement. For many IMUs, including the x-IMU3, the magnetometer measurements will be out of phase or at a lower sample rate relative to the gyroscope. This is not a problem. For real-time systems, you should use the most recent magnetometer measurement for each update. For post processing, it is convenient to interpolate the magnetometer measurements so that all measurements vectors are of the same length. For example, this can be done in Python using scipy.interpolate.interp1d with kind="previous". More complex interpolation techniques (linear, quadratic, etc.) are unlikely to provide any practical benefit because the angular error associated with the measurement phrase error is typically extremely small.