CN107421523B - Azimuth angle calibration method and device, storage medium and computer equipment - Google Patents

Azimuth angle calibration method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN107421523B
CN107421523B CN201710466099.8A CN201710466099A CN107421523B CN 107421523 B CN107421523 B CN 107421523B CN 201710466099 A CN201710466099 A CN 201710466099A CN 107421523 B CN107421523 B CN 107421523B
Authority
CN
China
Prior art keywords
magnetic field
field vector
azimuth angle
angle
azimuth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710466099.8A
Other languages
Chinese (zh)
Other versions
CN107421523A (en
Inventor
邱长平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oneplus Technology Shenzhen Co Ltd
Original Assignee
Oneplus Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oneplus Technology Shenzhen Co Ltd filed Critical Oneplus Technology Shenzhen Co Ltd
Priority to CN201710466099.8A priority Critical patent/CN107421523B/en
Publication of CN107421523A publication Critical patent/CN107421523A/en
Priority to PCT/CN2018/091821 priority patent/WO2018233601A1/en
Application granted granted Critical
Publication of CN107421523B publication Critical patent/CN107421523B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C17/00Compasses; Devices for ascertaining true or magnetic north for navigation or surveying purposes
    • G01C17/38Testing, calibrating, or compensating of compasses

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring Magnetic Variables (AREA)

Abstract

The invention relates to an azimuth angle calibration method, an azimuth angle calibration device, a storage medium and computer equipment. The method comprises the following steps: acquiring a magnetic field vector detected by a magnetic sensor; acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity; detecting a current rotational angular velocity; determining a compensation angle according to the current rotation angular velocity; and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle. The initial azimuth angle can be obtained according to the obtained magnetic field vector and the corresponding magnetic field intensity, and under the condition that the magnetic field vector is not analyzed in detail, the accurate initial azimuth angle is obtained, so that the efficiency of obtaining the initial azimuth angle is improved. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.

Description

Azimuth angle calibration method and device, storage medium and computer equipment
Technical Field
The invention relates to the technical field of electronic compasses, in particular to an azimuth angle calibration method, an azimuth angle calibration device, a storage medium and computer equipment.
Background
At present, because a magnetic sensor is easily influenced by a nearby magnetic field, the acquired azimuth angle is inaccurate. In general, a nearby magnetic field is analyzed in detail to obtain the interference condition of the magnetic field, and then an accurate azimuth angle is obtained according to the interference condition of the magnetic field.
However, the current azimuthal calibration is inefficient because of the complex calculations required to analyze the magnetic field in detail.
Disclosure of Invention
Therefore, it is necessary to provide an azimuth calibration method, an apparatus, a storage medium, and a computer device for solving the problems of tedious processing procedure and low efficiency of azimuth calibration.
An azimuth calibration method, comprising:
acquiring a magnetic field vector detected by a magnetic sensor;
acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity;
detecting a current rotational angular velocity;
determining a compensation angle according to the current rotation angular velocity;
and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
In one embodiment, the obtaining an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength includes:
acquiring a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope;
acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and by combining the gravity vector and/or the rotation angular velocity detected by the gyroscope;
and selecting an initial azimuth angle meeting the high-precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
In an embodiment, the selecting an initial azimuth angle satisfying a high precision value according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector includes:
detecting the current magnetic field strength of the magnetic field vector;
saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector;
determining the precision value of the azimuth angle according to the current magnetic field strength;
judging whether the precision value of the azimuth angle is a high precision value or not;
if so, selecting the azimuth as an initial azimuth;
if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
In one embodiment, the obtaining of the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotation angular velocity detected by the gyroscope includes:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, the obtaining an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or a rotation angular velocity detected by the gyroscope further includes:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, the performing azimuth calibration according to the compensation angle and the initial azimuth comprises:
and adding the compensation angle to the initial azimuth angle to obtain a calibrated azimuth angle.
An azimuth calibration device, comprising:
the sensor module is used for acquiring a magnetic field vector detected by the magnetic sensor;
the azimuth angle module is used for acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity;
the sensor module is also used for detecting the current rotation angular velocity;
a compensation angle module for determining a compensation angle according to the current rotation angular velocity;
and the calibration module is used for carrying out azimuth calibration according to the compensation angle and the initial azimuth.
In one embodiment, the sensor module is further configured to acquire a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope;
the azimuth angle module is further configured to obtain an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope;
the device further comprises:
and the precision value module is used for selecting an initial azimuth angle meeting the high precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
In one embodiment, the sensor module comprises:
the magnetic field module is used for decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
the gravity module is used for decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane;
the azimuth angle module is further configured to calibrate magnetic field vector scores in two axial directions perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle, so as to obtain magnetic field vector scores in two axial directions perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
A storage medium having stored thereon computer readable instructions which, when executed by a processor, cause the processor to perform the steps of:
acquiring a magnetic field vector detected by a magnetic sensor;
acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity;
detecting a current rotational angular velocity;
determining a compensation angle according to the current rotation angular velocity;
and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
In one embodiment, when performing the step of obtaining an initial azimuth angle corresponding to the magnetic field vector based on the magnetic field vector and corresponding magnetic field strength, the computer readable instructions further cause the processor to perform the steps of:
acquiring a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope;
acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and by combining the gravity vector and/or the rotation angular velocity detected by the gyroscope;
and selecting an initial azimuth angle meeting the high-precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
In one embodiment, when the step of selecting an initial azimuth angle satisfying a high accuracy value based on the magnetic field strength and the azimuth angle corresponding to the magnetic field vector is performed, the computer readable instructions further cause the processor to perform the steps of:
detecting the current magnetic field strength of the magnetic field vector;
saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector;
determining the precision value of the azimuth angle according to the current magnetic field strength;
judging whether the precision value of the azimuth angle is a high precision value or not;
if so, selecting the azimuth as an initial azimuth;
if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
In one embodiment, when the step of obtaining the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope is performed, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, when the step of obtaining the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope is performed, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of:
acquiring a magnetic field vector detected by a magnetic sensor;
acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity;
detecting a current rotational angular velocity;
determining a compensation angle according to the current rotation angular velocity;
and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
In one embodiment, when performing the step of obtaining an initial azimuth angle corresponding to the magnetic field vector based on the magnetic field vector and corresponding magnetic field strength, the computer readable instructions further cause the processor to perform the steps of:
acquiring a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope;
acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and by combining the gravity vector and/or the rotation angular velocity detected by the gyroscope;
and selecting an initial azimuth angle meeting the high-precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
In one embodiment, when the step of selecting an initial azimuth angle satisfying a high accuracy value based on the magnetic field strength and the azimuth angle corresponding to the magnetic field vector is performed, the computer readable instructions further cause the processor to perform the steps of:
detecting the current magnetic field strength of the magnetic field vector;
saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector;
determining the precision value of the azimuth angle according to the current magnetic field strength;
judging whether the precision value of the azimuth angle is a high precision value or not;
if so, selecting the azimuth as an initial azimuth;
if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
In one embodiment, when the step of obtaining the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope is performed, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, when the step of obtaining the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope is performed, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
According to the azimuth angle calibration method, the azimuth angle calibration device, the storage medium and the computer equipment, the initial azimuth angle can be obtained according to the obtained magnetic field vector and the corresponding magnetic field intensity, the accurate initial azimuth angle is obtained under the condition that the magnetic field vector is not analyzed in detail, and the efficiency of obtaining the initial azimuth angle is improved. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
Drawings
Fig. 1 is an internal structural diagram of a mobile terminal to which an azimuth calibration method is applied in one embodiment;
FIG. 2 is a schematic flow chart of an exemplary method for azimuth calibration;
FIG. 3 is an axial schematic view of a mobile terminal at different pitch and roll angles in one embodiment;
FIG. 4 is a schematic flowchart of an azimuth calibration method according to another embodiment;
FIG. 5 is a flow chart illustrating an exemplary method of azimuth calibration;
FIG. 6 is a block diagram of an exemplary azimuth alignment apparatus;
FIG. 7 is a block diagram showing the structure of an azimuth calibrating device according to another embodiment;
FIG. 8 is a block diagram of an exemplary azimuth alignment apparatus.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is an internal structural diagram of a mobile terminal to which an azimuth calibration method is applied in one embodiment. As shown in fig. 1, the mobile terminal includes a processor, a nonvolatile storage medium, an internal memory, a magnetic sensor, an acceleration sensor, a gyroscope, and the like, which are connected through a system bus. The non-volatile storage medium of the mobile terminal stores an operating system and computer readable instructions for implementing an azimuth calibration method suitable for the mobile terminal. The processor of the mobile terminal is used to provide computing and control capabilities to support the operation of the entire mobile terminal. The internal memory of the mobile terminal provides an environment for the execution of computer-readable instructions in a non-volatile storage medium, wherein the computer-readable instructions are stored in the internal memory and when executed by the processor, the computer-readable instructions cause the processor to perform an azimuth calibration method.
The magnetic sensor of the mobile terminal is used for acquiring a magnetic field vector of the position where the mobile terminal is located and magnetic field vector components in three mutually perpendicular axial directions with the mobile terminal as an origin. The acceleration sensor of the mobile terminal is used for acquiring a gravity vector of the position of the mobile terminal and three gravity vector components in mutually perpendicular axial directions with the mobile terminal as an origin. The gyroscope of the mobile terminal is used for acquiring angular velocities of the mobile terminal in three mutually perpendicular axial directions with the mobile terminal as an origin during rotation motion of the mobile terminal. Those skilled in the art will appreciate that the architecture shown in fig. 1 is only a block diagram of a portion of the architecture associated with the subject application and does not constitute a limitation on the mobile terminal to which the subject application applies, and that a particular mobile terminal may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, as shown in FIG. 2, an azimuth calibration method is provided. The embodiment is mainly illustrated by applying the method to the mobile terminal in fig. 1. Referring to fig. 2, the azimuth calibration method specifically includes the following steps:
s202, a magnetic field vector detected by the magnetic sensor is acquired.
Among them, the magnetic Sensor (Mag Sensor) is a Sensor that can convert a change in magnetic property of a Sensor element caused by an external factor such as a magnetic field, a current, a stress strain, a temperature, or light into an electric signal. Therefore, the magnetic field vector detected by the magnetic sensor is easily interfered by the outside world, and the acquired magnetic field vector is inaccurate.
In one embodiment, a magnetic field vector detected by the magnetic sensor is analyzed to obtain a magnetic field disturbance parameter, and an azimuth angle obtained from the magnetic field vector is calibrated according to the magnetic field disturbance parameter.
The magnetic field interference parameter is a parameter that the external environment causes interference to the geomagnetic field, and the magnetic field interference parameter may be a magnetic field vector emitted by the strong magnet, or may be external conditions such as temperature, electric field, stress variation, light, and the like. And calibrating the azimuth angle obtained according to the magnetic field vector according to the magnetic field interference parameter, wherein the azimuth angle is the azimuth angle error caused by the magnetic field vector interference of the magnetic field interference parameter.
And S204, acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity.
The magnetic field vector is a vector obtained by the magnetic sensor detecting the magnetic field, and the magnetic field vector may include a magnetic field strength vector. The magnetic field strength corresponding to the magnetic field vector may include the magnetic field strength of the earth magnetic field, the magnetic field strength of a nearby strong magnet, the magnetic field strength generated by an alternating current, and the like. The initial azimuth angle may be an angle of the mobile terminal rotated clockwise from a true north direction on a horizontal plane.
S206, the current rotational angular velocity is detected.
Among them, a gyroscope (Gyro Sensor) is an angular motion detection device that can detect angular velocities of a mobile terminal in three mutually perpendicular axial directions. The angular velocity of rotation may be an angular velocity generated by the rotation of the mobile terminal in three mutually perpendicular axes, or may be an angular velocity in a fixed axis direction with respect to a horizontal plane.
In one embodiment, the acquisition gyroscope detects the angular velocities of the mobile terminal in three mutually perpendicular axial directions, and the angular velocity of the mobile terminal rotating on the horizontal plane is calculated according to the detected angular velocities in the three axial directions.
In one embodiment, the movement track of the mobile terminal is cooperatively obtained through an acceleration sensor and a gyroscope, and the movement track of the mobile terminal is analyzed to obtain the rotation angular velocity of the mobile terminal on a horizontal plane.
The acceleration sensor can detect the movement acceleration of the mobile terminal, and then obtains the movement speed, the movement distance and the like of the mobile terminal. The rotation angular velocity acquired by the gyroscope can be calibrated through the movement acceleration of the mobile terminal acquired by the acceleration sensor, and the like, so that the rotation angular velocity of the mobile terminal on the horizontal plane can be obtained.
And S208, determining a compensation angle according to the current rotation angular velocity.
The compensation angle is an angle of the mobile terminal rotating on the horizontal plane, and the angle of the mobile terminal rotating after the time, namely the compensation angle, can be obtained through the angular speed of the mobile terminal on the horizontal plane and the time consumed by the rotation.
In one embodiment, an instantaneous angular velocity of the mobile terminal at a preset time point is detected, an angular velocity at which the mobile terminal rotates is obtained from the detected instantaneous angular velocity, the obtained angular velocity is integrated, and an angle obtained by integrating the angular velocity is accumulated to obtain a compensation angle.
Wherein the time duration between two adjacent preset time points is fixed, which in a specific embodiment may be 100 ms. The angular velocity of the rotation of the mobile terminal is obtained according to the detected instantaneous angular velocity, which may be an average value of instantaneous angular velocities obtained according to two adjacent preset time points. And integrating the obtained angular velocity to obtain the rotation angle of the mobile terminal in the time length. And accumulating the rotating angles of the mobile terminal corresponding to a plurality of time lengths in a period of time to obtain the compensation angle of the mobile terminal in the period of time.
And S210, carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
And calibrating the initial azimuth angle according to the compensation angle generated when the mobile terminal rotates to obtain the calibrated azimuth angle.
In this embodiment, the initial azimuth angle may be obtained according to the obtained magnetic field vector and the corresponding magnetic field strength, and an accurate initial azimuth angle is obtained without performing detailed analysis on the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
In one embodiment, step S204 includes: acquiring a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope; acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and by combining the gravity vector and/or the rotation angular velocity detected by the gyroscope; and selecting an initial azimuth angle meeting the high-precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
Among them, the acceleration sensor (GSensor) is a sensor capable of measuring acceleration of the mobile terminal, and the acceleration of the mobile terminal includes acceleration due to gravity. The acceleration sensor can obtain the gravity vector components of the mobile terminal in three mutually perpendicular axial directions, and then the included angle between the plane where the mobile terminal is located and the horizontal plane is obtained according to the gravity vector components of the mobile terminal in the three mutually perpendicular axial directions.
The accuracy value is a parameter reflecting whether the initial azimuth is accurate or not, and the initial azimuth of the high accuracy value is the accurate azimuth.
In this embodiment, when the magnetic field interference near the mobile terminal is small, the azimuth angle is obtained by the parameters obtained by the acceleration sensor and/or the gyroscope in cooperation with the parameters obtained by the magnetic sensor, and the accurate initial azimuth angle is selected by the magnetic field strength and the azimuth angle corresponding to the magnetic field vector.
In one embodiment, selecting an initial azimuth angle satisfying a high accuracy value according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector comprises: detecting the current magnetic field intensity of the magnetic field vector; saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector; determining the precision value of the azimuth angle according to the current magnetic field intensity; judging whether the precision value of the azimuth angle is a high precision value or not; if so, selecting the azimuth as an initial azimuth; if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
The precision value is a parameter for judging whether the azimuth is accurate or not, the high precision value represents that the azimuth is accurate, and the low precision value represents that the azimuth is not accurate. The precision value of the azimuth angle can be obtained according to the magnetic field intensity of the magnetic field vector corresponding to the azimuth angle. And determining the accuracy value of the azimuth angle according to the current magnetic field strength, wherein the accuracy value of the azimuth angle can be determined according to the magnitude of the current magnetic field strength.
In one embodiment, the current magnetic field strength of the magnetic field vector is detected; presetting a storage time length, and storing the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector once every other storage time length; determining the precision value of the azimuth angle according to the current magnetic field intensity; judging whether the precision value of the azimuth angle is a high precision value or not; if so, selecting the azimuth as an initial azimuth; if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
In one embodiment, the azimuth angle corresponding to the current magnetic field strength of the magnetic field vector is saved; presetting a threshold value of the magnetic field intensity, and detecting whether the current magnetic field intensity of the magnetic field vector is greater than the threshold value; if yes, selecting an azimuth angle with the magnetic field intensity equal to the threshold value as an initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field intensity; if not, selecting the azimuth angle corresponding to the current magnetic field intensity as the initial azimuth angle.
In one embodiment, acquiring the corresponding azimuth angle of the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotation angular velocity detected by the gyroscope comprises:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located; decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane; calibrating magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle, and magnetic field vector values in two axial directions which are perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
Referring to fig. 3, a plane in which the mobile terminal is located is a plane in which a screen of the mobile terminal is located. Two axial directions which are perpendicular to each other on the plane where the mobile terminal is located are the right front and the right left of the mobile terminal when the screen of the mobile terminal faces upwards. The X-axis may be directly in front of the mobile terminal and the Y-axis may be directly to the left of the mobile terminal. The mobile terminal comprises a pitching angle and a roll angle relative to a horizontal plane, wherein the pitching angle is an included angle between an X axis and the horizontal plane, and the roll angle is an included angle between a Y axis and the horizontal plane.
The magnetic field vector scores in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located are calibrated according to the pitch angle and the roll angle, the magnetic field vector score in the X axis is calibrated according to the pitch angle, the score of the magnetic field vector score in the X axis on the horizontal plane is obtained, and the magnetic field vector score in the Y axis on the horizontal plane is calibrated according to the roll angle, so that the score of the magnetic field vector score in the Y axis on the horizontal plane is obtained.
And carrying out azimuth angle calibration according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane, and obtaining the azimuth angle corresponding to the magnetic field vector according to the arctangent values of the magnetic field vector values in the two axial directions which are perpendicular to each other on the horizontal plane.
In this embodiment, when the magnetic field interference near the mobile terminal is small, the magnetic field vector acquired by the magnetic sensor is calibrated through the gravity vector acquired by the acceleration sensor, and then the azimuth angle corresponding to the magnetic field vector is acquired according to the calibrated magnetic field vector, so that an accurate azimuth angle can be obtained.
In one embodiment, the step of obtaining the corresponding azimuth angle of the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotation angular velocity detected by the gyroscope comprises: decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located; obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity; calibrating magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle, and magnetic field vector values in two axial directions which are perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
Referring to fig. 3, the rotation angular velocity detected by the gyroscope is a fusion value of the rotation angular velocities of the gyroscope in the three axial directions. The rotation angular velocity detected by the gyroscope in a single axis is the angular velocity of the rotation in the plane of the other two mutually perpendicular axes when the axis is kept unchanged relative to the horizontal plane. That is, the roll angle is obtained from the angular velocity of X, Z shaft rotation when the Y-axis is kept constant with respect to the horizontal plane, and the roll angle is obtained from the angular velocity of Y, Z shaft rotation when the X-axis is kept constant with respect to the horizontal plane.
In this embodiment, when the magnetic field interference near the mobile terminal is small, the magnetic field vector acquired by the magnetic sensor is calibrated through the rotation angular velocity acquired by the gyroscope, and then the azimuth angle corresponding to the magnetic field vector is acquired according to the calibrated magnetic field vector, so that an accurate azimuth angle can be obtained.
In one embodiment, step S210 includes: and adding the compensation angle to the initial azimuth angle to obtain a calibrated azimuth angle.
Referring to fig. 3, the direction of the initial azimuthal rotation is, among others, clockwise from the north arrow to the projection of the X-axis of the mobile terminal on the horizontal plane. The north-pointing direction line is a connecting line from the position of the mobile terminal to the geographic north pole or the magnetic north pole, and the connecting line from the position of the mobile terminal to the magnetic north pole can be on a ray where a component of a magnetic field vector detected by the mobile terminal on a horizontal plane is located. The direction of the compensation angular rotation is the direction in which the mobile terminal rotates on the horizontal plane, and may be a clockwise direction or a counterclockwise direction. The size range of the initial azimuth angle is defined to be 0-360 degrees, the size range is 0-360 degrees when the rotation direction of the compensation angle is clockwise, and the size range is-360-0 degrees when the rotation direction of the compensation angle is anticlockwise.
In this embodiment, the corrected azimuth angle is more accurate by determining the direction and the magnitude of the compensation angle and the initial azimuth angle.
As shown in fig. 4, in one embodiment, there is provided an azimuth calibration method, comprising the steps of:
s402, a magnetic field vector detected by the magnetic sensor is acquired.
S404, detecting whether the magnetic field intensity of the magnetic field vector is larger than a threshold value.
When the magnetic field strength is greater than the threshold value, executing step S406; when the magnetic field strength is less than or equal to the threshold value, step S414 is performed.
And S406, acquiring an initial azimuth angle when the magnetic field intensity is equal to the threshold value.
S408, the rotation angular velocity currently detected by the gyroscope is acquired.
S410, a compensation angle is determined according to the currently detected rotational angular velocity.
And S412, carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
And S414, acquiring the gravity vector detected by the acceleration sensor and/or the rotation angular velocity detected by the gyroscope.
And S416, decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located.
And S418, decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to the horizontal plane.
And S420, calibrating magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located according to the pitch angle and the roll angle.
And S422, carrying out azimuth angle calibration according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
And S424, acquiring the rotation angle of the mobile terminal on the horizontal plane according to the rotation angular velocity.
And S426, calibrating the calibrated azimuth angle according to the rotation angle.
In this embodiment, the initial azimuth angle may be obtained according to the obtained magnetic field vector and the corresponding magnetic field strength, and an accurate initial azimuth angle is obtained without performing detailed analysis on the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
In one embodiment, as shown in fig. 5, an azimuth calibration method is provided for an azimuth calibration apparatus. Referring to fig. 5, the azimuth calibrating device includes: a sensor module 502, a calibration module 504, and an application module 506.
The sensor module 502 is configured to implement steps S502, S504, S506, and S508.
S502, the gyroscope acquires a rotational angular velocity.
And S504, the acceleration sensor acquires a gravity vector.
S506, the magnetic sensor acquires a magnetic field vector.
And S508, the azimuth sensor acquires an initial azimuth angle.
The azimuth sensor is a virtual sensor and is used for acquiring an initial azimuth angle according to a rotation angular velocity acquired by the gyroscope, a gravity vector acquired by the acceleration sensor and a magnetic field vector acquired by the magnetic sensor.
The calibration module 504 is configured to implement steps S510, S512, and S514.
And S510, judging whether the precision value of the acquired initial azimuth is a high-precision value.
If yes, the initial azimuth is taken as the calibrated azimuth, and step S516 is executed; if not, go to step S514.
And S512, acquiring a compensation angle according to the rotation angular velocity acquired by the gyroscope.
And S514, carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
And S516, outputting the calibrated azimuth angle to the application program.
The high-precision value is a parameter of the initial azimuth angle when the magnetic field intensity of the magnetic field vector is smaller than or equal to a threshold value, and correspondingly, the parameter of the initial azimuth angle when the magnetic field intensity of the magnetic field vector is higher than the threshold value is a low-precision value. The application program is computer readable instructions for applying the calibrated azimuth.
In this embodiment, the initial azimuth angle may be obtained according to the obtained magnetic field vector and the corresponding magnetic field strength, and an accurate initial azimuth angle is obtained without performing detailed analysis on the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
As shown in fig. 6, in one embodiment, there is provided an azimuth calibration device 600 comprising:
a sensor module 602, configured to acquire a magnetic field vector detected by a magnetic sensor; an azimuth module 604, configured to obtain an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength; a sensor module 602, further configured to detect a current rotation angular velocity; a compensation angle module 606 for determining a compensation angle based on the currently detected rotational angular velocity; and a calibration module 608 for performing azimuth calibration according to the compensation angle and the initial azimuth.
The azimuth angle calibration device 600 can acquire the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field intensity, and can acquire an accurate initial azimuth angle without detailed analysis on the magnetic field vector, thereby improving the efficiency of acquiring the initial azimuth angle. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
As shown in fig. 7, in an embodiment, the sensor module 602 is further configured to obtain a gravity vector detected by the acceleration sensor and/or a rotation angular velocity detected by the gyroscope; the azimuth angle module 604 is further configured to obtain an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope; the azimuth calibration device 600 further includes: and the precision value module 610 is configured to select an initial azimuth angle meeting a high precision value according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector.
As shown in fig. 8, in one embodiment, the sensor module 602 includes:
the magnetic field module 602a is configured to decompose a magnetic field vector to obtain magnetic field vector values in two axial directions perpendicular to each other on a plane where the mobile terminal is located; the gravity module 602b is configured to decompose a gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane; the azimuth angle module 604 is further configured to calibrate magnetic field vector scores in two axial directions perpendicular to each other on a plane where the mobile terminal is located, and magnetic field vector scores in two axial directions perpendicular to each other on a horizontal plane, according to the pitch angle and the roll angle; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
A storage medium having stored thereon computer readable instructions which, when executed by a processor, cause the processor to perform the steps of:
acquiring a magnetic field vector detected by a magnetic sensor; acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity; detecting a current rotational angular velocity; determining a compensation angle according to the current rotation angular velocity; and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
The storage medium can acquire the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field intensity, and can acquire an accurate initial azimuth angle without detailed analysis of the magnetic field vector, so that the efficiency of acquiring the initial azimuth angle is improved. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
In one embodiment, the computer readable instructions, when executing the step of obtaining an initial azimuth angle corresponding to the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength, further cause the processor to perform the steps of:
acquiring a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope; acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and by combining the gravity vector and/or the rotation angular velocity detected by the gyroscope; and selecting an initial azimuth angle meeting the high-precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
In one embodiment, when performing the step of selecting an initial azimuth angle satisfying a high accuracy value based on the magnetic field strength and the azimuth angle corresponding to the magnetic field vector, the computer readable instructions further cause the processor to perform the steps of:
detecting the current magnetic field intensity of the magnetic field vector; saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector;
determining the precision value of the azimuth angle according to the current magnetic field intensity; judging whether the precision value of the azimuth angle is a high precision value or not; if so, selecting the azimuth as an initial azimuth; if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
In one embodiment, when performing the step of obtaining the corresponding azimuth angle of the magnetic field vector based on the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located; decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane; calibrating magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, when performing the step of obtaining the corresponding azimuth angle of the magnetic field vector based on the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located; obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity; calibrating magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, when performing the step of performing azimuth calibration based on the compensation angle and the initial azimuth, the computer readable instructions further cause the processor to perform the steps of:
and adding the compensation angle to the initial azimuth angle to obtain a calibrated azimuth angle.
A computer device comprising a memory and a processor, the memory having computer-readable instructions stored therein which, when executed by the processor, cause the processor to perform the steps of:
acquiring a magnetic field vector detected by a magnetic sensor; acquiring an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field intensity; detecting a current rotational angular velocity; determining a compensation angle according to the current rotation angular velocity; and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
According to the computer equipment, the initial azimuth angle can be obtained according to the obtained magnetic field vector and the corresponding magnetic field intensity, the accurate initial azimuth angle is obtained under the condition that the magnetic field vector is not analyzed in detail, and the efficiency of obtaining the initial azimuth angle is improved. The current rotation angular velocity of the mobile terminal can be obtained, the compensation angle is obtained, and the azimuth angle is calibrated through the compensation angle and the initial azimuth angle. Therefore, after the accurate initial azimuth angle is obtained, the azimuth angle is calibrated, and the efficiency of calibrating the azimuth angle is improved under the condition that the efficiency of obtaining the accurate initial azimuth angle is improved.
In one embodiment, the computer readable instructions, when executing the step of obtaining an initial azimuth angle corresponding to the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength, further cause the processor to perform the steps of:
acquiring a gravity vector detected by an acceleration sensor and/or a rotation angular velocity detected by a gyroscope; acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and by combining the gravity vector and/or the rotation angular velocity detected by the gyroscope; and selecting an initial azimuth angle meeting the high-precision value according to the magnetic field intensity and the azimuth angle corresponding to the magnetic field vector.
In one embodiment, when performing the step of selecting an initial azimuth angle satisfying a high accuracy value based on the magnetic field strength and the azimuth angle corresponding to the magnetic field vector, the computer readable instructions further cause the processor to perform the steps of:
detecting the current magnetic field intensity of the magnetic field vector; saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector; determining the precision value of the azimuth angle according to the current magnetic field intensity; judging whether the precision value of the azimuth angle is a high precision value or not; if so, selecting the azimuth as an initial azimuth; if not, selecting the azimuth angle with high precision value as the initial azimuth angle from the stored azimuth angles corresponding to the historical magnetic field strength.
In one embodiment, when performing the step of obtaining the corresponding azimuth angle of the magnetic field vector based on the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located; decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane; calibrating magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, when performing the step of obtaining the corresponding azimuth angle of the magnetic field vector based on the magnetic field vector in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope, the computer readable instructions further cause the processor to perform the steps of:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on the plane where the mobile terminal is located; obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity; calibrating magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
In one embodiment, when performing the step of performing azimuth calibration based on the compensation angle and the initial azimuth, the computer readable instructions further cause the processor to perform the steps of:
and adding the compensation angle to the initial azimuth angle to obtain a calibrated azimuth angle.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An azimuth calibration method, comprising:
acquiring a magnetic field vector detected by a magnetic sensor;
acquiring a rotation angular velocity detected by a gyroscope;
obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity; acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the pitch angle and the roll angle; detecting whether the current magnetic field strength of the magnetic field vector is greater than a threshold value; if yes, selecting the azimuth angle with the magnetic field intensity equal to the threshold value from the stored azimuth angles corresponding to the historical magnetic field intensity as an initial azimuth angle; if not, selecting the azimuth angle corresponding to the magnetic field vector as an initial azimuth angle;
detecting a current rotational angular velocity;
determining a compensation angle according to the current rotation angular velocity;
and carrying out azimuth angle calibration according to the compensation angle and the initial azimuth angle.
2. The method according to claim 1, wherein the rotation angular velocity is a fusion value of rotation angular velocities of the gyroscope in three axial directions; the rotation angular velocity detected by the gyroscope in a single axis is the angular velocity of the rotation of the other two mutually perpendicular axes on the plane when the single axis is kept unchanged relative to the horizontal plane.
3. The method according to claim 2, wherein the obtaining of the pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane according to the rotation angular velocity comprises:
and acquiring a pitch angle according to the rotating angular speeds of the X axis and the Z axis when the Y axis is kept unchanged relative to the horizontal plane, and acquiring a roll angle according to the rotating angular speeds of the Y axis and the Z axis when the X axis is kept unchanged relative to the horizontal plane.
4. The method of claim 1, wherein prior to detecting whether the current magnetic field strength of the magnetic field vector is greater than a threshold value, the method further comprises:
saving the azimuth angle corresponding to the current magnetic field intensity of the magnetic field vector;
the threshold value of the magnetic field strength is preset.
5. The method of claim 1, wherein obtaining the corresponding azimuth angle of the magnetic field vector according to the magnetic field vector and the pitch and roll angles further comprises:
decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
calibrating magnetic field vector values in two mutually perpendicular axial directions on a plane where the mobile terminal is located according to the pitch angle and the roll angle to obtain magnetic field vector values in two mutually perpendicular axial directions on a horizontal plane;
and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
6. The method of any of claims 1 to 4, said performing an azimuth calibration based on said compensation angle and said initial azimuth, comprising:
and adding the compensation angle to the initial azimuth angle to obtain a calibrated azimuth angle.
7. An azimuth calibration device, comprising:
the sensor module is used for acquiring a magnetic field vector detected by the magnetic sensor;
the sensor module acquires a rotation angular velocity detected by a gyroscope;
the azimuth angle module is used for obtaining a pitch angle and a roll angle of the mobile terminal relative to a horizontal plane according to the rotation angular velocity; acquiring an azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the pitch angle and the roll angle; detecting whether the current magnetic field strength of the magnetic field vector is greater than a threshold value; if yes, selecting the azimuth angle with the magnetic field intensity equal to the threshold value from the stored azimuth angles corresponding to the historical magnetic field intensity as an initial azimuth angle; if not, selecting the azimuth angle corresponding to the magnetic field vector as an initial azimuth angle;
the sensor module is also used for detecting the current rotation angular velocity;
a compensation angle module for determining a compensation angle according to the current rotation angular velocity;
and the calibration module is used for carrying out azimuth calibration according to the compensation angle and the initial azimuth.
8. The apparatus of claim 7, wherein the sensor module comprises:
the magnetic field module is used for decomposing the magnetic field vector to obtain magnetic field vector values in two axial directions which are perpendicular to each other on a plane where the mobile terminal is located;
the azimuth angle module is further configured to calibrate magnetic field vector scores in two axial directions perpendicular to each other on a plane where the mobile terminal is located according to the pitch angle and the roll angle, so as to obtain magnetic field vector scores in two axial directions perpendicular to each other on a horizontal plane; and acquiring the azimuth angle corresponding to the magnetic field vector according to the magnetic field vector values in two axial directions which are perpendicular to each other on the horizontal plane.
9. A storage medium having stored thereon computer readable instructions which, when executed by a processor, cause the processor to perform the steps of the method of any one of claims 1 to 5.
10. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of the method of any one of claims 1 to 5.
CN201710466099.8A 2017-06-19 2017-06-19 Azimuth angle calibration method and device, storage medium and computer equipment Active CN107421523B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710466099.8A CN107421523B (en) 2017-06-19 2017-06-19 Azimuth angle calibration method and device, storage medium and computer equipment
PCT/CN2018/091821 WO2018233601A1 (en) 2017-06-19 2018-06-19 Azimuth calibration method and apparatus, storage medium and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710466099.8A CN107421523B (en) 2017-06-19 2017-06-19 Azimuth angle calibration method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN107421523A CN107421523A (en) 2017-12-01
CN107421523B true CN107421523B (en) 2021-05-28

Family

ID=60428086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710466099.8A Active CN107421523B (en) 2017-06-19 2017-06-19 Azimuth angle calibration method and device, storage medium and computer equipment

Country Status (2)

Country Link
CN (1) CN107421523B (en)
WO (1) WO2018233601A1 (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107421523B (en) * 2017-06-19 2021-05-28 深圳市万普拉斯科技有限公司 Azimuth angle calibration method and device, storage medium and computer equipment
CN108109394B (en) * 2017-12-07 2020-09-29 重庆交通大学 System and method for detecting traffic parameters of single geomagnetic vehicle based on vector model
WO2020019260A1 (en) * 2018-07-26 2020-01-30 深圳市大疆创新科技有限公司 Calibration method for magnetic sensor, control terminal and movable platform
CN109257506B (en) * 2018-11-19 2021-04-09 Oppo(重庆)智能科技有限公司 Method for adjusting screen brightness, mobile terminal and storage medium
CN109561393B (en) * 2018-12-24 2021-01-26 北京全电智领科技有限公司 Low-speed carrier positioning method and device based on space optical communication technology
CN112098925B (en) * 2019-06-17 2024-03-08 群光电子股份有限公司 Electronic device, tracking system and tracking method
CN110514227A (en) * 2019-09-04 2019-11-29 惠州Tcl移动通信有限公司 Acquisition methods, mobile terminal and the storage medium of bearing data calibration parameter
CN113465286B (en) * 2020-07-14 2022-12-20 青岛海信电子产业控股股份有限公司 Intelligent refrigerator, angle determination and food material identification method
CN112525144B (en) * 2020-11-13 2023-03-21 恒鸿达科技有限公司 Nonlinear attitude detection compensation method and terminal
CN112945218A (en) * 2021-01-26 2021-06-11 北京小米移动软件有限公司 Method and device for determining direction of electronic equipment, electronic equipment and storage medium
CN113108772A (en) * 2021-03-29 2021-07-13 上海米度测量技术有限公司 Cantilever excavator measurement system
CN113865571A (en) * 2021-08-20 2021-12-31 无锡宇宁智能科技有限公司 Method and device for improving application precision of mobile phone compass and readable storage medium
CN114034318B (en) * 2021-11-23 2024-07-02 歌尔科技有限公司 Calibration control method, device and equipment for loudspeaker box and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1349109A (en) * 2000-10-16 2002-05-15 Ap第一体系有限公司 Three axial magnetic sensor, all direction magnetic sensor, and direction testing method therewith
CN1680780A (en) * 2004-02-04 2005-10-12 三星电子株式会社 Method and apparatus for determining a geomagnetic field by using a compass and method and apparatus for determining an azimuth angle of a moving object using the same
CN102620725A (en) * 2012-03-16 2012-08-01 惠州Tcl移动通信有限公司 Method for calibrating compasses of mobile devices
CN102693019A (en) * 2010-12-15 2012-09-26 索尼公司 Information processing device, information processing system and information processing method
CN103946670A (en) * 2011-11-01 2014-07-23 高通股份有限公司 System and method for improving orientation data

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08114454A (en) * 1994-08-29 1996-05-07 Yuseisho Tsushin Sogo Kenkyusho Method for measuring azimuth for automoble
US8620610B2 (en) * 2011-03-16 2013-12-31 Honeywell International Inc. Crane jib attitude and heading reference system and method
JP2013057601A (en) * 2011-09-08 2013-03-28 Sony Corp Electronic instrument and imaging apparatus
JP6191145B2 (en) * 2013-01-31 2017-09-06 ヤマハ株式会社 Offset estimation apparatus and program
US20150019159A1 (en) * 2013-07-15 2015-01-15 Honeywell International Inc. System and method for magnetometer calibration and compensation
CN107421523B (en) * 2017-06-19 2021-05-28 深圳市万普拉斯科技有限公司 Azimuth angle calibration method and device, storage medium and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1349109A (en) * 2000-10-16 2002-05-15 Ap第一体系有限公司 Three axial magnetic sensor, all direction magnetic sensor, and direction testing method therewith
CN1680780A (en) * 2004-02-04 2005-10-12 三星电子株式会社 Method and apparatus for determining a geomagnetic field by using a compass and method and apparatus for determining an azimuth angle of a moving object using the same
CN102693019A (en) * 2010-12-15 2012-09-26 索尼公司 Information processing device, information processing system and information processing method
CN103946670A (en) * 2011-11-01 2014-07-23 高通股份有限公司 System and method for improving orientation data
CN102620725A (en) * 2012-03-16 2012-08-01 惠州Tcl移动通信有限公司 Method for calibrating compasses of mobile devices

Also Published As

Publication number Publication date
WO2018233601A1 (en) 2018-12-27
CN107421523A (en) 2017-12-01

Similar Documents

Publication Publication Date Title
CN107421523B (en) Azimuth angle calibration method and device, storage medium and computer equipment
CN112577521B (en) Combined navigation error calibration method and electronic equipment
CN103941309B (en) Geomagnetic sensor calibrator (-ter) unit and its method
CN106840205B (en) Gyroscope calibration compensation method and device and virtual reality head-mounted equipment
WO2017064790A1 (en) Positioning device and positioning method
US8838403B2 (en) Method and system for a self-calibrated multi-magnetometer platform
CN110567491B (en) Initial alignment method and device of inertial navigation system and electronic equipment
CN107063254B (en) Gesture resolving method for gyros and geomagnetic combination
JP2006300880A (en) Inclination sensor, and azimuth measuring device using this
CN110319851B (en) Sensor correction method, device, equipment and storage medium
JP2016114603A (en) Method and system for processing gps drifting
US20190056239A1 (en) Method for calibration of gyro sensor using tilt sensor
JP2008224642A (en) Magnetic gyro
EP3091335B1 (en) Calibration of temperature effect on magnetometer
JP5678357B2 (en) Rotation information calculation method, rotation information calculation program, magnetic gyroscope and moving body
RU2407989C1 (en) Method for determining true azimuth with self-orienting gyroscopic system
El-Diasty An accurate heading solution using MEMS-based gyroscope and magnetometer integrated system (preliminary results)
WO2024003894A1 (en) Improved system, method and computer program product for north-finding
CN109297476B (en) Magnetometer calibration, sampling and azimuth determination methods and apparatus
CN110030991A (en) Merge the flying object high speed rotation angular movement measurement method of gyro and magnetometer
JP5125534B2 (en) Direction detection device and direction detection program
JP6818752B2 (en) Method and device to indicate direction
KR100735494B1 (en) Azimuth measurement device and azimuth measurement method
CN108897053B (en) Magnetic interference detection method and device based on equipment magnetic environment change
Tomaszewski et al. Analysis of the noise parameters and attitude alignment accuracy of INS conducted with the use of MEMS-based integrated navigation system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant