WO2018233601A1 - Azimuth calibration method and apparatus, storage medium and computer device - Google Patents

Azimuth calibration method and apparatus, storage medium and computer device Download PDF

Info

Publication number
WO2018233601A1
WO2018233601A1 PCT/CN2018/091821 CN2018091821W WO2018233601A1 WO 2018233601 A1 WO2018233601 A1 WO 2018233601A1 CN 2018091821 W CN2018091821 W CN 2018091821W WO 2018233601 A1 WO2018233601 A1 WO 2018233601A1
Authority
WO
WIPO (PCT)
Prior art keywords
magnetic field
azimuth
field vector
angle
vector
Prior art date
Application number
PCT/CN2018/091821
Other languages
French (fr)
Chinese (zh)
Inventor
邱长平
Original Assignee
深圳市万普拉斯科技有限公司
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 深圳市万普拉斯科技有限公司 filed Critical 深圳市万普拉斯科技有限公司
Publication of WO2018233601A1 publication Critical patent/WO2018233601A1/en

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

Definitions

  • the present invention relates to the field of electronic compass technology, and in particular to an azimuth calibration method, apparatus, storage medium and computer device.
  • the magnetic sensor is easily affected by the nearby magnetic field, resulting in an inaccurate azimuth.
  • the nearby magnetic field is analyzed in detail to obtain the interference of the magnetic field, and then the accurate azimuth is obtained according to the interference of the magnetic field.
  • the embodiment of the invention provides an azimuth calibration method, device, storage medium and computer device.
  • An azimuth calibration method includes:
  • Azimuth calibration is performed based on the compensation angle and the initial azimuth.
  • the obtaining the initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength comprises:
  • an initial azimuth angle that satisfies a high precision value is selected.
  • the initial azimuth angle that satisfies the high precision value is selected according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector, including:
  • the azimuth is selected as the initial azimuth
  • the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
  • the obtaining the azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope includes:
  • the azimuth angle corresponding to the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
  • the obtaining the azimuth 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 further includes:
  • the azimuth calibration is performed according to the compensation angle and the initial azimuth, including:
  • the initial azimuth is added to the compensation angle to obtain a calibrated azimuth.
  • An azimuth calibration device comprising:
  • a sensor module for acquiring a magnetic field vector detected by the magnetic sensor
  • An azimuth module configured to acquire an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength
  • the sensor module is further configured to detect a current rotational angular velocity
  • a compensation angle module configured to determine a compensation angle according to the current rotational angular velocity
  • a calibration module configured to perform azimuth calibration according to the compensation angle and the initial azimuth.
  • the sensor module is further configured to acquire a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
  • the azimuth module is further configured to acquire an azimuth 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 also includes:
  • the precision value module is configured to select an initial azimuth angle that satisfies a high precision value according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector.
  • the sensor module includes:
  • a magnetic field module for decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions perpendicular to each other on a plane where the mobile terminal is located;
  • a gravity module configured to decompose the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal with respect to a horizontal plane
  • the azimuth module is further configured to calibrate two axial magnetic field vector values perpendicular to each other on a plane of the mobile terminal according to the pitch angle and the roll angle, and obtain two axial directions perpendicular to each other on the horizontal plane.
  • the magnetic field vector score; the corresponding azimuth of the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
  • a storage medium characterized by storing computer readable instructions which, when executed by a processor, cause the processor to perform the following steps:
  • Azimuth calibration is performed based on the compensation angle and the initial azimuth.
  • the step of acquiring the initial azimuth corresponding to the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength further causing the processor to perform the following steps:
  • an initial azimuth angle that satisfies a high precision value is selected.
  • the computer readable instructions further cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies a high precision value based on a corresponding magnetic field strength and azimuth of the magnetic field vector :
  • the azimuth is selected as the initial azimuth
  • the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
  • the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope
  • the read instruction also causes the processor to perform the following steps:
  • the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope
  • the read instruction also causes the processor to perform the following steps:
  • a computer apparatus comprising: a memory and a processor, wherein the memory stores computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
  • Azimuth calibration is performed based on the compensation angle and the initial azimuth.
  • the step of acquiring the initial azimuth corresponding to the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength further causing the processor to perform the following steps:
  • an initial azimuth angle that satisfies a high precision value is selected.
  • the computer readable instructions further cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies a high precision value based on a corresponding magnetic field strength and azimuth of the magnetic field vector :
  • the azimuth is selected as the initial azimuth
  • the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
  • the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope
  • the read instruction also causes the processor to perform the following steps:
  • the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope
  • the read instruction also causes the processor to perform the following steps:
  • the azimuth calibration method, device, storage medium and computer device can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector. , improve the efficiency of obtaining the initial azimuth. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • 1 is an internal structural diagram of a mobile terminal applying an azimuth calibration method in an embodiment
  • FIG. 2 is a schematic flow chart of an azimuth calibration method in an embodiment
  • FIG. 3 is an axial schematic view showing different pitch angles and roll angles of the mobile terminal in one embodiment
  • FIG. 4 is a schematic flow chart of a method for azimuth calibration in another embodiment
  • FIG. 5 is a schematic flow chart of an azimuth calibration method in an embodiment
  • Figure 6 is a block diagram showing the structure of an azimuth calibration device in an embodiment
  • Figure 7 is a block diagram showing the structure of an azimuth calibration device in another embodiment
  • Figure 8 is a block diagram showing the structure of an azimuth calibration apparatus in one embodiment.
  • the mobile terminal includes a processor connected through a system bus, a nonvolatile storage medium, an internal memory, a magnetic sensor, an acceleration sensor, a gyroscope, and the like.
  • 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 operation of computer readable instructions in a non-volatile storage medium, and the internal memory can store computer readable instructions that, when executed by the processor, can The above processor performs an azimuth calibration method.
  • the magnetic sensor of the mobile terminal is used to acquire the magnetic field vector of the position where the mobile terminal is located, and the magnetic field vector components of the three mutually perpendicular axes with the mobile terminal as the origin.
  • the acceleration sensor of the mobile terminal is used to acquire the gravity vector of the position where the mobile terminal is located, and the gravity vector components in three mutually perpendicular axes with the mobile terminal as the origin.
  • the gyroscope of the mobile terminal is used to obtain angular velocities in three mutually perpendicular axial directions with the mobile terminal as the origin when the mobile terminal rotates.
  • the specific mobile terminal may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • an azimuth calibration method is provided.
  • the method is mainly applied to the mobile terminal in FIG. 1 described above for illustration.
  • the azimuth calibration method specifically includes the following steps:
  • the magnetic sensor (Mag Sensor) is a sensor that can convert magnetic properties of sensitive components into electrical signals by external factors such as magnetic field, current, stress strain, temperature, and light. Therefore, the magnetic field vector detected by the magnetic sensor is susceptible to external interference, resulting in an inaccurate magnetic field vector.
  • the magnetic field vector detected by the magnetic sensor is analyzed to obtain a magnetic field interference parameter, and the azimuth obtained from the magnetic field vector is calibrated based on the magnetic field interference parameter.
  • the magnetic field interference parameter is a parameter that the external environment causes interference to the earth magnetic field
  • the magnetic field interference parameter may be a magnetic field vector emitted by the strong magnet, or may be external temperature, electric field, stress change, light, and the like.
  • the azimuth obtained from the magnetic field vector is calibrated according to the magnetic field interference parameter, which is an azimuth error caused by the calibration magnetic field interference parameter to the magnetic field vector interference.
  • the magnetic field vector is a vector obtained by the magnetic sensor detecting the magnetic field
  • the magnetic field vector may include a magnetic field strength vector.
  • the corresponding magnetic field strength of the magnetic field vector may include the magnetic field strength of the earth magnetic field, and may also include the magnetic field strength of the nearby strong magnet and the magnetic field strength generated by the alternating current.
  • the initial azimuth may be an angle obtained by the mobile terminal rotating clockwise from the north direction on the horizontal plane.
  • the Gyro Sensor is an angular motion detecting device that can detect the angular velocity of the mobile terminal in three mutually perpendicular axial directions.
  • the angular velocity of rotation may be the angular velocity produced by the rotation of the mobile terminal in three mutually perpendicular axial directions, or may be the angular velocity in a fixed axial direction relative to the horizontal plane.
  • the acquisition gyroscope detects the angular velocity of the mobile terminal in three mutually perpendicular axes, and calculates the angular velocity of the mobile terminal to rotate on the horizontal plane based on the detected angular velocities in the three axial directions.
  • the movement trajectory of the mobile terminal is acquired by the acceleration sensor and the gyroscope, and the motion trajectory of the mobile terminal is analyzed, and the angular velocity of the rotation of the mobile terminal on the horizontal plane is obtained.
  • the acceleration sensor can detect the moving acceleration of the mobile terminal, thereby acquiring the moving speed and the moving distance of the mobile terminal.
  • the rotational angular velocity obtained by the gyroscope can be calibrated by the moving acceleration of the mobile terminal obtained by the acceleration sensor, etc., and the rotational angular velocity of the mobile terminal on the horizontal plane can be obtained.
  • the compensation angle is an angle at which the mobile terminal rotates on a horizontal plane.
  • the angle of rotation of the mobile terminal after the elapse of time that is, the compensation angle, can be obtained by the angular velocity of the mobile terminal on the horizontal plane and the time consumed by the rotation.
  • the instantaneous angular velocity of the mobile terminal at a preset time point is detected, the angular velocity of the rotation of the mobile terminal is obtained according to the detected instantaneous angular velocity, the obtained angular velocity is integrated, and the angle obtained by integrating the angular velocity is accumulated, Get the compensation angle.
  • the duration between two adjacent preset time points is fixed, and in a specific embodiment, the duration may be 100 ms.
  • Obtaining the angular velocity of the rotation of the mobile terminal according to the detected instantaneous angular velocity may be an angular velocity of the rotation of the mobile terminal according to an average value of the instantaneous angular velocities acquired at two adjacent preset time points.
  • the angular velocity obtained is integrated to obtain the angle at which the mobile terminal rotates within the above duration.
  • the compensation angle of the mobile terminal during this period is obtained by accumulating the angles of the rotations of the mobile terminals corresponding to the plurality of durations in a period of time.
  • the azimuth calibration according to the compensation angle and the initial azimuth is to calibrate the initial azimuth according to the compensation angle generated when the mobile terminal rotates, and obtain the azimuth after calibration.
  • the initial azimuth angle can be obtained according to the acquired magnetic field vector and the corresponding magnetic field strength, and the accurate initial azimuth angle can be obtained without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle.
  • the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • step S204 includes: acquiring a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope; acquiring the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope Corresponding azimuth; according to the corresponding magnetic field strength and azimuth of the magnetic field vector, the initial azimuth angle satisfying the high precision value is selected.
  • the acceleration sensor is a sensor capable of measuring the acceleration of the mobile terminal, and the acceleration of the mobile terminal includes the acceleration of gravity.
  • the acceleration sensor can acquire the gravity vector component of the mobile terminal in three mutually perpendicular axial directions, and then obtain the angle between the plane of the mobile terminal and the horizontal plane according to the gravity vector component of the mobile terminal in three mutually perpendicular axial directions.
  • the accuracy value is a parameter that reflects whether the initial azimuth is accurate.
  • the initial azimuth of the high-precision value is the precise azimuth.
  • the parameters acquired by the acceleration sensor and/or the gyroscope cooperate with the parameters acquired by the magnetic sensor to obtain the azimuth angle, and also the magnetic field strength and azimuth corresponding to the magnetic field vector. , select the precise initial azimuth.
  • the initial azimuth angle satisfying the high precision value is selected according to the corresponding magnetic field strength and azimuth of the magnetic field vector, including: detecting the current magnetic field strength of the magnetic field vector; and maintaining the azimuth corresponding to the current magnetic field strength of the magnetic field vector; Intensity, determining the accuracy value of the azimuth; determining whether the accuracy value of the azimuth is a high-precision value; if so, selecting the azimuth as the initial azimuth; if not, from the azimuth corresponding to the saved historical magnetic field strength , select the azimuth of the high-precision value as the initial azimuth.
  • the precision value is a parameter for judging whether the azimuth is accurate, the high precision value indicates that the azimuth angle is accurate, and the relative low precision value indicates that the azimuth angle is not accurate.
  • the accuracy value of the azimuth can be obtained from the magnetic field strength of the corresponding magnetic field vector of the azimuth.
  • the accuracy value of the azimuth is determined according to the current magnetic field strength, and the accuracy value of the azimuth may be determined according to the current magnetic field strength.
  • the current magnetic field strength of the magnetic field vector is detected; the storage duration is preset, and the azimuth corresponding to the current magnetic field strength of the magnetic field vector is saved once every interval of storage; the accuracy value of the azimuth is determined according to the current magnetic field strength; Whether the angle precision value is a high-precision value; if yes, the azimuth angle is selected as the initial azimuth angle; if not, the azimuth angle of the high-precision value is selected as the initial orientation from the azimuth angle corresponding to the saved historical magnetic field strength angle.
  • the azimuth corresponding to the current magnetic field strength of the magnetic field vector is saved; the threshold of the magnetic field strength is preset, and the current magnetic field strength of the magnetic field vector is detected to be greater than a threshold; if so, from the azimuth corresponding to the saved historical magnetic field strength, The azimuth whose magnetic field strength is equal to the threshold is selected as the initial azimuth; if not, the azimuth corresponding to the current magnetic field strength is selected as the initial azimuth.
  • the corresponding azimuth of the magnetic field vector is obtained according to the magnetic field vector, in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope, including:
  • Decomposing the magnetic field vector obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; decomposing the gravity vector to obtain the elevation angle and the roll angle of the mobile terminal with respect to the horizontal plane; and calibrating the mobile terminal according to the elevation angle and the roll angle
  • the plane where the mobile terminal is located is the plane of the screen of the mobile terminal.
  • the two axial directions perpendicular to each other on the plane of the mobile terminal are the front side and the left side of the mobile terminal when the screen is facing upward.
  • the X axis can be directly in front of the mobile terminal, and the Y axis can be the mobile terminal is right in the left.
  • the pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane the pitch angle is the angle between the X axis and the horizontal plane
  • the roll angle is the angle between the Y axis and the horizontal plane.
  • the magnetic field vector scores of the two axes perpendicular to each other on the plane of the mobile terminal are calibrated, and the magnetic field vector score on the X axis is calibrated according to the pitch angle, and the magnetic field vector score on the X axis is obtained.
  • the score on the horizontal plane, the magnetic field vector score on the Y-axis is calibrated according to the roll angle, and the score of the magnetic field vector score on the Y-axis on the horizontal plane is obtained.
  • the azimuth calibration is based on the inverse tangent of the magnetic field vector values of the two axial directions perpendicular to each other on the horizontal plane, and the corresponding azimuth of the magnetic field vector is obtained.
  • the gravity vector obtained by the acceleration sensor is used to calibrate the magnetic field vector acquired by the magnetic sensor, and then the corresponding azimuth of the magnetic field vector is obtained according to the calibrated magnetic field vector, so that the accuracy can be obtained. Azimuth.
  • the step of acquiring the azimuth of 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 comprises: decomposing the magnetic field vector to obtain two perpendicular to each other on the plane of the mobile terminal.
  • the magnetic field vector scores in the axial direction; the pitch angle and the roll angle of the mobile terminal relative to the horizontal plane are obtained according to the rotational angular velocity; and the two axial magnetic field vector points perpendicular to each other on the plane of the mobile terminal are calibrated according to the pitch angle and the roll angle Value, two axial magnetic field vector scores perpendicular to each other on the horizontal plane; the corresponding azimuth of the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
  • the rotational angular velocity detected by the gyroscope is a fusion value of the rotational angular velocity of the gyroscope in three axial directions.
  • the rotational angular velocity detected by the gyroscope in a single axial direction is the angular velocity at which the other two mutually perpendicular axial planes rotate when the axial direction remains constant. That is, when the Y-axis is constant with respect to the horizontal plane, the angular velocity of the X and Z axes is rotated to obtain the pitch angle, and the roll angle is obtained by the angular velocity at which the Y and Z axes rotate according to the X-axis relative to the horizontal plane.
  • the rotational angular velocity obtained by the gyroscope is calibrated, and the magnetic field vector acquired by the magnetic sensor is calibrated, and then the corresponding azimuth of the magnetic field vector is obtained according to the calibrated magnetic field vector, which can be accurately obtained. Azimuth.
  • step S210 includes adding a compensation angle to the initial azimuth to obtain a calibrated azimuth.
  • the direction of the initial azimuthal rotation is a rotation from the north direction direction clockwise to the projection of the mobile terminal X-axis on the horizontal plane.
  • the north direction line is the connection line from the location of the mobile terminal to the geographic north pole or the geomagnetic north pole.
  • the connection line from the mobile terminal to the geomagnetic north pole can be on the ray where the component of the magnetic field vector detected by the mobile terminal is on the horizontal plane.
  • the direction in which the compensation angle is rotated is the direction in which the mobile terminal rotates on a horizontal plane, which may be clockwise or counterclockwise.
  • the initial azimuth is defined in the range of 0-360 degrees. When the compensation angle rotation direction is clockwise, the size range is 0-360 degrees. When the compensation angle rotation direction is counterclockwise, the size range is -360-0 degrees.
  • the azimuth angle after calibration is more accurate by determining the direction and magnitude of the compensation angle and the initial azimuth.
  • an azimuth calibration method comprising the following steps:
  • step S406 When the magnetic field strength is greater than the threshold, step S406 is performed; when the magnetic field strength is less than or equal to the threshold, step S414 is performed.
  • the initial azimuth angle can be obtained according to the acquired magnetic field vector and the corresponding magnetic field strength, and the accurate initial azimuth angle can be obtained without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle.
  • the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • an azimuth calibration method is provided for use on an azimuth calibration device.
  • the azimuth calibration device includes a sensor module 502, a calibration module 504, and an application module 506.
  • the sensor module 502 is used to implement steps S502, S504, S506, and S508.
  • the gyroscope obtains a rotational angular velocity.
  • the acceleration sensor acquires a gravity vector.
  • the magnetic sensor acquires a magnetic field vector.
  • the orientation sensor acquires an initial azimuth.
  • the orientation sensor is a virtual sensor for obtaining an initial azimuth according to the rotational angular velocity obtained by the gyroscope, the gravity vector acquired by the acceleration sensor, and the magnetic field vector acquired by the magnetic sensor.
  • Calibration module 504 is used to implement steps S510, S512, and S514.
  • step S516 is performed; if not, step S514 is performed.
  • the high-precision value is a parameter possessed by the initial azimuth when the magnetic field strength of the magnetic field vector is less than or equal to the threshold.
  • the initial azimuth has a low-precision value when the magnetic field strength of the magnetic field vector is higher than the threshold.
  • the application is a computer readable instruction that applies a calibrated azimuth.
  • the initial azimuth angle can be obtained according to the acquired magnetic field vector and the corresponding magnetic field strength, and the accurate initial azimuth angle can be obtained without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle.
  • the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • an azimuth calibration apparatus 600 including:
  • a sensor module 602 configured to acquire a magnetic field vector detected by the magnetic sensor
  • An azimuth module 604 configured to acquire a corresponding initial azimuth of the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength;
  • the sensor module 602 is further configured to detect a current rotational angular velocity
  • a compensation angle module 606 configured to determine a compensation angle according to the currently detected rotational angular velocity
  • the calibration module 608 is configured to perform azimuth calibration according to the compensation angle and the initial azimuth.
  • the azimuth calibration device 600 can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector, thereby improving the initial azimuth angle. s efficiency. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • the sensor module 602 is further configured to acquire a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
  • the azimuth module 604 is further configured to use the magnetic field vector according to the magnetic field vector.
  • the azimuth angle corresponding to the magnetic field vector is obtained by combining the gravity vector and/or the rotational angular velocity detected by the gyroscope;
  • the azimuth calibration device 600 further includes: an accuracy value module 610 for determining the magnetic field strength and azimuth according to the magnetic field vector, Select the initial azimuth that satisfies the high precision value.
  • the sensor module 602 includes a magnetic field module 602a and a gravity module 602b, wherein
  • the magnetic field module 602a is configured to decompose the magnetic field vector to obtain magnetic field vector scores in two axial directions perpendicular to each other on the plane of the mobile terminal;
  • a gravity module 602b for decomposing a gravity vector to obtain a pitch angle and a roll angle of the mobile terminal with respect to a horizontal plane;
  • the azimuth module 604 is further configured to calibrate the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and the two axial magnetic field vector scores perpendicular to each other on the horizontal plane; According to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, the corresponding azimuth angle of the magnetic field vector is obtained.
  • a storage medium characterized by storing computer readable instructions which, when executed by a processor, cause the processor to perform the following steps:
  • the above storage medium can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • the step of acquiring a corresponding initial azimuth of the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength the computer readable instructions further causing the processor to perform the following steps:
  • the computer readable instructions cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies the high precision value based on the corresponding magnetic field strength and azimuth of the magnetic field vector:
  • Determining the accuracy value of the azimuth according to the current magnetic field strength determining whether the accuracy value of the azimuth angle is a high precision value; if yes, selecting the azimuth angle as the initial azimuth angle; if not, the azimuth angle corresponding to the saved historical magnetic field strength In the middle, the azimuth of the high precision value is selected as the initial azimuth.
  • the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
  • Decomposing the magnetic field vector obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; decomposing the gravity vector to obtain the elevation angle and the roll angle of the mobile terminal with respect to the horizontal plane; and calibrating the mobile terminal according to the elevation angle and the roll angle
  • the two axial magnetic field vector scores perpendicular to each other on the plane are obtained, and the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane Obtain the corresponding azimuth of the magnetic field vector.
  • the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
  • Decomposing the magnetic field vector obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; obtaining the pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane according to the rotational angular velocity; and calibrating the mobile terminal according to the pitch angle and the roll angle
  • the two axial magnetic field vector scores perpendicular to each other on the plane, the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, Obtain the corresponding azimuth of the magnetic field vector.
  • 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 following steps:
  • the initial azimuth is added to the compensation angle to obtain the azimuth after calibration.
  • a computer device comprising: a memory and a processor, wherein the computer stores computer readable instructions, wherein when the computer readable instructions are executed by the processor, the processor performs the following steps:
  • the above computer device can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
  • the step of acquiring a corresponding initial azimuth of the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength the computer readable instructions further causing the processor to perform the following steps:
  • the computer readable instructions cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies the high precision value based on the corresponding magnetic field strength and azimuth of the magnetic field vector:
  • Detecting the current magnetic field strength of the magnetic field vector preserving the azimuth corresponding to the current magnetic field strength of the magnetic field vector; determining the accuracy value of the azimuth angle according to the current magnetic field strength; determining whether the accuracy value of the azimuth angle is a high precision value; if so, selecting the azimuth angle as the initial value Azimuth; if not, the azimuth of the high-precision value is taken as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
  • the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
  • Decomposing the magnetic field vector obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; decomposing the gravity vector to obtain the elevation angle and the roll angle of the mobile terminal with respect to the horizontal plane; and calibrating the mobile terminal according to the elevation angle and the roll angle
  • the two axial magnetic field vector scores perpendicular to each other on the plane are obtained, and the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane Obtain the corresponding azimuth of the magnetic field vector.
  • the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
  • Decomposing the magnetic field vector obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; obtaining the pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane according to the rotational angular velocity; and calibrating the mobile terminal according to the pitch angle and the roll angle
  • the two axial magnetic field vector scores perpendicular to each other on the plane, the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, Obtain the corresponding azimuth of the magnetic field vector.
  • 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 following steps:
  • the initial azimuth is added to the compensation angle to obtain the azimuth after calibration.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.

Landscapes

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

Abstract

An azimuth calibration method and apparatus, a storage medium and a computer device. The method comprises: acquiring a magnetic field vector detected by a magnetic sensor (s202); according to the magnetic field vector and a corresponding magnetic field intensity, acquiring an initial azimuth corresponding to the magnetic field vector (s204); detecting a current rotational angular velocity (s206); determining a compensation angle according to the current rotational angular velocity (s208); and according to the compensation angle and the initial azimuth, performing azimuth calibration (s210). An initial azimuth can be acquired according to an acquired magnetic field vector and a corresponding magnetic field intensity, and the efficiency of acquiring an initial azimuth is improved when a precise initial azimuth is acquired without detailed analysis of a magnetic field vector. The current rotational angular velocity of a mobile terminal can also be acquired in order to acquire a compensation angle, and an azimuth is calibrated via the compensation angle and an initial azimuth. Therefore, an azimuth is calibrated after a precise initial azimuth is acquired, thereby improving the efficiency of azimuth calibration when the efficiency of acquiring a precise initial azimuth is improved.

Description

方位角校准方法、装置、存储介质和计算机设备Azimuth calibration method, device, storage medium and computer equipment
本申请要求于2017年06月19日提交中国专利局、申请号为201710466099.8、发明名称为“方位角校准方法、装置、存储介质和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 200910466099.8, entitled "Azimuth Calibration Method, Apparatus, Storage Medium, and Computer Equipment", filed on June 19, 2017, the entire contents of which are incorporated by reference. Combined in this application.
技术领域Technical field
本发明涉及电子罗盘技术领域,特别是涉及一种方位角校准方法、装置、存储介质和计算机设备。The present invention relates to the field of electronic compass technology, and in particular to an azimuth calibration method, apparatus, storage medium and computer device.
背景技术Background technique
目前,由于磁传感器容易受到附近磁场的影响,导致获取的方位角不准确。一般情况下,会对附近磁场进行详细分析,得到磁场的干扰情况,进而根据磁场的干扰情况来获取准确的方位角。At present, the magnetic sensor is easily affected by the nearby magnetic field, resulting in an inaccurate azimuth. Under normal circumstances, the nearby magnetic field is analyzed in detail to obtain the interference of the magnetic field, and then the accurate azimuth is obtained according to the interference of the magnetic field.
然而,由于详细分析磁场需要复杂的计算,导致目前方位角校准效率很低。However, due to the complex calculations required for detailed analysis of the magnetic field, the current azimuth calibration efficiency is very low.
申请内容Application content
基于此,有必要针对校准方位角的处理过程繁琐,效率很低的问题,本发明实施例提供一种方位角校准方法、装置、存储介质和计算机设备。Based on this, it is necessary to solve the problem that the processing of the calibration azimuth is cumbersome and the efficiency is very low. The embodiment of the invention provides an azimuth calibration method, device, storage medium and computer device.
一种方位角校准方法,包括:An azimuth calibration method includes:
获取磁传感器检测到的磁场矢量;Obtaining a magnetic field vector detected by the magnetic sensor;
根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角;Obtaining a corresponding initial azimuth of the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength;
检测当前旋转角速度;Detecting the current rotational angular velocity;
根据所述当前旋转角速度确定补偿角;Determining a compensation angle according to the current rotational angular velocity;
根据所述补偿角和所述初始方位角,进行方位角校准。Azimuth calibration is performed based on the compensation angle and the initial azimuth.
在一个实施例中,所述根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角,包括:In one embodiment, the obtaining the initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength comprises:
获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;Obtaining a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角;Obtaining a corresponding azimuth of 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;
根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。Based on the corresponding magnetic field strength and azimuth of the magnetic field vector, an initial azimuth angle that satisfies a high precision value is selected.
在一个实施例中,所述根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角,包括:In one embodiment, the initial azimuth angle that satisfies the high precision value is selected according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector, including:
检测所述磁场矢量当前磁场强度;Detecting a current magnetic field strength of the magnetic field vector;
保存所述磁场矢量当前磁场强度相应的方位角;Preserving an azimuth corresponding to the current magnetic field strength of the magnetic field vector;
根据所述当前磁场强度,确定所述方位角的精度值;Determining an accuracy value of the azimuth angle according to the current magnetic field strength;
判断所述方位角的精度值是否是高精度值;Determining whether the accuracy value of the azimuth is a high precision value;
若是,则选取所述方位角为初始方位角;If yes, the azimuth is selected as the initial azimuth;
若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。If not, the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
在一个实施例中,所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角,包括:In one embodiment, the obtaining the azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope, includes:
分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane;
根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获 取所述磁场矢量相应的方位角。The azimuth angle corresponding to the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
在一个实施例中,所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角,还包括:In one embodiment, the obtaining the azimuth 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, further includes:
分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane according to the rotational angular velocity;
根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
在一个实施例中,所述根据所述补偿角和所述初始方位角,进行方位角校准,包括:In one embodiment, the azimuth calibration is performed according to the compensation angle and the initial azimuth, including:
将所述初始方位角加上所述补偿角,得到校准后的方位角。The initial azimuth is added to the compensation angle to obtain a calibrated azimuth.
一种方位角校准装置,包括:An azimuth calibration device comprising:
传感器模块,用于获取磁传感器检测到的磁场矢量;a sensor module for acquiring a magnetic field vector detected by the magnetic sensor;
方位角模块,用于根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角;An azimuth module, configured to acquire an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength;
所述传感器模块,还用于检测当前旋转角速度;The sensor module is further configured to detect a current rotational angular velocity;
补偿角模块,用于根据所述当前旋转角速度确定补偿角;a compensation angle module, configured to determine a compensation angle according to the current rotational angular velocity;
校准模块,用于根据所述补偿角和所述初始方位角,进行方位角校准。And a calibration module, configured to perform 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 the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
所述方位角模块,还用于根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的 方位角;The azimuth module is further configured to acquire an azimuth 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 also includes:
精度值模块,用于根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。The precision value module is configured to select an initial azimuth angle that satisfies a high precision value according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector.
在一个实施例中,所述传感器模块包括:In one embodiment, the sensor module includes:
磁场模块,用于分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;a magnetic field module for decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions perpendicular to each other on a plane where the mobile terminal is located;
重力模块,用于分解所述重力矢量,获得所述移动终端相对于水平面的俯仰角和侧倾角;a gravity module, configured to decompose the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal with respect to a horizontal plane;
所述方位角模块,还用于根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。The azimuth module is further configured to calibrate two axial magnetic field vector values perpendicular to each other on a plane of the mobile terminal according to the pitch angle and the roll angle, and obtain two axial directions perpendicular to each other on the horizontal plane. The magnetic field vector score; the corresponding azimuth of the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
一种存储介质,其特征在于,存储有计算机可读指令,所述计算机可读指令被处理器执行时,使得所述处理器执行以下步骤:A storage medium characterized by storing computer readable instructions which, when executed by a processor, cause the processor to perform the following steps:
获取磁传感器检测到的磁场矢量;Obtaining a magnetic field vector detected by the magnetic sensor;
根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角;Obtaining a corresponding initial azimuth of the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength;
检测当前旋转角速度;Detecting the current rotational angular velocity;
根据所述当前旋转角速度确定补偿角;Determining a compensation angle according to the current rotational angular velocity;
根据所述补偿角和所述初始方位角,进行方位角校准。Azimuth calibration is performed based on the compensation angle and the initial azimuth.
在一个实施例中,执行所述根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the step of acquiring the initial azimuth corresponding to the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength, the computer readable instructions further causing the processor to perform the following steps:
获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;Obtaining a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到 的旋转角速度,获取所述磁场矢量相应的方位角;Obtaining a corresponding azimuth of 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;
根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。Based on the corresponding magnetic field strength and azimuth of the magnetic field vector, an initial azimuth angle that satisfies a high precision value is selected.
在一个实施例中,执行所述根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the computer readable instructions further cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies a high precision value based on a corresponding magnetic field strength and azimuth of the magnetic field vector :
检测所述磁场矢量当前磁场强度;Detecting a current magnetic field strength of the magnetic field vector;
保存所述磁场矢量当前磁场强度相应的方位角;Preserving an azimuth corresponding to the current magnetic field strength of the magnetic field vector;
根据所述当前磁场强度,确定所述方位角的精度值;Determining an accuracy value of the azimuth angle according to the current magnetic field strength;
判断所述方位角的精度值是否是高精度值;Determining whether the accuracy value of the azimuth is a high precision value;
若是,则选取所述方位角为初始方位角;If yes, the azimuth is selected as the initial azimuth;
若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。If not, the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
在一个实施例中,执行所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope The read instruction also causes the processor to perform the following steps:
分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane;
根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
在一个实施例中,执行所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角的步骤时,所述计算机可读指令还使得所述处理器执行以 下步骤:In one embodiment, the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope The read instruction also causes the processor to perform the following steps:
分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane according to the rotational angular velocity;
根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A computer apparatus, comprising: a memory and a processor, wherein the memory stores computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
获取磁传感器检测到的磁场矢量;Obtaining a magnetic field vector detected by the magnetic sensor;
根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角;Obtaining a corresponding initial azimuth of the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength;
检测当前旋转角速度;Detecting the current rotational angular velocity;
根据所述当前旋转角速度确定补偿角;Determining a compensation angle according to the current rotational angular velocity;
根据所述补偿角和所述初始方位角,进行方位角校准。Azimuth calibration is performed based on the compensation angle and the initial azimuth.
在一个实施例中,执行所述根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the step of acquiring the initial azimuth corresponding to the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength, the computer readable instructions further causing the processor to perform the following steps:
获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;Obtaining a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角;Obtaining a corresponding azimuth of 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;
根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。Based on the corresponding magnetic field strength and azimuth of the magnetic field vector, an initial azimuth angle that satisfies a high precision value is selected.
在一个实施例中,执行所述根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the computer readable instructions further cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies a high precision value based on a corresponding magnetic field strength and azimuth of the magnetic field vector :
检测所述磁场矢量当前磁场强度;Detecting a current magnetic field strength of the magnetic field vector;
保存所述磁场矢量当前磁场强度相应的方位角;Preserving an azimuth corresponding to the current magnetic field strength of the magnetic field vector;
根据所述当前磁场强度,确定所述方位角的精度值;Determining an accuracy value of the azimuth angle according to the current magnetic field strength;
判断所述方位角的精度值是否是高精度值;Determining whether the accuracy value of the azimuth is a high precision value;
若是,则选取所述方位角为初始方位角;If yes, the azimuth is selected as the initial azimuth;
若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。If not, the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
在一个实施例中,执行所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope The read instruction also causes the processor to perform the following steps:
分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane;
根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
在一个实施例中,执行所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角的步骤时,所述计算机可读指令还使得所述处理器执行以下步骤:In one embodiment, the computer may perform the step of acquiring azimuth corresponding to the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope The read instruction also causes the processor to perform the following steps:
分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane according to the rotational angular velocity;
根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
上述方位角校准方法、装置、存储介质和计算机设备,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。The azimuth calibration method, device, storage medium and computer device can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector. , improve the efficiency of obtaining the initial azimuth. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
附图说明DRAWINGS
图1为一个实施例中应用方位角校准方法的移动终端的内部结构图;1 is an internal structural diagram of a mobile terminal applying an azimuth calibration method in an embodiment;
图2为一个实施例中方位角校准方法的流程示意图;2 is a schematic flow chart of an azimuth calibration method in an embodiment;
图3为一个实施例中移动终端不同俯仰角和侧倾角的轴向示意图;3 is an axial schematic view showing different pitch angles and roll angles of the mobile terminal in one embodiment;
图4为另一个实施例中方位角校准方法的流程示意图;4 is a schematic flow chart of a method for azimuth calibration in another embodiment;
图5为一个实施例中方位角校准方法的流程示意图;5 is a schematic flow chart of an azimuth calibration method in an embodiment;
图6为一个实施例中方位角校准装置的结构框图;Figure 6 is a block diagram showing the structure of an azimuth calibration device in an embodiment;
图7为另一个实施例中方位角校准装置的结构框图;Figure 7 is a block diagram showing the structure of an azimuth calibration device in another embodiment;
图8为一个实施例中方位角校准装置的结构框图。Figure 8 is a block diagram showing the structure of an azimuth calibration apparatus in one embodiment.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
图1为一个实施例中,应用一种方位角校准方法的移动终端的内部结构图。如图1所示,该移动终端包括通过***总线连接的处理器、非易失性存储介质、内存储器、磁传感器、加速度传感器和陀螺仪等。其中,该移动终端的非易失性存储介质存储有操作***和计算机可读指令,该计算机可读指令用于实现适用于移动终端的一种方位角校准方法。该移动终端的处理器用于提供计算和控制能力,支撑整个移动终端的运行。该移动终端的内存储器为非易失性存储介质中的计算机可读指令的运行提供环境,该内存储器中可储存有计算机可读指令,该计算机可读指令被上述处理器执行时,可使得上述处理器执行一种方位角校准方法。1 is an internal structural diagram of a mobile terminal to which an azimuth calibration method is applied in an embodiment. As shown in FIG. 1, the mobile terminal includes a processor connected through a system bus, a nonvolatile storage medium, an internal memory, a magnetic sensor, an acceleration sensor, a gyroscope, and the like. Wherein, 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 operation of computer readable instructions in a non-volatile storage medium, and the internal memory can store computer readable instructions that, when executed by the processor, can The above processor performs an azimuth calibration method.
该移动终端的磁传感器用于获取移动终端所处位置的磁场矢量,以及以移动终端为原点的三个相互垂直轴向上的磁场矢量分量。该移动终端的加速度传感器用于获取移动终端所处位置的重力矢量,以及以移动终端为原点的三个相互垂直轴向上的重力矢量分量。该移动终端的陀螺仪用于获取移动终端旋转运动时在以移动终端为原点的三个相互垂直轴向上的角速度。本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的移动终端的限定,具体的移动终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The magnetic sensor of the mobile terminal is used to acquire the magnetic field vector of the position where the mobile terminal is located, and the magnetic field vector components of the three mutually perpendicular axes with the mobile terminal as the origin. The acceleration sensor of the mobile terminal is used to acquire the gravity vector of the position where the mobile terminal is located, and the gravity vector components in three mutually perpendicular axes with the mobile terminal as the origin. The gyroscope of the mobile terminal is used to obtain angular velocities in three mutually perpendicular axial directions with the mobile terminal as the origin when the mobile terminal rotates. A person skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the mobile terminal to which the solution of the present application is applied. The specific mobile terminal may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
如图2所示,在一个实施例中,提供了一种方位角校准方法。本实施例中主要以该方法应用于上述图1中的移动终端来举例说明。参照图2,该方位角校准方法具体包括如下步骤:As shown in FIG. 2, in one embodiment, an azimuth calibration method is provided. In this embodiment, the method is mainly applied to the mobile terminal in FIG. 1 described above for illustration. Referring to FIG. 2, the azimuth calibration method specifically includes the following steps:
S202,获取磁传感器检测到的磁场矢量。S202. Acquire a magnetic field vector detected by the magnetic sensor.
其中,磁传感器(Mag Sensor)是能够把磁场、电流、应力应变、温度、光等外界因素引起敏感元件磁性能变化转换成电信号的 传感器。因此,磁传感器检测到的磁场矢量容易受到外界干扰,导致获取的磁场矢量不准确。Among them, the magnetic sensor (Mag Sensor) is a sensor that can convert magnetic properties of sensitive components into electrical signals by external factors such as magnetic field, current, stress strain, temperature, and light. Therefore, the magnetic field vector detected by the magnetic sensor is susceptible to external interference, resulting in an inaccurate magnetic field vector.
在一个实施例中,分析磁传感器检测到的磁场矢量,得到磁场干扰参数,根据该磁场干扰参数校准根据磁场矢量获得的方位角。In one embodiment, the magnetic field vector detected by the magnetic sensor is analyzed to obtain a magnetic field interference parameter, and the azimuth obtained from the magnetic field vector is calibrated based on the magnetic field interference parameter.
其中,磁场干扰参数是外界环境对地磁场造成干扰的参数,磁场干扰参数可以是强磁体发出的磁场矢量,也可以是外界的温度、电场、应力变化、光等情况。根据该磁场干扰参数校准根据磁场矢量获得的方位角,是校准磁场干扰参数对磁场矢量干扰后造成的方位角误差。Among them, the magnetic field interference parameter is a parameter that the external environment causes interference to the earth magnetic field, and the magnetic field interference parameter may be a magnetic field vector emitted by the strong magnet, or may be external temperature, electric field, stress change, light, and the like. The azimuth obtained from the magnetic field vector is calibrated according to the magnetic field interference parameter, which is an azimuth error caused by the calibration magnetic field interference parameter to the magnetic field vector interference.
S204,根据磁场矢量和相应的磁场强度,获取磁场矢量相应的初始方位角。S204. Acquire an initial azimuth angle corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength.
其中,磁场矢量是磁传感器检测磁场获取的矢量,磁场矢量可以包括磁场强度矢量。磁场矢量相应的磁场强度可以包括地磁场的磁场强度,还可以包括附近强磁体的磁场强度和交流电产生的磁场强度等。初始方位角可以是移动终端在水平面上从正北方向以顺时针旋转得到的夹角。Wherein, 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 corresponding magnetic field strength of the magnetic field vector may include the magnetic field strength of the earth magnetic field, and may also include the magnetic field strength of the nearby strong magnet and the magnetic field strength generated by the alternating current. The initial azimuth may be an angle obtained by the mobile terminal rotating clockwise from the north direction on the horizontal plane.
S206,检测当前旋转角速度。S206. Detect a current rotational angular velocity.
其中,陀螺仪(Gyro Sensor)是一种角运动检测装置,可以检测移动终端在三个相互垂直的轴向上的角速度。旋转角速度可以是移动终端在三个相互垂直的轴向上旋转产生的角速度,也可以是相对水平面的固定轴向上的角速度。Among them, the Gyro Sensor is an angular motion detecting device that can detect the angular velocity of the mobile terminal in three mutually perpendicular axial directions. The angular velocity of rotation may be the angular velocity produced by the rotation of the mobile terminal in three mutually perpendicular axial directions, or may be the angular velocity in a fixed axial direction relative to the horizontal plane.
在一个实施例中,获取陀螺仪检测到移动终端在三个相互垂直的轴向上的角速度,根据检测到的三个轴向上的角速度,计算移动终端在水平面上旋转的角速度。In one embodiment, the acquisition gyroscope detects the angular velocity of the mobile terminal in three mutually perpendicular axes, and calculates the angular velocity of the mobile terminal to rotate on the horizontal plane based on the detected angular velocities in the three axial directions.
在一个实施例中,通过加速度传感器和陀螺仪协同获取移动终端的移动轨迹,分析移动终端的运动轨迹,得到移动终端在水平面上旋转角速度。In one embodiment, the movement trajectory of the mobile terminal is acquired by the acceleration sensor and the gyroscope, and the motion trajectory of the mobile terminal is analyzed, and the angular velocity of the rotation of the mobile terminal on the horizontal plane is obtained.
其中,加速度传感器可以检测移动终端的移动加速度,进而获取移动终端的移动速度和移动距离等。通过加速度传感器获取的移 动终端的移动加速度等,可以校准陀螺仪获取的旋转角速度,得到移动终端在水平面上的旋转角速度。The acceleration sensor can detect the moving acceleration of the mobile terminal, thereby acquiring the moving speed and the moving distance of the mobile terminal. The rotational angular velocity obtained by the gyroscope can be calibrated by the moving acceleration of the mobile terminal obtained by the acceleration sensor, etc., and the rotational angular velocity of the mobile terminal on the horizontal plane can be obtained.
S208,根据当前旋转角速度确定补偿角。S208. Determine a compensation angle according to a current rotational angular velocity.
其中,补偿角是移动终端在水平面上转动的角度,通过移动终端在水平面上的角速度和转动消耗的时间,可以获取移动终端在经过该时间后转动的角度,即补偿角。The compensation angle is an angle at which the mobile terminal rotates on a horizontal plane. The angle of rotation of the mobile terminal after the elapse of time, that is, the compensation angle, can be obtained by the angular velocity of the mobile terminal on the horizontal plane and the time consumed by the rotation.
在一个实施例中,检测到移动终端在预设时间点上的瞬时角速度,根据检测到的瞬时角速度获得移动终端旋转的角速度,对获得的角速度进行积分,以及累加通过对角速度积分得到的角度,得到补偿角。In one embodiment, the instantaneous angular velocity of the mobile terminal at a preset time point is detected, the angular velocity of the rotation of the mobile terminal is obtained according to the detected instantaneous angular velocity, the obtained angular velocity is integrated, and the angle obtained by integrating the angular velocity is accumulated, Get the compensation angle.
其中,两个相邻的预设时间点之间的时长固定,在一个具体的实施例中该时长可以是100ms。根据检测到的瞬时角速度获得移动终端旋转的角速度,可以是根据两个相邻的预设时间点获取的瞬时角速度的平均值,获得移动终端旋转的角速度。对获得的角速度积分,得到上述时长内移动终端旋转的角度。通过对一段时间内多个时长相应的移动终端旋转的角度累加,得到这段时间移动终端的补偿角。The duration between two adjacent preset time points is fixed, and in a specific embodiment, the duration may be 100 ms. Obtaining the angular velocity of the rotation of the mobile terminal according to the detected instantaneous angular velocity may be an angular velocity of the rotation of the mobile terminal according to an average value of the instantaneous angular velocities acquired at two adjacent preset time points. The angular velocity obtained is integrated to obtain the angle at which the mobile terminal rotates within the above duration. The compensation angle of the mobile terminal during this period is obtained by accumulating the angles of the rotations of the mobile terminals corresponding to the plurality of durations in a period of time.
S210,根据补偿角和初始方位角,进行方位角校准。S210, performing azimuth calibration according to the compensation angle and the initial azimuth.
其中,根据补偿角和初始方位角进行方位角校准,是根据移动终端转动时产生的补偿角校准初始方位角,得到校准后的方位角。Wherein, the azimuth calibration according to the compensation angle and the initial azimuth is to calibrate the initial azimuth according to the compensation angle generated when the mobile terminal rotates, and obtain the azimuth after calibration.
本实施例中,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。In this embodiment, the initial azimuth angle can be obtained according to the acquired magnetic field vector and the corresponding magnetic field strength, and the accurate initial azimuth angle can be obtained without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle. . It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
在一个实施例中,步骤S204包括:获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;根据磁场矢量,结合重 力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角;根据磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。In one embodiment, step S204 includes: acquiring a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope; acquiring the magnetic field vector according to the magnetic field vector, combined with the gravity vector and/or the rotational angular velocity detected by the gyroscope Corresponding azimuth; according to the corresponding magnetic field strength and azimuth of the magnetic field vector, the initial azimuth angle satisfying the high precision value is selected.
其中,加速度传感器(GSensor)是一种能够测量移动终端加速度的传感器,移动终端的加速度包括重力加速度。加速度传感器可以获取移动终端在三个相互垂直的轴向上的重力矢量分量,进而根据移动终端在三个相互垂直的轴向上的重力矢量分量获取移动终端所在平面与水平面的夹角。Among them, the acceleration sensor (GSensor) is a sensor capable of measuring the acceleration of the mobile terminal, and the acceleration of the mobile terminal includes the acceleration of gravity. The acceleration sensor can acquire the gravity vector component of the mobile terminal in three mutually perpendicular axial directions, and then obtain the angle between the plane of the mobile terminal and the horizontal plane according to the gravity vector component of the mobile terminal in three mutually perpendicular axial directions.
精度值是反映初始方位角是否精准的一个参数,高精度值的初始方位角是精准的方位角。The accuracy value is a parameter that reflects whether the initial azimuth is accurate. The initial azimuth of the high-precision value is the precise azimuth.
本实施例中,在移动终端附近的磁场干扰小的时候,通过加速度传感器和/或陀螺仪获取的参数,与磁传感器获取的参数协同获取方位角,还通过磁场矢量相应的磁场强度和方位角,选取精准的初始方位角。In this embodiment, when the magnetic field interference near the mobile terminal is small, the parameters acquired by the acceleration sensor and/or the gyroscope cooperate with the parameters acquired by the magnetic sensor to obtain the azimuth angle, and also the magnetic field strength and azimuth corresponding to the magnetic field vector. , select the precise initial azimuth.
在一个实施例中,根据磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角,包括:检测磁场矢量当前磁场强度;保存磁场矢量当前磁场强度相应的方位角;根据当前磁场强度,确定方位角的精度值;判断方位角的精度值是否是高精度值;若是,则选取所述方位角为初始方位角;若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。In one embodiment, the initial azimuth angle satisfying the high precision value is selected according to the corresponding magnetic field strength and azimuth of the magnetic field vector, including: detecting the current magnetic field strength of the magnetic field vector; and maintaining the azimuth corresponding to the current magnetic field strength of the magnetic field vector; Intensity, determining the accuracy value of the azimuth; determining whether the accuracy value of the azimuth is a high-precision value; if so, selecting the azimuth as the initial azimuth; if not, from the azimuth corresponding to the saved historical magnetic field strength , select the azimuth of the high-precision value as the initial azimuth.
其中,精度值是判断方位角是否精准的参数,高精度值表示方位角精准,相对的,低精度值表示方位角不精准。方位角的精度值可以根据方位角相应磁场矢量的磁场强度获取。根据当前磁场强度,确定方位角的精度值,可以是根据当前磁场强度大小来确定方位角的精度值。Among them, the precision value is a parameter for judging whether the azimuth is accurate, the high precision value indicates that the azimuth angle is accurate, and the relative low precision value indicates that the azimuth angle is not accurate. The accuracy value of the azimuth can be obtained from the magnetic field strength of the corresponding magnetic field vector of the azimuth. The accuracy value of the azimuth is determined according to the current magnetic field strength, and the accuracy value of the azimuth may be determined according to the current magnetic field strength.
在一个实施例中,检测磁场矢量当前磁场强度;预设置保存时长,每间隔一次保存时长便保存一次磁场矢量当前磁场强度相应的方位角;根据当前磁场强度,确定方位角的精度值;判断方位角的精度值是否是高精度值;若是,则选取所述方位角为初始方位角; 若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。In one embodiment, the current magnetic field strength of the magnetic field vector is detected; the storage duration is preset, and the azimuth corresponding to the current magnetic field strength of the magnetic field vector is saved once every interval of storage; the accuracy value of the azimuth is determined according to the current magnetic field strength; Whether the angle precision value is a high-precision value; if yes, the azimuth angle is selected as the initial azimuth angle; if not, the azimuth angle of the high-precision value is selected as the initial orientation from the azimuth angle corresponding to the saved historical magnetic field strength angle.
在一个实施例中,保存磁场矢量当前磁场强度相应的方位角;预设置磁场强度的阈值,检测磁场矢量当前磁场强度是否大于阈值;若是,则从已保存的历史磁场强度相应的方位角中,选取磁场强度等于阈值的方位角为初始方位角;若否,则选取当前磁场强度相应的方位角为初始方位角。In one embodiment, the azimuth corresponding to the current magnetic field strength of the magnetic field vector is saved; the threshold of the magnetic field strength is preset, and the current magnetic field strength of the magnetic field vector is detected to be greater than a threshold; if so, from the azimuth corresponding to the saved historical magnetic field strength, The azimuth whose magnetic field strength is equal to the threshold is selected as the initial azimuth; if not, the azimuth corresponding to the current magnetic field strength is selected as the initial azimuth.
在一个实施例中,根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角,包括:In one embodiment, the corresponding azimuth of the magnetic field vector is obtained according to the magnetic field vector, in combination with the gravity vector and/or the rotational angular velocity detected by the gyroscope, including:
分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;分解重力矢量,获得移动终端相对于水平面的俯仰角和侧倾角;根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取磁场矢量相应的方位角。Decomposing the magnetic field vector, obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; decomposing the gravity vector to obtain the elevation angle and the roll angle of the mobile terminal with respect to the horizontal plane; and calibrating the mobile terminal according to the elevation angle and the roll angle Two axial magnetic field vector scores perpendicular to each other on the plane, and two axial magnetic field vector scores perpendicular to each other on the horizontal plane; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, Obtain the corresponding azimuth of the magnetic field vector.
参照图3,其中,移动终端所在平面是移动终端的屏幕所在平面。移动终端所在平面上相互垂直的两个轴向,是移动终端屏幕朝上时的正前方和正左方。X轴可以是移动终端的正前方,Y轴可以是移动终端是正左方。移动终端相对于水平面的俯仰角和侧倾角,俯仰角是X轴与水平面的夹角,侧倾角是Y轴与水平面的夹角。Referring to FIG. 3, the plane where the mobile terminal is located is the plane of the screen of the mobile terminal. The two axial directions perpendicular to each other on the plane of the mobile terminal are the front side and the left side of the mobile terminal when the screen is facing upward. The X axis can be directly in front of the mobile terminal, and the Y axis can be the mobile terminal is right in the left. The pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane, the pitch angle is the angle between the X axis and the horizontal plane, and the roll angle is the angle between the Y axis and the horizontal plane.
根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,是根据俯仰角校准X轴上的磁场矢量分值,得到X轴上的磁场矢量分值在水平面上的分值,根据侧倾角校准Y轴上的磁场矢量分值,得到Y轴上的磁场矢量分值在水平面上的分值。According to the pitch angle and the roll angle, the magnetic field vector scores of the two axes perpendicular to each other on the plane of the mobile terminal are calibrated, and the magnetic field vector score on the X axis is calibrated according to the pitch angle, and the magnetic field vector score on the X axis is obtained. The score on the horizontal plane, the magnetic field vector score on the Y-axis is calibrated according to the roll angle, and the score of the magnetic field vector score on the Y-axis on the horizontal plane is obtained.
根据水平面上相互垂直的两个轴向上的磁场矢量分值进行方位角校准,是根据水平面上相互垂直的两个轴向上的磁场矢量分值的反正切值,得到磁场矢量相应的方位角。According to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, the azimuth calibration is based on the inverse tangent of the magnetic field vector values of the two axial directions perpendicular to each other on the horizontal plane, and the corresponding azimuth of the magnetic field vector is obtained. .
本实施例中,在移动终端附近的磁场干扰小的时候,通过加速 度传感器获取的重力矢量,校准磁传感器获取的磁场矢量,进而根据校准后的磁场矢量获取磁场矢量相应的方位角,可以得到精准的方位角。In this embodiment, when the magnetic field interference near the mobile terminal is small, the gravity vector obtained by the acceleration sensor is used to calibrate the magnetic field vector acquired by the magnetic sensor, and then the corresponding azimuth of the magnetic field vector is obtained according to the calibrated magnetic field vector, so that the accuracy can be obtained. Azimuth.
在一个实施例中,根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角的步骤,包括:分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;根据旋转角速度获得移动终端相对于水平面的俯仰角和侧倾角;根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取磁场矢量相应的方位角。In one embodiment, the step of acquiring the azimuth of 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, comprises: decomposing the magnetic field vector to obtain two perpendicular to each other on the plane of the mobile terminal. The magnetic field vector scores in the axial direction; the pitch angle and the roll angle of the mobile terminal relative to the horizontal plane are obtained according to the rotational angular velocity; and the two axial magnetic field vector points perpendicular to each other on the plane of the mobile terminal are calibrated according to the pitch angle and the roll angle Value, two axial magnetic field vector scores perpendicular to each other on the horizontal plane; the corresponding azimuth of the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
参照图3,其中,陀螺仪检测到的旋转角速度,是陀螺仪在三个轴向上的旋转角速度的融合值。陀螺仪在单个轴向上检测到的旋转角速度,是该轴向相对水平面保持不变时,其他两个相互垂直轴向所在平面旋转的角速度。即根据Y轴相对水平面保持不变时,X、Z轴旋转的角速度获取俯仰角,根据X轴相对水平面保存不变时,Y、Z轴旋转的角速度获取侧倾角。Referring to FIG. 3, the rotational angular velocity detected by the gyroscope is a fusion value of the rotational angular velocity of the gyroscope in three axial directions. The rotational angular velocity detected by the gyroscope in a single axial direction is the angular velocity at which the other two mutually perpendicular axial planes rotate when the axial direction remains constant. That is, when the Y-axis is constant with respect to the horizontal plane, the angular velocity of the X and Z axes is rotated to obtain the pitch angle, and the roll angle is obtained by the angular velocity at which the Y and Z axes rotate according to the X-axis relative to the horizontal plane.
本实施例中,在移动终端附近的磁场干扰小的时候,通过陀螺仪获取的旋转角速度,校准磁传感器获取的磁场矢量,进而根据校准后的磁场矢量获取磁场矢量相应的方位角,可以得到精准的方位角。In this embodiment, when the magnetic field interference near the mobile terminal is small, the rotational angular velocity obtained by the gyroscope is calibrated, and the magnetic field vector acquired by the magnetic sensor is calibrated, and then the corresponding azimuth of the magnetic field vector is obtained according to the calibrated magnetic field vector, which can be accurately obtained. Azimuth.
在一个实施例中,步骤S210包括:将初始方位角加上补偿角,得到校准后的方位角。In one embodiment, step S210 includes adding a compensation angle to the initial azimuth to obtain a calibrated azimuth.
参照图3,其中,初始方位角旋转的方向是,从指北方向线顺时针方向旋转到移动终端X轴在水平面上的投影。指北方向线是移动终端所在位置到地理北极或地磁北极的连接线,移动终端所在位置到地磁北极的连接线可以在移动终端检测到的磁场矢量在水平面上的分量所在的射线上。补偿角旋转的方向是移动终端在水平面上旋转的方向,可以是顺时针方向或逆时针方向。定义初始方位角的 大小范围在0-360度,补偿角旋转方向为顺时针时,大小范围在0-360度,补偿角旋转方向为逆时针时,大小范围在-360-0度。Referring to FIG. 3, the direction of the initial azimuthal rotation is a rotation from the north direction direction clockwise to the projection of the mobile terminal X-axis on the horizontal plane. The north direction line is the connection line from the location of the mobile terminal to the geographic north pole or the geomagnetic north pole. The connection line from the mobile terminal to the geomagnetic north pole can be on the ray where the component of the magnetic field vector detected by the mobile terminal is on the horizontal plane. The direction in which the compensation angle is rotated is the direction in which the mobile terminal rotates on a horizontal plane, which may be clockwise or counterclockwise. The initial azimuth is defined in the range of 0-360 degrees. When the compensation angle rotation direction is clockwise, the size range is 0-360 degrees. When the compensation angle rotation direction is counterclockwise, the size range is -360-0 degrees.
本实施例中,通过确定补偿角和初始方位角的方向和大小,使校准后的方位角更精准。In this embodiment, the azimuth angle after calibration is more accurate by determining the direction and magnitude of the compensation angle and the initial azimuth.
如图4所示,在一个实施例中,提供了一种方位角校准方法,该方法包括如下步骤:As shown in FIG. 4, in one embodiment, an azimuth calibration method is provided, the method comprising the following steps:
S402,获取磁传感器检测到的磁场矢量。S402. Acquire a magnetic field vector detected by the magnetic sensor.
S404,检测磁场矢量的磁场强度是否大于阈值。S404. Detect whether the magnetic field strength of the magnetic field vector is greater than a threshold.
当磁场强度大于阈值时,执行步骤S406;当磁场强度小于或等于阈值时,执行步骤S414。When the magnetic field strength is greater than the threshold, step S406 is performed; when the magnetic field strength is less than or equal to the threshold, step S414 is performed.
S406,获取磁场强度等于所述阈值时的初始方位角。S406. Acquire an initial azimuth when the magnetic field strength is equal to the threshold.
S408,获取陀螺仪当前检测到的旋转角速度。S408. Acquire a rotational angular velocity currently detected by the gyroscope.
S410,根据当前检测到的旋转角速度确定补偿角。S410. Determine a compensation angle according to the currently detected rotational angular velocity.
S412,根据补偿角和所述初始方位角,进行方位角校准。S412, performing azimuth calibration according to the compensation angle and the initial azimuth.
S414,获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度。S414. Acquire a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope.
S416,分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值。S416, decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions perpendicular to each other on the plane where the mobile terminal is located.
S418,分解重力矢量,获得移动终端相对于水平面的俯仰角和侧倾角。S418, decomposing the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal with respect to a horizontal plane.
S420,根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值。S420, calibrating the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle.
S422,根据水平面上相互垂直的两个轴向上的磁场矢量分值进行方位角校准。S422, performing azimuth calibration according to two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
S424,根据旋转角速度获得移动终端在水平面上旋转的角度。S424. Obtain an angle at which the mobile terminal rotates on a horizontal plane according to the rotational angular velocity.
S426,根据旋转的角度对校准后的方位角进行校准。S426, calibrating the calibrated azimuth according to the angle of rotation.
本实施例中,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移 动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。In this embodiment, the initial azimuth angle can be obtained according to the acquired magnetic field vector and the corresponding magnetic field strength, and the accurate initial azimuth angle can be obtained without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle. . It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain the compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
如图5所示,在一个实施例中,提供了一种方位角校准方法应用于一种方位角校准装置上。参照图5,该方位角校准装置包括:传感器模块502、校准模块504和应用程序模块506。As shown in FIG. 5, in one embodiment, an azimuth calibration method is provided for use on an azimuth calibration device. Referring to FIG. 5, the azimuth calibration device includes a sensor module 502, a calibration module 504, and an application module 506.
传感器模块502用于实施步骤S502、S504、S506和S508。The sensor module 502 is used to implement steps S502, S504, S506, and S508.
S502,陀螺仪获取旋转角速度。S502, the gyroscope obtains a rotational angular velocity.
S504,加速度传感器获取重力矢量。S504. The acceleration sensor acquires a gravity vector.
S506,磁传感器获取磁场矢量。S506, the magnetic sensor acquires a magnetic field vector.
S508,方位传感器获取初始方位角。S508. The orientation sensor acquires an initial azimuth.
其中,方位传感器是一个虚拟传感器,用于根据陀螺仪获取的旋转角速度、加速度传感器获取的重力矢量和磁传感器获取的磁场矢量,获取初始方位角。The orientation sensor is a virtual sensor for obtaining an initial azimuth according to the rotational angular velocity obtained by the gyroscope, the gravity vector acquired by the acceleration sensor, and the magnetic field vector acquired by the magnetic sensor.
校准模块504用于实施步骤S510、S512和S514。 Calibration module 504 is used to implement steps S510, S512, and S514.
S510,判断获取的初始方位角的精度值是否是高精度值。S510. Determine whether the acquired precision value of the initial azimuth is a high-precision value.
若是,则将该初始方位角作为校准后的方位角,执行步骤S516;若否,则执行步骤S514。If yes, the initial azimuth is used as the azimuth after calibration, and step S516 is performed; if not, step S514 is performed.
S512,根据陀螺仪获取的旋转角速度获取补偿角。S512, obtaining a compensation angle according to the rotational angular velocity obtained by the gyroscope.
S514,根据补偿角和初始方位角,进行方位角校准。S514, performing azimuth calibration according to the compensation angle and the initial azimuth.
S516,向应用程序输出校准后的方位角。S516, outputting the calibrated azimuth to the application.
其中,高精度值是初始方位角在磁场矢量的磁场强度小于或等于阈值时拥有的参数,相应的,初始方位角在磁场矢量的磁场强度高于阈值时拥有的参数是低精度值。应用程序是应用校准后的方位角的计算机可读指令。The high-precision value is a parameter possessed by the initial azimuth when the magnetic field strength of the magnetic field vector is less than or equal to the threshold. Correspondingly, the initial azimuth has a low-precision value when the magnetic field strength of the magnetic field vector is higher than the threshold. The application is a computer readable instruction that applies a calibrated azimuth.
本实施例中,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移 动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。In this embodiment, the initial azimuth angle can be obtained according to the acquired magnetic field vector and the corresponding magnetic field strength, and the accurate initial azimuth angle can be obtained without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth angle. . It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain the compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
如图6所示,在一个实施例中,提供了一种方位角校准装置600,包括:As shown in FIG. 6, in one embodiment, an azimuth calibration apparatus 600 is provided, including:
传感器模块602,用于获取磁传感器检测到的磁场矢量;a sensor module 602, configured to acquire a magnetic field vector detected by the magnetic sensor;
方位角模块604,用于根据磁场矢量和相应的磁场强度,获取磁场矢量相应的初始方位角;An azimuth module 604, configured to acquire a corresponding initial azimuth of the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength;
传感器模块602,还用于检测当前旋转角速度;The sensor module 602 is further configured to detect a current rotational angular velocity;
补偿角模块606,用于根据当前检测到的旋转角速度确定补偿角;a compensation angle module 606, configured to determine a compensation angle according to the currently detected rotational angular velocity;
校准模块608,用于根据补偿角和初始方位角,进行方位角校准。The calibration module 608 is configured to perform azimuth calibration according to the compensation angle and the initial azimuth.
上述方位角校准装置600,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。The azimuth calibration device 600 can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector, thereby improving the initial azimuth angle. s efficiency. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
如图7所示,在一个实施例中,传感器模块602,还用于获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;方位角模块604,还用于根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角;方位角校准装置600还包括:精度值模块610,用于根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。As shown in FIG. 7, in one embodiment, the sensor module 602 is further configured to acquire a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope; the azimuth module 604 is further configured to use the magnetic field vector according to the magnetic field vector. The azimuth angle corresponding to the magnetic field vector is obtained by combining the gravity vector and/or the rotational angular velocity detected by the gyroscope; the azimuth calibration device 600 further includes: an accuracy value module 610 for determining the magnetic field strength and azimuth according to the magnetic field vector, Select the initial azimuth that satisfies the high precision value.
如图8所示,在一个实施例中,传感器模块602包括磁场模块602a和重力模块602b,其中,As shown in FIG. 8, in one embodiment, the sensor module 602 includes a magnetic field module 602a and a gravity module 602b, wherein
磁场模块602a,用于分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;The magnetic field module 602a is configured to decompose the magnetic field vector to obtain magnetic field vector scores in two axial directions perpendicular to each other on the plane of the mobile terminal;
重力模块602b,用于分解重力矢量,获得移动终端相对于水平面的俯仰角和侧倾角;a gravity module 602b for decomposing a gravity vector to obtain a pitch angle and a roll angle of the mobile terminal with respect to a horizontal plane;
方位角模块604,还用于根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。The azimuth module 604 is further configured to calibrate the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and the two axial magnetic field vector scores perpendicular to each other on the horizontal plane; According to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, the corresponding azimuth angle of the magnetic field vector is obtained.
一种存储介质,其特征在于,存储有计算机可读指令,计算机可读指令被处理器执行时,使得处理器执行以下步骤:A storage medium characterized by storing computer readable instructions which, when executed by a processor, cause the processor to perform the following steps:
获取磁传感器检测到的磁场矢量;根据磁场矢量和相应的磁场强度,获取磁场矢量相应的初始方位角;检测当前旋转角速度;根据当前旋转角速度确定补偿角;根据补偿角和初始方位角,进行方位角校准。Obtaining a magnetic field vector detected by the magnetic sensor; acquiring an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength; detecting a current rotational angular velocity; determining a compensation angle according to the current rotational angular velocity; and performing the orientation according to the compensation angle and the initial azimuth Angle calibration.
上述存储介质,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。The above storage medium can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
在一个实施例中,执行根据磁场矢量和相应的磁场强度,获取磁场矢量相应的初始方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the step of acquiring a corresponding initial azimuth of the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength, the computer readable instructions further causing the processor to perform the following steps:
获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角;根据磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。Acquiring the gravity vector detected by the acceleration sensor and/or the rotational angular velocity detected by the gyroscope; according to the magnetic field vector, combining the gravity vector and/or the rotational angular velocity detected by the gyroscope, acquiring the corresponding azimuth of the magnetic field vector; corresponding to the magnetic field vector The magnetic field strength and azimuth angle are selected to satisfy the initial azimuth of the high precision value.
在一个实施例中,执行根据磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the computer readable instructions cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies the high precision value based on the corresponding magnetic field strength and azimuth of the magnetic field vector:
检测磁场矢量当前磁场强度;保存磁场矢量当前磁场强度相应的方位角;Detecting the current magnetic field strength of the magnetic field vector; preserving the azimuth corresponding to the current magnetic field strength of the magnetic field vector;
根据当前磁场强度,确定方位角的精度值;判断方位角的精度值是否是高精度值;若是,则选取方位角为初始方位角;若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。Determining the accuracy value of the azimuth according to the current magnetic field strength; determining whether the accuracy value of the azimuth angle is a high precision value; if yes, selecting the azimuth angle as the initial azimuth angle; if not, the azimuth angle corresponding to the saved historical magnetic field strength In the middle, the azimuth of the high precision value is selected as the initial azimuth.
在一个实施例中,执行根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;分解重力矢量,获得移动终端相对于水平面的俯仰角和侧倾角;根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取磁场矢量相应的方位角。Decomposing the magnetic field vector, obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; decomposing the gravity vector to obtain the elevation angle and the roll angle of the mobile terminal with respect to the horizontal plane; and calibrating the mobile terminal according to the elevation angle and the roll angle The two axial magnetic field vector scores perpendicular to each other on the plane are obtained, and the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane Obtain the corresponding azimuth of the magnetic field vector.
在一个实施例中,执行根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;根据旋转角速度获得移动终端相对于水平面的俯仰角和侧倾角;根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取磁场矢量相应的方位角。Decomposing the magnetic field vector, obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; obtaining the pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane according to the rotational angular velocity; and calibrating the mobile terminal according to the pitch angle and the roll angle The two axial magnetic field vector scores perpendicular to each other on the plane, the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, Obtain the corresponding azimuth of the magnetic field vector.
在一个实施例中,执行根据补偿角和初始方位角,进行方位角校准的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, 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 following steps:
将初始方位角加上补偿角,得到校准后的方位角。The initial azimuth is added to the compensation angle to obtain the azimuth after calibration.
一种计算机设备,其特征在于,包括存储器和处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时,使得处理器执行以下步骤:A computer device, comprising: a memory and a processor, wherein the computer stores computer readable instructions, wherein when the computer readable instructions are executed by the processor, the processor performs the following steps:
获取磁传感器检测到的磁场矢量;根据磁场矢量和相应的磁场强度,获取磁场矢量相应的初始方位角;检测当前旋转角速度;根据当前旋转角速度确定补偿角;根据补偿角和初始方位角,进行方位角校准。Obtaining a magnetic field vector detected by the magnetic sensor; acquiring an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength; detecting a current rotational angular velocity; determining a compensation angle according to the current rotational angular velocity; and performing the orientation according to the compensation angle and the initial azimuth Angle calibration.
上述计算机设备,可以根据获取的磁场矢量和相应的磁场强度,来获取初始方位角,在没有对磁场矢量进行详细分析的情况下,获取精准的初始方位角,提高了获取初始方位角的效率。还可以获取移动终端当前的旋转角速度,获取补偿角,通过补偿角和初始方位角来校准方位角。从而在获取精准的初始方位角后,校准方位角,进而在获取精准的初始方位角效率提高的情况下,提高校准方位角的效率。The above computer device can obtain the initial azimuth angle according to the acquired magnetic field vector and the corresponding magnetic field strength, and obtain a precise initial azimuth without detailed analysis of the magnetic field vector, thereby improving the efficiency of obtaining the initial azimuth. It is also possible to obtain the current rotational angular velocity of the mobile terminal, obtain a compensation angle, and calibrate the azimuth by the compensation angle and the initial azimuth. Thus, after obtaining a precise initial azimuth, the azimuth is calibrated, thereby improving the efficiency of the calibration azimuth while obtaining an accurate initial azimuth efficiency.
在一个实施例中,执行根据磁场矢量和相应的磁场强度,获取磁场矢量相应的初始方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the step of acquiring a corresponding initial azimuth of the magnetic field vector based on the magnetic field vector and the corresponding magnetic field strength, the computer readable instructions further causing the processor to perform the following steps:
获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角;根据磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。Acquiring the gravity vector detected by the acceleration sensor and/or the rotational angular velocity detected by the gyroscope; according to the magnetic field vector, combining the gravity vector and/or the rotational angular velocity detected by the gyroscope, acquiring the corresponding azimuth of the magnetic field vector; corresponding to the magnetic field vector The magnetic field strength and azimuth angle are selected to satisfy the initial azimuth of the high precision value.
在一个实施例中,执行根据磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the computer readable instructions cause the processor to perform the following steps when performing the step of selecting an initial azimuth that satisfies the high precision value based on the corresponding magnetic field strength and azimuth of the magnetic field vector:
检测磁场矢量当前磁场强度;保存磁场矢量当前磁场强度相应的方位角;根据当前磁场强度,确定方位角的精度值;判断方位角的精度值是否是高精度值;若是,则选取方位角为初始方位角;若 否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。Detecting the current magnetic field strength of the magnetic field vector; preserving the azimuth corresponding to the current magnetic field strength of the magnetic field vector; determining the accuracy value of the azimuth angle according to the current magnetic field strength; determining whether the accuracy value of the azimuth angle is a high precision value; if so, selecting the azimuth angle as the initial value Azimuth; if not, the azimuth of the high-precision value is taken as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
在一个实施例中,执行根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;分解重力矢量,获得移动终端相对于水平面的俯仰角和侧倾角;根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取磁场矢量相应的方位角。Decomposing the magnetic field vector, obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; decomposing the gravity vector to obtain the elevation angle and the roll angle of the mobile terminal with respect to the horizontal plane; and calibrating the mobile terminal according to the elevation angle and the roll angle The two axial magnetic field vector scores perpendicular to each other on the plane are obtained, and the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane Obtain the corresponding azimuth of the magnetic field vector.
在一个实施例中,执行根据磁场矢量,结合重力矢量和/或陀螺仪检测到的旋转角速度,获取磁场矢量相应的方位角的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, the step of acquiring a corresponding azimuth of the magnetic field vector in accordance with the magnetic field vector, in conjunction 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 following steps:
分解磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;根据旋转角速度获得移动终端相对于水平面的俯仰角和侧倾角;根据俯仰角和侧倾角校准移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;根据水平面上相互垂直的两个轴向上的磁场矢量分值,获取磁场矢量相应的方位角。Decomposing the magnetic field vector, obtaining the magnetic field vector scores of the two axial directions perpendicular to each other on the plane of the mobile terminal; obtaining the pitch angle and the roll angle of the mobile terminal with respect to the horizontal plane according to the rotational angular velocity; and calibrating the mobile terminal according to the pitch angle and the roll angle The two axial magnetic field vector scores perpendicular to each other on the plane, the two axial magnetic field vector scores perpendicular to each other on the horizontal plane are obtained; according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane, Obtain the corresponding azimuth of the magnetic field vector.
在一个实施例中,执行根据补偿角和初始方位角,进行方位角校准的步骤时,计算机可读指令还使得处理器执行以下步骤:In one embodiment, 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 following steps:
将初始方位角加上补偿角,得到校准后的方位角。The initial azimuth is added to the compensation angle to obtain the azimuth after calibration.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM) 等。One of ordinary skill in the art can understand that all or part of the process of implementing the above embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a non-volatile computer readable storage medium. Wherein, the program, when executed, may include the flow of an embodiment of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be considered as the scope of this manual.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-described embodiments are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, the scope of the invention should be determined by the appended claims.

Claims (11)

  1. 一种方位角校准方法,包括:An azimuth calibration method includes:
    获取磁传感器检测到的磁场矢量;Obtaining a magnetic field vector detected by the magnetic sensor;
    根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角;Obtaining a corresponding initial azimuth of the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength;
    检测当前旋转角速度;Detecting the current rotational angular velocity;
    根据所述当前旋转角速度确定补偿角;Determining a compensation angle according to the current rotational angular velocity;
    根据所述补偿角和所述初始方位角,进行方位角校准。Azimuth calibration is performed based on the compensation angle and the initial azimuth.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角,包括:The method according to claim 1, wherein the obtaining an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and the corresponding magnetic field strength comprises:
    获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;Obtaining a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
    根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角;Obtaining a corresponding azimuth of 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;
    根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。Based on the corresponding magnetic field strength and azimuth of the magnetic field vector, an initial azimuth angle that satisfies a high precision value is selected.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角,包括:The method according to claim 2, wherein said selecting an initial azimuth angle that satisfies a high-precision value according to a corresponding magnetic field strength and azimuth of said magnetic field vector comprises:
    检测所述磁场矢量当前磁场强度;Detecting a current magnetic field strength of the magnetic field vector;
    保存所述磁场矢量当前磁场强度相应的方位角;Preserving an azimuth corresponding to the current magnetic field strength of the magnetic field vector;
    根据所述当前磁场强度,确定所述方位角的精度值;Determining an accuracy value of the azimuth angle according to the current magnetic field strength;
    判断所述方位角的精度值是否是高精度值;Determining whether the accuracy value of the azimuth is a high precision value;
    若是,则选取所述方位角为初始方位角;If yes, the azimuth is selected as the initial azimuth;
    若否,则从已保存的历史磁场强度相应的方位角中,选取高精度值的方位角为初始方位角。If not, the azimuth of the high-precision value is selected as the initial azimuth from the azimuth corresponding to the saved historical magnetic field strength.
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述 磁场矢量相应的方位角,包括:The method according to claim 2, wherein the acquiring the azimuth of 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, includes :
    分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane;
    根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
    根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
  5. 根据权利要求2所述的方法,其特征在于,所述根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角,还包括:The method according to claim 2, wherein said acquiring azimuth of said magnetic field vector according to said magnetic field vector in combination with said gravity vector and/or said rotational angular velocity detected by said gyroscope include:
    分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;Decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions 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 with respect to a horizontal plane according to the rotational angular velocity;
    根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;Calibrating the two axial magnetic field vector scores perpendicular to each other on the plane of the mobile terminal according to the pitch angle and the roll angle, and obtaining magnetic field vector scores of two axial directions perpendicular to each other on the horizontal plane;
    根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。Obtaining azimuth angles corresponding to the magnetic field vectors according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
  6. 根据权利要求1至4中任一项所述的方法,所述根据所述补偿角和所述初始方位角,进行方位角校准,包括:The method according to any one of claims 1 to 4, wherein performing the azimuth calibration according to the compensation angle and the initial azimuth comprises:
    将所述初始方位角加上所述补偿角,得到校准后的方位角。The initial azimuth is added to the compensation angle to obtain a calibrated azimuth.
  7. 一种方位角校准装置,包括:An azimuth calibration device comprising:
    传感器模块,用于获取磁传感器检测到的磁场矢量;a sensor module for acquiring a magnetic field vector detected by the magnetic sensor;
    方位角模块,用于根据所述磁场矢量和相应的磁场强度,获取所述磁场矢量相应的初始方位角;An azimuth module, configured to acquire an initial azimuth corresponding to the magnetic field vector according to the magnetic field vector and a corresponding magnetic field strength;
    所述传感器模块,还用于检测当前旋转角速度;The sensor module is further configured to detect a current rotational angular velocity;
    补偿角模块,用于根据所述当前旋转角速度确定补偿角;a compensation angle module, configured to determine a compensation angle according to the current rotational angular velocity;
    校准模块,用于根据所述补偿角和所述初始方位角,进行方位角校准。And a calibration module, configured to perform azimuth calibration according to the compensation angle and the initial azimuth.
  8. 根据权利要求7所述的装置,其特征在于,所述传感器模块,还用于获取加速度传感器检测到的重力矢量和/或陀螺仪检测到的旋转角速度;The device according to claim 7, wherein the sensor module is further configured to acquire a gravity vector detected by the acceleration sensor and/or a rotational angular velocity detected by the gyroscope;
    所述方位角模块,还用于根据所述磁场矢量,结合所述重力矢量和/或所述陀螺仪检测到的旋转角速度,获取所述磁场矢量相应的方位角;The azimuth module is further configured to acquire an azimuth 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 also includes:
    精度值模块,用于根据所述磁场矢量相应的磁场强度和方位角,选取满足高精度值的初始方位角。The precision value module is configured to select an initial azimuth angle that satisfies a high precision value according to the magnetic field strength and the azimuth angle corresponding to the magnetic field vector.
  9. 根据权利要求8所述的装置,其特征在于,所述传感器模块包括:The device according to claim 8, wherein the sensor module comprises:
    磁场模块,用于分解所述磁场矢量,获得移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值;a magnetic field module for decomposing the magnetic field vector to obtain magnetic field vector scores in two axial directions perpendicular to each other on a plane where the mobile terminal is located;
    重力模块,用于分解所述重力矢量,获得所述移动终端相对于水平面的俯仰角和侧倾角;a gravity module, configured to decompose the gravity vector to obtain a pitch angle and a roll angle of the mobile terminal with respect to a horizontal plane;
    所述方位角模块,还用于根据所述俯仰角和侧倾角校准所述移动终端所在平面上相互垂直的两个轴向上的磁场矢量分值,得到水平面上相互垂直的两个轴向上的磁场矢量分值;根据所述水平面上相互垂直的两个轴向上的磁场矢量分值,获取所述磁场矢量相应的方位角。The azimuth module is further configured to calibrate two axial magnetic field vector values perpendicular to each other on a plane of the mobile terminal according to the pitch angle and the roll angle, and obtain two axial directions perpendicular to each other on the horizontal plane. The magnetic field vector score; the corresponding azimuth of the magnetic field vector is obtained according to the two axial magnetic field vector scores perpendicular to each other on the horizontal plane.
  10. 一种存储介质,其特征在于,存储有计算机可读指令,所述计算机可读指令被处理器执行时,使得所述处理器执行权利要求1至5中任意一项所述的方法。A storage medium characterized by storing computer readable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 5.
  11. 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时, 使得所述处理器执行权利要求1至5中任意一项所述的方法。A computer device, comprising: a memory and a processor, wherein the memory stores computer readable instructions that, when executed by the processor, cause the processor to perform claim 1 The method of any of 5.
PCT/CN2018/091821 2017-06-19 2018-06-19 Azimuth calibration method and apparatus, storage medium and computer device WO2018233601A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2018233601A1 true WO2018233601A1 (en) 2018-12-27

Family

ID=60428086

Family Applications (1)

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

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
CN110770539A (en) * 2018-07-26 2020-02-07 深圳市大疆创新科技有限公司 Magnetic sensor calibration method, 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
CN114034318A (en) * 2021-11-23 2022-02-11 歌尔科技有限公司 Sound box calibration control method, device, equipment and readable storage medium

Citations (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
CN102674156A (en) * 2011-03-16 2012-09-19 霍尼韦尔国际公司 Crane jib attitude and heading reference system and method
CN103002208A (en) * 2011-09-08 2013-03-27 索尼公司 Electronic device and image pickup apparatus
CN103969700A (en) * 2013-01-31 2014-08-06 雅马哈株式会社 Method of estimating offset of magnetic sensor
CN104296776A (en) * 2013-07-15 2015-01-21 霍尼韦尔国际公司 System and method for magnetometer calibration and compensation
CN107421523A (en) * 2017-06-19 2017-12-01 深圳市万普拉斯科技有限公司 Azimuth calibration method, apparatus, storage medium and computer equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4034039B2 (en) * 2000-10-16 2008-01-16 電通企工株式会社 mobile phone
KR100561860B1 (en) * 2004-02-04 2006-03-16 삼성전자주식회사 Method and apparatus for finding earth magnetic field and azimuth angle of a body using compass
JP5640716B2 (en) * 2010-12-15 2014-12-17 ソニー株式会社 Information processing apparatus and information processing system
US9495018B2 (en) * 2011-11-01 2016-11-15 Qualcomm Incorporated System and method for improving orientation data
CN102620725B (en) * 2012-03-16 2015-02-11 惠州Tcl移动通信有限公司 Method for calibrating compasses of mobile devices

Patent Citations (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
CN102674156A (en) * 2011-03-16 2012-09-19 霍尼韦尔国际公司 Crane jib attitude and heading reference system and method
CN103002208A (en) * 2011-09-08 2013-03-27 索尼公司 Electronic device and image pickup apparatus
CN103969700A (en) * 2013-01-31 2014-08-06 雅马哈株式会社 Method of estimating offset of magnetic sensor
CN104296776A (en) * 2013-07-15 2015-01-21 霍尼韦尔国际公司 System and method for magnetometer calibration and compensation
CN107421523A (en) * 2017-06-19 2017-12-01 深圳市万普拉斯科技有限公司 Azimuth calibration method, apparatus, storage medium and computer equipment

Also Published As

Publication number Publication date
CN107421523A (en) 2017-12-01
CN107421523B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
WO2018233601A1 (en) Azimuth calibration method and apparatus, storage medium and computer device
US8370097B2 (en) Calibration techniques for an electronic compass in portable device
CN103941309B (en) Geomagnetic sensor calibrator (-ter) unit and its method
CN106840205B (en) Gyroscope calibration compensation method and device and virtual reality head-mounted equipment
US8838403B2 (en) Method and system for a self-calibrated multi-magnetometer platform
JP2006300880A (en) Inclination sensor, and azimuth measuring device using this
CN110567491B (en) Initial alignment method and device of inertial navigation system and electronic equipment
US20160223335A1 (en) Information processing device, information processing method, and computer-readable non-transitory storage medium storing information processing program
US10310132B2 (en) Absolute vector gravimeter and methods of measuring an absolute gravity vector
EP3091335B1 (en) Calibration of temperature effect on magnetometer
CN104597273B (en) A kind of test method and equipment of movement velocity
TWI555994B (en) Dynamically calibrating magnetic sensors
Novakova et al. Modern methods in structural geology of twenty-first century: Digital mapping and digital devices for the field geology
JP2005061969A (en) Azimuthal angle measuring instrument and azimuthal angle measuring method
Markovič et al. Calibration of a solid-state magnetic compass using angular-rate information from low-cost sensors
CN110736484A (en) Background magnetic field calibration method based on fusion of gyroscope and magnetic sensor
JPWO2014115848A1 (en) Rotation information calculation method, rotation information calculation program, magnetic gyroscope and moving body
US9097523B2 (en) Compass calibration
US10794698B2 (en) Method and apparatus for indicating direction
JP5817163B2 (en) State estimation device, electronic device, and program
CN113063447B (en) Gyroscope calibration method and device, readable storage medium and electronic equipment
CN113758515B (en) Zero calibration method, zero calibration device, electronic equipment and computer-readable storage medium
JP2012132713A (en) State estimation device, state estimation method, and state estimation program
JP2008216266A (en) Rotary angle measuring instrument and method
US20160169673A1 (en) Offset calculation circuit and azimuth sensor using the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18820521

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC , EPO FORM 1205A DATED 15.05.2020.

122 Ep: pct application non-entry in european phase

Ref document number: 18820521

Country of ref document: EP

Kind code of ref document: A1