Adaptive compass calibration based on local field conditions
Disclosed is a system and method for calibrating a magnetometer. The method comprises responsive to a determination that a magnetic inclination is less than a threshold, measuring first magnetic field data by detecting a magnetic field with the magnetometer through a first rotation path, measuring second magnetic field data by detecting the magnetic field with the magnetometer through a second rotation path, and determining calibration values for the magnetometer based on the measured first magnetic field data and the measured second magnetic field data.
1. A method for calibrating a magnetometer, the method comprising:
responsive to a determination that a magnetic inclination is less than a threshold:
measuring first magnetic field data by detecting a magnetic field with the magnetometer through a first rotation path;
measuring second magnetic field data by detecting the magnetic field with the magnetometer through a second rotation path; and
determining calibration values for the magnetometer based on the measured first magnetic field data and the measured second magnetic field data.
2. The method of claim 1 , further comprising:
responsive to a determination that the magnetic inclination is greater than the threshold:
measuring third magnetic field data by detecting the magnetic field with the magnetometer through a third rotation path;
measuring fourth magnetic field data by detecting the magnetic field with the magnetometer through a fourth rotation path; and
determining calibration values for the magnetometer based on the measured third magnetic field data and the measured fourth magnetic field data.
3. The method of claim 1 , further comprising:
determining a position with a global navigation satellite system receiver; and
determining the magnetic inclination based on the determined position.
4. The method of claim 1 , wherein determining whether the magnetic inclination is less than the threshold comprises:
determining whether an absolute value of the magnetic inclination is less than the threshold.
5. The method of claim 1 , wherein measuring the first magnetic field data by detecting the magnetic field with the magnetometer through the first rotation path comprises:
associating data from the first magnetic field data with orientation data detected by an inertial measurement device.
6. The method of claim 1 , further comprising:
outputting, responsive to the determination that the magnetic inclination is less than the threshold, an indication to rotate the magnetometer through the first rotation path.
7. The method of claim 6 , wherein outputting the indication to rotate the magnetometer through the first rotation path comprises:
transmitting, to an output device through a wireless network, a command to display the indication on a screen of the output device.
8. A non-transitory computer-readable storage medium comprising computer program instructions to calibrate a magnetometer, wherein the computer program instructions, when executed by at least one computer processor, cause the computer processor to:
responsive to a determination that a magnetic inclination is less than a threshold:
measure first magnetic field data by detecting a magnetic field with the magnetometer through a first rotation path;
measure second magnetic field data by detecting the magnetic field with the magnetometer through a second rotation path; and
determine calibration values for the magnetometer based on the measured first magnetic field data and the measured second magnetic field data.
9. The non-transitory computer-readable storage medium of claim 8 , further comprising computer program instructions that when executed cause the computer processor to:
responsive to a determination that the magnetic inclination is greater than the threshold:
measure third magnetic field data by detecting the magnetic field with the magnetometer through a third rotation path;
measure fourth magnetic field data by detecting the magnetic field with the magnetometer through a fourth rotation path; and
determine calibration values for the magnetometer based on the measured third magnetic field data and the measured fourth magnetic field data.
10. The non-transitory computer-readable storage medium of claim 8 , further comprising computer program instructions that when executed cause the computer processor to:
determine a position with a global navigation satellite system receiver; and
determine the magnetic inclination based on the determined position.
11. The non-transitory computer-readable storage medium of claim 8 , wherein the instructions to determine whether the magnetic inclination is less than the threshold further comprise instructions to:
determine whether an absolute value of the magnetic inclination is less than the threshold.
12. The non-transitory computer-readable storage medium of claim 8 , wherein the instructions to measure the first magnetic field data by detecting the magnetic field with the magnetometer through the first rotation path further comprise instructions to:
associate data from the first magnetic field data with orientation data detected by an inertial measurement device.
13. The non-transitory computer-readable storage medium of claim 8 , further comprising computer program instructions that when executed cause the computer processor to:
output, responsive to the determination that the magnetic inclination is less than the threshold, an indication to rotate the magnetometer through the first rotation path.
14. The non-transitory computer-readable storage medium of claim 13 , wherein the instructions to output the indication to rotate the magnetometer through the first rotation path further comprise instructions to:
transmit, to an output device through a wireless network, a command to display the indication on a screen of the output device.
15. A device, comprising:
a magnetometer;
a processor, the processor configured to execute instructions to:
responsive to a determination that a magnetic inclination is less than a threshold:
measure first magnetic field data by detecting a magnetic field with the magnetometer through a first rotation path;
measure second magnetic field data by detecting the magnetic field with the magnetometer through a second rotation path; and
determine calibration values for the magnetometer based on the measured first magnetic field data and the measured second magnetic field data.
16. The device of claim 15 , wherein the instructions further comprise instructions to:
responsive to a determination that the magnetic inclination is greater than the threshold:
measure third magnetic field data by detecting the magnetic field with the magnetometer through a third rotation path;
measure fourth magnetic field data by detecting the magnetic field with the magnetometer through a fourth rotation path; and
determine calibration values for the magnetometer based on the measured third magnetic field data and the measured fourth magnetic field data.
17. The device of claim 15 , further comprising:
a global navigation satellite system receiver to determine a position of the device, wherein the magnetic inclination is determined based on the determined position.
18. The device of claim 15 , wherein the instructions to determine whether the magnetic inclination is less than the threshold further comprise instructions to:
determine whether an absolute value of the magnetic inclination is less than the threshold.
19. The device of claim 15 , further comprising:
an inertial measurement device, wherein the instructions to measure the first magnetic field data by detecting the magnetic field with the magnetometer through the first rotation path further comprise instructions to:
associate data from the first magnetic field data with orientation data detected by the inertial measurement device.
20. The device of claim 15 , wherein the instructions further comprise instructions to:
transmit, responsive to the determination that the magnetic inclination is less than the threshold, through a wireless network, to an output device with a screen, a command to display on the screen an indication to rotate the magnetometer through the first rotation path.