I got one MPU9150 IMU sensor and plan to use the magnetometer data to estimate my vehicle's heading. I have learnt that the full range of the readings is ±1200μT. My questions are:
- Have the 3 readings Mag_x, Mag_y and Mag_z been converted into horizontal plane? If so, can I directly get vehicle's heading by calculating arctan(Mag_y, Mag_x)?
If no, does the 3 readings lie in Earth's magnetic field? Thus I can convert them to horizontal plane axis: H1 and H2 by H1=Mag_x*cos(theta)+Mag_y*sin(phi)*sin(theta)+Mag_z*cos(phi)*sin(theta) and H2=Mag_y*cos(phi)-Mag_z*sin(phi)
- In addition, does the magnetometer suffer drifts like accelerometer and gyro such that I need develop a filter for it?
Thanks for your help.