Imu with magnetometer, read absolute position
I'm using Xsens Mti-300 with AHRS in order to get information about the current heading of my robot.
I wrote a ROS Node in C++ that is able to convert the quaternion to YAW angle in degrees and it works fine since I can correctly read the yaw angle while I rotate the robot in any direction and the readings are accurate since it gives the same yaw value when I come back to known positions.
For example, when I power on the system, the initial position is +100°, then if I rotate the robot randomly and I come back to the initial position, I can read again +100°, so it works very fine.
The problem is that if I power off the system and I start it again, the readings from the magnetometers change.
It's like if the IMU get a new heading values every time I power it on while I would like to get absolute positions.
Is there a way to solve this problem?