Magnetic sensor calibration method, device and electronic equipment
By automatically calibrating the geomagnetic sensor by calculating the angle and magnetic field data of the electronic device, the problem of inaccurate navigation caused by magnetic interference of the geomagnetic sensor is solved, and a convenient calibration process is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2026-03-17
AI Technical Summary
Geomagnetic sensors are susceptible to magnetic interference, which can lead to inaccurate navigation directions. Current technology requires users to perform cumbersome operations such as shaking the device for calibration.
By acquiring the yaw, pitch, rotation, magnetic tilt angles, and Earth's magnetic field strength of electronic devices, standard triaxial magnetic field data is calculated, and calibration is performed based on the triaxial magnetic field deviation values to prevent users from shaking the device.
It enables rapid calibration of geomagnetic sensors without requiring users to shake the device, thus improving calibration convenience.
Smart Images

Figure CN119148252B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic equipment technology, specifically relating to a geomagnetic sensor calibration method, device, and electronic equipment. Background Technology
[0002] With the rapid development of mobile internet technology and the upgrading of electronic device hardware configurations, electronic devices are becoming increasingly feature-rich. Functions such as compasses and map navigation are widely used in users' daily lives, greatly facilitating their travel. Navigation functions, including current location confirmation and electronic compasses, utilize measurement data from geomagnetic sensors. For example, providing navigation direction for pedestrians is based on the fusion calculation of measurement data from geomagnetic sensors, gyroscopes, and accelerometers. Therefore, ensuring the accuracy of geomagnetic sensor measurement data is crucial.
[0003] However, geomagnetic sensors are easily affected by magnetic interference in daily life. For example, when multiple electronic devices are placed together, it can lead to inaccurate navigation directions. In related technologies, when the geomagnetic sensor of an electronic device is subjected to magnetic interference, if the user wants to obtain accurate navigation directions, it is necessary to perform certain modifications on the electronic device. Figure 1 The trajectory shown is a shaking motion, with the starting point at point A and the ending point at point B. The electronic device is shaken repeatedly along this trajectory to calibrate its geomagnetic sensor. This operation is quite cumbersome. Summary of the Invention
[0004] The purpose of this application is to provide a geomagnetic sensor calibration method, apparatus, and electronic device, which can improve the convenience of geomagnetic sensor calibration in electronic devices.
[0005] In a first aspect, embodiments of this application provide a geomagnetic sensor calibration method, the method comprising:
[0006] When the geomagnetic sensor of the electronic device is detected to be subject to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and the strength of the Earth's magnetic field of the electronic device are obtained.
[0007] Based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength, determine the current standard three-axis magnetic field data of the electronic device;
[0008] Based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data, the triaxial magnetic field deviation value of the geomagnetic sensor is determined;
[0009] The geomagnetic sensor is calibrated based on the triaxial magnetic field deviation value.
[0010] Secondly, embodiments of this application provide a geomagnetic sensor calibration device, the device comprising:
[0011] The acquisition module is used to acquire the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and Earth's magnetic field strength of the electronic device when the geomagnetic sensor of the electronic device is detected to be subjected to magnetic interference.
[0012] The first determining module is used to determine the current standard three-axis magnetic field data of the electronic device based on the yaw angle, the pitch angle, the rotation angle, the magnetic tilt angle, and the Earth's magnetic field strength.
[0013] The second determining module is used to determine the triaxial magnetic field deviation value of the geomagnetic sensor based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data.
[0014] The first calibration module is used to calibrate the geomagnetic sensor based on the triaxial magnetic field deviation value.
[0015] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the geomagnetic sensor calibration method as described in the first aspect.
[0016] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the geomagnetic sensor calibration method as described in the first aspect.
[0017] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the geomagnetic sensor calibration method as described in the first aspect.
[0018] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the geomagnetic sensor calibration method as described in the first aspect.
[0019] In this embodiment, when magnetic interference is detected in the geomagnetic sensor of the electronic device, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength of the electronic device are acquired. Based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength, the current standard triaxial magnetic field data of the electronic device are determined. Based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data, the triaxial magnetic field deviation value of the geomagnetic sensor is determined. Based on the triaxial magnetic field deviation value, the geomagnetic sensor is calibrated, enabling calibration of the geomagnetic sensor without the user shaking the electronic device, thus improving the convenience of geomagnetic sensor calibration. Attached Figure Description
[0020] Figure 1 This is an example diagram of a geomagnetic sensor calibration method in related technologies;
[0021] Figure 2 This is an example diagram of the northeast coordinate system provided in the embodiments of this application;
[0022] Figure 3 This is one of the flowcharts of a geomagnetic sensor calibration method provided in the embodiments of this application;
[0023] Figure 4 This is the second flowchart of a geomagnetic sensor calibration method provided in the embodiments of this application;
[0024] Figure 5 This is a structural block diagram of a geomagnetic sensor calibration device provided in an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0026] Figure 7 This is a schematic diagram of the hardware structure of an electronic device that implements the various embodiments of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0029] First, some concepts and application scenarios involved in the embodiments of this application will be introduced.
[0030] I. Concept
[0031] A geomagnetic sensor is a sensor that measures the Earth's magnetic field, also known as an "electronic compass." The measurement data from a geomagnetic sensor includes three-axis magnetic field data: the magnetic intensity values along the X, Y, and Z axes in the body's coordinate system. The X-axis runs horizontally from left to right along the short side of the screen; the Y-axis runs vertically from the bottom left corner of the screen to the top; and the Z-axis points towards the sky when the body is placed horizontally.
[0032] An accelerometer is a sensor that measures acceleration. The measurement data of an accelerometer includes triaxial acceleration data, which are the acceleration values in the X-axis, Y-axis and Z-axis directions in the body coordinate system.
[0033] A gyroscope sensor is a sensor that measures angular velocity. The measurement data from a gyroscope sensor includes three-axis angular velocity data, which are the angular velocity values along the X, Y, and Z axes in the body coordinate system.
[0034] Euler angles, introduced by Leonhard Euler, are three angles (yaw, pitch, roll) used to describe the orientation of a rigid body relative to a fixed coordinate system. They can also represent the orientation of a moving reference frame in physics or the orientation of a basis in three-dimensional linear algebra. Specifically, yaw refers to the angle of rotation about the Z-axis, pitch refers to the angle of rotation about the Y-axis, and roll refers to the angle of rotation about the X-axis. These three angles allow control of an object's rotation and determination of its orientation.
[0035] The Northeast-Northeast (ENU) coordinate system refers to a coordinate system with the origin to the due east, due north, and directly above the Earth's surface as the three positive axes. The ENU coordinate system is also known as the station center coordinate system or the station coordinate system.
[0036] The Northeast Equation (NED) coordinate system refers to a coordinate system with the origin at due north, due east, and due down as the three positive axes. The NED coordinate system and the ENU coordinate system are essentially two sides of the same coin. For example... Figure 2 As shown, in the NED coordinate system, the X-axis represents geographic north, the Y-axis represents geographic east, the Z-axis represents the direction perpendicular to the Earth's horizontal plane and points towards the Earth's center; B represents the Earth's magnetic field, and the angle between it and the horizontal plane XOY is the magnetic inclination angle, denoted by β.
[0037] II. Application Scenarios
[0038] Currently, the compass and map navigation functions of electronic devices are widely used in users' daily lives, bringing great convenience to their travel. Both the current location confirmation and the electronic compass in navigation functions utilize measurement data from geomagnetic sensors. For example, providing navigation direction for pedestrians is calculated by fusing measurement data from geomagnetic sensors, gyroscopes, and accelerometers.
[0039] Users habitually use electronic devices with magnetic materials in their daily lives, such as Bluetooth headsets, magnetic device cases, and near-field communication devices. These materials can easily cause magnetic interference to the geomagnetic sensors of electronic devices. When the geomagnetic sensor of an electronic device is subjected to magnetic interference, it cannot accurately obtain the three-axis magnetic field data of the Earth's magnetic field. In this case, if the user uses a map navigation function, the navigation direction will be incorrect, resulting in incorrect navigation. In related technologies, when the geomagnetic sensor of an electronic device is subjected to magnetic interference, if the user wants to obtain accurate navigation direction, they need to shake the electronic device multiple times to calibrate the geomagnetic sensor. The trajectory of the user shaking the electronic device is as follows: Figure 1 As shown, the operation is rather cumbersome.
[0040] To address the aforementioned technical problems, embodiments of this application provide a geomagnetic sensor calibration method, apparatus, and electronic device.
[0041] The geomagnetic sensor calibration method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0042] It should be noted that the geomagnetic sensor calibration method provided in this application embodiment is applicable to electronic devices. In practical applications, the electronic device may include terminals such as smartphones and tablets, and this application embodiment does not limit this.
[0043] Figure 3 This is one of the flowcharts of a geomagnetic sensor calibration method provided in the embodiments of this application, such as... Figure 3 As shown, the method may include the following steps: step 301, step 302, step 303 and step 304;
[0044] In step 301, if the geomagnetic sensor of the electronic device is detected to be subject to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and the strength of the Earth's magnetic field of the electronic device are obtained.
[0045] In this embodiment of the application, it is possible to detect in real time whether the geomagnetic sensor of the electronic device is subject to magnetic interference. If magnetic interference is detected, five parameters are obtained: the current yaw angle, pitch angle, roll angle, magnetic tilt angle (β), and the strength of the Earth's magnetic field (B) of the electronic device.
[0046] In this embodiment of the application, when detecting whether the geomagnetic sensor of an electronic device is subject to magnetic interference, the following detection steps can be adopted: acquiring the measurement data of the geomagnetic sensor of the electronic device, which includes: the magnetic intensity value of the X-axis, the magnetic intensity value of the Y-axis, and the magnetic intensity value of the Z-axis; calculating the current comprehensive magnetic intensity value based on the above measurement data; if the comprehensive magnetic intensity value is greater than the reference intensity value, it is determined that the electronic device is subject to magnetic interference. The reference intensity value can be determined based on the current geographical location information of the electronic device, or it can be determined based on the recent comprehensive magnetic intensity value of the electronic device. This embodiment of the application does not limit this.
[0047] In some embodiments, considering that the measurement data of the gyroscope sensor is accurate when the gyroscope sensor has just been calibrated, the measurement data of the gyroscope sensor and the measurement data of the accelerometer sensor can accurately calculate the Euler angles (yaw angle, pitch angle, rotation angle), and accordingly, the above step 301 may include the following steps: step 3011, step 3012 and step 3013.
[0048] In step 3011, a first duration is obtained between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyroscope sensor of the electronic device was last calibrated.
[0049] In this embodiment of the application, the first duration is the duration difference between the second moment and the first moment.
[0050] In this embodiment, considering that gyroscope sensors have zero-bias errors such as temperature drift, and that these errors accumulate over time, accurate measurement data from the gyroscope sensor requires periodic calibration. A calibrated gyroscope sensor can output accurate triaxial angular velocity data within a short period after calibration. The accurate yaw, pitch, and rotation angles of the electronic device are determined by combining accurate measurement data from the gyroscope sensor and the accelerometer. Therefore, it is necessary to calculate the time difference between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyroscope sensor was last calibrated. This time difference is used to determine the accuracy of the gyroscope sensor's measurement data. If the time difference is less than a first threshold, it indicates that the gyroscope sensor was recently calibrated, and the output measurement data is accurate. If the time difference is greater than or equal to the first threshold, it indicates that the gyroscope sensor has accumulated some errors, and the output measurement data is likely inaccurate. The first threshold is a pre-set time threshold.
[0051] In this embodiment, the most recent calibration of the gyroscope sensor of the electronic device can be based on the user shaking the electronic device, or it can be achieved through other means, such as calibration using the measurement data of the calibrated geomagnetic sensor and the measurement data of the accelerometer sensor. This embodiment does not limit this.
[0052] In step 3012, if the first duration is less than the first threshold, the yaw angle, pitch angle and rotation angle are determined based on the measurement data of the gyroscope sensor and the measurement data of the accelerometer sensor of the electronic device.
[0053] In this embodiment, if the first duration is less than the first threshold, it indicates that the gyroscope sensor has only recently been calibrated. At this time, the measurement data output by the gyroscope sensor is accurate. Based on the measurement data from the gyroscope sensor and the accelerometer, the current yaw angle, pitch angle, and rotation angle of the electronic device can be accurately determined. In practical applications, any algorithm from related technologies can be used, combining the measurement data from the gyroscope sensor and the accelerometer, to determine the yaw angle, pitch angle, and rotation angle of the electronic device. This embodiment does not limit this approach.
[0054] In step 3013, the magnetic tilt angle and the strength of the Earth's magnetic field are determined based on the measurement data from the geomagnetic sensor and the gyroscope sensor.
[0055] In this embodiment, to reduce computational complexity, the magnetic tilt angle and the Earth's magnetic field strength can be estimated independently using measurement data from a geomagnetic sensor. Alternatively, to ensure the accuracy of the calculation results, the magnetic tilt angle and the Earth's magnetic field strength can also be estimated by combining measurement data from a geomagnetic sensor and a gyroscope sensor. In this case, the gyroscope sensor measurement data needs to be accurate to ensure that the calculated magnetic tilt angle and the Earth's magnetic field strength are relatively accurate.
[0056] It should be noted that although the geomagnetic sensor is subject to magnetic interference, the inaccurate measurement data from the geomagnetic sensor may fail to estimate the magnetic tilt angle and the strength of the Earth's magnetic field. If the estimation is successful, the magnetic tilt angle and the strength of the Earth's magnetic field will be obtained, and in this case, the magnetic tilt angle and the strength of the Earth's magnetic field are considered to be relatively accurate.
[0057] In this embodiment, if the first duration is less than the first threshold, it indicates that the gyroscope sensor has only recently been calibrated. At this time, the measurement data output by the gyroscope sensor is accurate. Based on the measurement data from the geomagnetic sensor and the gyroscope sensor, the current magnetic tilt angle and the Earth's magnetic field strength of the electronic device can be estimated relatively accurately. In practical applications, any algorithm from related technologies can be used, combining the measurement data from the geomagnetic sensor and the gyroscope sensor, to estimate the current magnetic tilt angle and the Earth's magnetic field strength of the electronic device. This embodiment does not limit this approach.
[0058] As can be seen, in the embodiments of this application, during the current calibration process, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and the strength of the Earth's magnetic field of the electronic device can be obtained when the electronic device is stationary, without shaking the electronic device.
[0059] In other embodiments, considering that the measurement data of the gyroscope is inaccurate when the gyroscope sensor is not calibrated, but the measurement data of the accelerometer sensor is accurate, and the measurement data of the accelerometer sensor can accurately determine the pitch angle and rotation angle, accordingly, the above step 301 may include the following steps: step 3014, step 3015, step 3016 and step 3017.
[0060] In step 3014, a first duration is obtained between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyroscope sensor of the electronic device was last calibrated.
[0061] In step 3015, if the first duration is greater than or equal to the first threshold, the angle input by the user is determined as the yaw angle.
[0062] In this embodiment, if the first duration is greater than or equal to the first threshold, it indicates that the gyroscope sensor has accumulated some errors, and the measurement data output by the gyroscope sensor is likely to be inaccurate. Considering the influence of gyroscope sensor errors, if the user obtains the true yaw angle of the electronic device through other means, the true yaw angle can be input into the electronic device, and the electronic device will determine the yaw angle input by the user as the current yaw angle of the electronic device.
[0063] In step 3016, the pitch angle and rotation angle are determined based on the measurement data from the accelerometer of the electronic device.
[0064] In this embodiment, considering that pitch and rotation angles can be calculated by combining measurement data from an accelerometer and a gyroscope, or by calculating them solely from accelerometer data, the accuracy of the gyroscope data cannot be determined. Therefore, to ensure the accuracy of the calculation results, the current pitch and rotation angles of the electronic device are determined based on the accelerometer data. In practical applications, any algorithm from related technologies can be used to determine the current pitch and rotation angles of the electronic device based on the accelerometer data; this embodiment does not limit this approach.
[0065] In step 3017, the magnetic tilt angle and the strength of the Earth's magnetic field are determined based on the measurement data from the geomagnetic sensor.
[0066] In this embodiment, considering that the magnetic tilt angle and the Earth's magnetic field strength can be estimated by combining the measurement data from a geomagnetic sensor and a gyroscope sensor, or by estimating solely from the geomagnetic sensor's measurement data, in cases where the accuracy of the gyroscope sensor's measurement data cannot be determined, the current magnetic tilt angle and the Earth's magnetic field strength of the electronic device are estimated based on the geomagnetic sensor's measurement data to ensure the accuracy of the calculation results. In practical applications, any algorithm from related technologies can be used to estimate the current magnetic tilt angle and the Earth's magnetic field strength of the electronic device based on the geomagnetic sensor's measurement data; this embodiment does not limit this approach.
[0067] As can be seen, in the embodiments of this application, in the current calibration process, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and the strength of the Earth's magnetic field of the electronic device can be determined even when the measurement data of the gyroscope sensor is inaccurate and the electronic device is in a stationary state, without the user shaking the electronic device.
[0068] In step 302, the current standard three-axis magnetic field data of the electronic device are determined based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and the strength of the Earth's magnetic field.
[0069] In this embodiment of the application, the measurement data of the geomagnetic sensor is also triaxial magnetic field data. However, due to magnetic interference, the measurement data of the geomagnetic sensor is inaccurate triaxial magnetic field data.
[0070] In this embodiment of the application, a relatively accurate triaxial magnetic field data, namely standard triaxial magnetic field data, can be estimated based on the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and the strength of the Earth's magnetic field of the electronic device.
[0071] In some embodiments, step 302 may include the following steps: step 3021, step 3022, step 3023 and step 3024;
[0072] In step 3021, the three-axis magnetic field data in the first reference coordinate system are determined based on the yaw angle, magnetic tilt angle and the strength of the Earth's magnetic field. The first reference coordinate system is the northeast-northeast coordinate system.
[0073] For example, the yaw angle is denoted as θ, the magnetic tilt angle as β, and the Earth's magnetic field strength as B. According to formula (1), the three-axis magnetic field data in the northeast coordinate system can be calculated. in, The superscript "NED" indicates the northeast-northeast coordinate system, the subscript "x" indicates the magnetic field value in the X-axis direction, and the superscript "n" indicates that it is consistent with the northeast-northeast coordinate system.
[0074]
[0075] In step 3022, the three-axis magnetic field data of the electronic device in the first reference coordinate system are determined based on the pitch angle, rotation angle, and three-axis magnetic field data in the first reference coordinate system.
[0076] For example, the pitch angle is denoted as ρ, the rotation angle as γ, and the three-axis magnetic field data in the northeast coordinate system are: According to formula (2), the three-axis magnetic field data of the electronic device in the northeast coordinate system can be calculated.
[0077]
[0078] In step 3023, based on the coordinate transformation relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, the three-axis magnetic field data of the electronic device in the second reference coordinate system are determined, wherein the second reference coordinate system is the northeast-sky coordinate system.
[0079] In this embodiment of the application, considering that the three-axis magnetic field data calculated in step 3022 is in the northeast-northeast coordinate system, while the electronic device uses the northeast-northeast coordinate system, the two need to be converted by a rotation matrix.
[0080] For example, the triaxial magnetic field data of the electronic device in the first reference coordinate system is: The rotation matrix is denoted as The three-axis magnetic field data of the electronic device in the second reference coordinate system can be calculated using formula (3). in, The superscript "ENU" indicates the Northeast Celestial coordinate system, and the subscript "x" indicates the magnetic field value in the X-axis direction.
[0081]
[0082] In step 3024, the triaxial magnetic field data of the electronic device in the second reference coordinate system is determined as the current standard triaxial magnetic field data of the electronic device.
[0083] As can be seen, in this embodiment of the application, only simple coordinate system transformation and matrix calculation are required to determine the current standard three-axis magnetic field data of the electronic device based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle and the strength of the Earth's magnetic field. The calculation process is relatively simple and fast, thereby reducing the amount of computing resources occupied by the electronic device during the calibration process and improving the calibration speed.
[0084] In step 303, the triaxial magnetic field deviation value of the geomagnetic sensor is determined based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data.
[0085] In this embodiment of the application, the triaxial magnetic field deviation value of the geomagnetic sensor refers to the value of magnetic interference.
[0086] In this embodiment, the relatively accurate standard triaxial magnetic field data estimated is used to calculate the triaxial magnetic field deviation value of the geomagnetic sensor by subtracting the inaccurate measurement data of the geomagnetic sensor.
[0087] For example, the triaxial magnetic field strength value in the measurement data of the geomagnetic sensor is denoted as (uncaliMag). x ,uncaliMag y ,uncaliMag z Standard triaxial magnetic field data is denoted as According to formula (4), the triaxial magnetic field deviation value (magOffset) of the geomagnetic sensor can be calculated. x ,magOffset y,magOffset z ).
[0088]
[0089] In step 304, the geomagnetic sensor is calibrated based on the triaxial magnetic field deviation value.
[0090] For example, during subsequent use, the triaxial magnetic field strength value measured in real time by the geomagnetic sensor is (uncaliMag) x ,uncaliMag y ,uncaliMag z The triaxial magnetic field deviation value (magOffset) of the geomagnetic sensor x ,magOffset y ,magOffset z According to formula (5), the triaxial magnetic field strength value of the calibrated geomagnetic sensor can be calculated as (caliMag). x caliMag y and caliMag z ).
[0091]
[0092] As can be seen from the above embodiments, in this embodiment, when the geomagnetic sensor of the electronic device is detected to be subjected to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength of the electronic device are obtained; based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength, the current standard triaxial magnetic field data of the electronic device are determined; based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data, the triaxial magnetic field deviation value of the geomagnetic sensor is determined; based on the triaxial magnetic field deviation value, the geomagnetic sensor is calibrated, so that the geomagnetic sensor can be calibrated without the user shaking the electronic device, thus improving the convenience of geomagnetic sensor calibration.
[0093] Figure 4 This is a second flowchart of a geomagnetic sensor calibration method provided in the embodiments of this application, as shown below. Figure 4 As shown, the method may include the following steps: step 401, step 402, step 403, step 404 and step 405;
[0094] In step 401, when the geomagnetic sensor of the electronic device is detected to be subjected to magnetic interference, a first duration is obtained between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyroscope sensor of the electronic device was last calibrated. If the first duration is less than a first threshold, the yaw angle, pitch angle and rotation angle are determined based on the measurement data of the gyroscope sensor and the measurement data of the accelerometer sensor of the electronic device; the magnetic tilt angle and the strength of the Earth's magnetic field are determined based on the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
[0095] In step 402, the current standard triaxial magnetic field data of the electronic device are determined based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and the strength of the Earth's magnetic field.
[0096] In step 403, the triaxial magnetic field deviation value of the geomagnetic sensor is determined based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data.
[0097] In step 404, the geomagnetic sensor is calibrated based on the triaxial magnetic field deviation value.
[0098] The content of steps 401 to 404 in the embodiments of this application is the same as that of... Figure 1 The steps 301 to 304 in the illustrated embodiment are similar and will not be repeated here.
[0099] In step 405, if the second duration between the current time and the second time is equal to the first threshold, the gyroscope sensor is calibrated based on the measurement data of the calibrated geomagnetic sensor and the measurement data of the accelerometer sensor.
[0100] In this embodiment of the application, if the second duration between the current time and the second time is equal to the first threshold, it indicates that the error of the gyroscope sensor has accumulated to a certain extent and the measurement data of the gyroscope sensor has become inaccurate. At this time, in order to ensure the accuracy of the measurement data of the gyroscope sensor, the gyroscope sensor is calibrated based on the measurement data of the calibrated geomagnetic sensor and the measurement data of the accelerometer sensor.
[0101] In this embodiment, the accurate yaw angle can be calculated based on the measurement data of the calibrated geomagnetic sensor, and the accurate pitch and rotation angles of the electronic device in a stationary state can be calculated based on the measurement data of the accelerometer sensor. The gyroscope sensor can be calibrated using the calculated accurate yaw, pitch, and rotation angles.
[0102] As can be seen, in this embodiment, the gyroscope sensor can be calibrated using the calibrated geomagnetic sensor measurement data and the accelerometer measurement data to eliminate the error of the gyroscope sensor, so that the gyroscope sensor outputs accurate measurement data. The geomagnetic sensor can then be calibrated based on the accurate measurement data of the gyroscope sensor. This forms a dynamic mutual calibration between the geomagnetic sensor and the gyroscope sensor when the electronic device is stationary, improving the convenience of calibrating the geomagnetic sensor and the gyroscope sensor.
[0103] In some other embodiments provided in this application, the gyroscope sensor can be calibrated based on the first action of the user shaking the electronic device before the first moment when the geomagnetic sensor is subjected to magnetic interference.
[0104] In this embodiment of the application, in the initial case, that is, when calibrating the gyroscope sensor for the first time, the user can manually shake the electronic device to complete the calibration of the gyroscope sensor, and then the geomagnetic sensor and the gyroscope sensor are mutually calibrated through cooperation.
[0105] As can be seen, in this embodiment of the application, the process of calibrating the geomagnetic sensor can be initiated by shaking the electronic device only once, which reduces the number of times the device needs to be shaken and improves the convenience of geomagnetic sensor calibration.
[0106] The geomagnetic sensor calibration method provided in this application can be executed by a geomagnetic sensor calibration device. This application uses a geomagnetic sensor calibration device executing the geomagnetic sensor calibration method as an example to illustrate the geomagnetic sensor calibration device provided in this application.
[0107] Figure 5 This is a structural block diagram of a geomagnetic sensor calibration device provided in an embodiment of this application, as shown below. Figure 5 As shown, the geomagnetic sensor calibration device 500 may include the following modules: an acquisition module 501, a first determination module 502, a second determination module 503, and a first calibration module 504;
[0108] The acquisition module 501 is used to acquire the current yaw angle, pitch angle, rotation angle, magnetic tilt angle and Earth's magnetic field strength of the electronic device when the geomagnetic sensor of the electronic device is detected to be subjected to magnetic interference.
[0109] The first determining module 502 is used to determine the current standard three-axis magnetic field data of the electronic device based on the yaw angle, the pitch angle, the rotation angle, the magnetic tilt angle and the Earth's magnetic field strength.
[0110] The second determining module 503 is used to determine the triaxial magnetic field deviation value of the geomagnetic sensor based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data.
[0111] The first calibration module 504 is used to calibrate the geomagnetic sensor based on the triaxial magnetic field deviation value.
[0112] As can be seen from the above embodiments, in this embodiment, when the geomagnetic sensor of the electronic device is detected to be subjected to magnetic interference, the current yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength of the electronic device are obtained; based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength, the current standard triaxial magnetic field data of the electronic device are determined; based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data, the triaxial magnetic field deviation value of the geomagnetic sensor is determined; based on the triaxial magnetic field deviation value, the geomagnetic sensor is calibrated, so that the geomagnetic sensor can be calibrated without the user shaking the electronic device, thus improving the convenience of geomagnetic sensor calibration.
[0113] Optionally, as an embodiment, the acquisition module 501 may include:
[0114] The first acquisition submodule is used to acquire a first duration between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyroscope sensor of the electronic device was last calibrated;
[0115] The first determining submodule is used to determine the yaw angle, the pitch angle, and the rotation angle based on the measurement data of the gyroscope sensor and the measurement data of the accelerometer sensor of the electronic device when the first duration is less than a first threshold.
[0116] The second determining submodule is used to determine the magnetic tilt angle and the Earth's magnetic field strength based on the measurement data from the geomagnetic sensor and the gyroscope sensor.
[0117] Optionally, as an embodiment, the geomagnetic sensor calibration device 500 may further include:
[0118] The second calibration module is used to calibrate the gyroscope sensor based on the measurement data of the calibrated geomagnetic sensor and the measurement data of the accelerometer sensor when the second time interval between the current time and the second time interval is equal to the first threshold.
[0119] Optionally, as an embodiment, the geomagnetic sensor calibration device 500 may further include:
[0120] The third calibration module is used to calibrate the gyroscope sensor before the first moment, based on the user's first action of shaking the electronic device.
[0121] Optionally, as an embodiment, the acquisition module 501 may include:
[0122] The second acquisition submodule is used to acquire the first duration between the first moment when the geomagnetic sensor is subjected to magnetic interference and the second moment when the gyroscope sensor of the electronic device was last calibrated;
[0123] The third determining submodule is used to determine the angle input by the user as the yaw angle when the first duration is greater than or equal to the first threshold.
[0124] The fourth determining submodule is used to determine the pitch angle and the rotation angle based on the measurement data from the accelerometer of the electronic device.
[0125] The fifth determining submodule is used to determine the magnetic tilt angle and the Earth's magnetic field strength based on the measurement data from the geomagnetic sensor.
[0126] Optionally, as an embodiment, the first determining module 502 may include:
[0127] The sixth determining submodule is used to determine the three-axis magnetic field data in the first reference coordinate system based on the yaw angle, the magnetic tilt angle and the Earth's magnetic field strength, wherein the first reference coordinate system is the northeast-northeast coordinate system;
[0128] The seventh determining submodule is used to determine the three-axis magnetic field data of the electronic device in the first reference coordinate system based on the pitch angle, the rotation angle and the three-axis magnetic field data in the first reference coordinate system.
[0129] The eighth determining submodule is used to determine the three-axis magnetic field data of the electronic device in the second reference coordinate system based on the coordinate transformation relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, wherein the second reference coordinate system is the northeast-sky coordinate system;
[0130] The ninth determination submodule is used to determine the triaxial magnetic field data of the electronic device in the second reference coordinate system as the current standard triaxial magnetic field data of the electronic device.
[0131] The geomagnetic sensor calibration device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0132] The geomagnetic sensor calibration device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0133] The geomagnetic sensor calibration device provided in this application embodiment can achieve... Figure 3 or Figure 4 To avoid repetition, the various processes implemented in the method embodiment shown will not be described again here.
[0134] Optionally, such as Figure 6 As shown, this application embodiment also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores a program or instructions that can run on the processor 601. When the program or instructions are executed by the processor 601, they implement the various steps of the above-described geomagnetic sensor calibration method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0135] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0136] Figure 7 This is a schematic diagram of the hardware structure of an electronic device that implements the various embodiments of this application.
[0137] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.
[0138] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0139] The processor 710 is configured to, upon detecting magnetic interference to the geomagnetic sensor of an electronic device, acquire the current yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength of the electronic device; determine the current standard triaxial magnetic field data of the electronic device based on the yaw angle, pitch angle, rotation angle, magnetic tilt angle, and Earth's magnetic field strength; determine the triaxial magnetic field deviation value of the geomagnetic sensor based on the measurement data of the geomagnetic sensor and the standard triaxial magnetic field data; and calibrate the geomagnetic sensor based on the triaxial magnetic field deviation value.
[0140] As can be seen, in this embodiment of the application, the geomagnetic sensor can be calibrated without the user shaking the electronic device, which improves the convenience of geomagnetic sensor calibration.
[0141] Optionally, as an embodiment, the processor 710 is specifically configured to acquire a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device was last calibrated;
[0142] If the first duration is less than a first threshold, the yaw angle, the pitch angle, and the rotation angle are determined based on the measurement data from the gyroscope sensor and the accelerometer sensor of the electronic device; the magnetic tilt angle and the Earth's magnetic field strength are determined based on the measurement data from the geomagnetic sensor and the gyroscope sensor.
[0143] Optionally, as an embodiment, the processor 710 is further configured to calibrate the gyroscope sensor based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the accelerometer sensor when the second duration between the current time and the second time is equal to the first threshold.
[0144] Optionally, as an embodiment, the processor 710 is also configured to calibrate the gyroscope sensor before the first moment, based on the user's first action of shaking the electronic device.
[0145] Optionally, as an embodiment, the processor 710 is specifically configured to acquire a first duration between a first moment when the geomagnetic sensor is subjected to magnetic interference and a second moment when the gyroscope sensor of the electronic device was last calibrated;
[0146] If the first duration is greater than or equal to the first threshold, the angle input by the user is determined as the yaw angle; the pitch angle and the rotation angle are determined based on the measurement data of the acceleration sensor of the electronic device; and the magnetic tilt angle and the Earth's magnetic field strength are determined based on the measurement data of the geomagnetic sensor.
[0147] Optionally, as an embodiment, the processor 710 is specifically used to determine three-axis magnetic field data in a first reference coordinate system based on the yaw angle, the magnetic tilt angle and the Earth's magnetic field strength, wherein the first reference coordinate system is the northeast-northeast coordinate system;
[0148] Based on the pitch angle, the rotation angle, and the three-axis magnetic field data in the first reference coordinate system, the three-axis magnetic field data of the electronic device in the first reference coordinate system are determined.
[0149] Based on the coordinate transformation relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, the three-axis magnetic field data of the electronic device in the second reference coordinate system are determined, wherein the second reference coordinate system is the northeast-sky coordinate system;
[0150] The triaxial magnetic field data of the electronic device in the second reference coordinate system is determined as the current standard triaxial magnetic field data of the electronic device.
[0151] It should be understood that, in this embodiment, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0152] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SynchlinkDRAM, SLDRAM), and direct memory bus RAM (DRRAM). The memory 709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0153] Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 710.
[0154] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described geomagnetic sensor calibration method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0155] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0156] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described geomagnetic sensor calibration method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0157] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0158] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described geomagnetic sensor calibration method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0159] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0160] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0161] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A geomagnetic sensor calibration method, characterized by, The method comprises: In the case of detecting that the geomagnetic sensor of the electronic device is interfered by magnetism, acquiring the current yaw angle, pitch angle, roll angle, magnetic inclination angle and earth magnetic field intensity of the electronic device; According to the yaw angle, the pitch angle, the roll angle, the magnetic inclination angle and the earth magnetic field intensity, determining the current standard three-axis magnetic field data of the electronic device; According to the measurement data of the geomagnetic sensor and the standard three-axis magnetic field data, determining the three-axis magnetic field deviation value of the geomagnetic sensor; Based on the three-axis magnetic field deviation value, calibrating the geomagnetic sensor; The method further comprises: According to the yaw angle, the magnetic inclination angle and the earth magnetic field intensity, determining the three-axis magnetic field data in the first reference coordinate system, wherein the first reference coordinate system is the North-East-Ground coordinate system; According to the pitch angle, the roll angle and the three-axis magnetic field data in the first reference coordinate system, determining the three-axis magnetic field data of the electronic device in the first reference coordinate system; According to the coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system, and the three-axis magnetic field data of the electronic device in the first reference coordinate system, determining the three-axis magnetic field data of the electronic device in the second reference coordinate system, wherein the second reference coordinate system is the East-North-Sky coordinate system; Determining the three-axis magnetic field data of the electronic device in the second reference coordinate system as the current standard three-axis magnetic field data of the electronic device.
2. The method of claim 1, wherein, The method further comprises: Acquiring the first time length between the first time when the geomagnetic sensor is interfered by magnetism and the second time when the gyroscope sensor of the electronic device is calibrated last time; In the case that the first time length is less than a first threshold, determining the yaw angle, the pitch angle and the roll angle according to the measurement data of the gyroscope sensor and the measurement data of the acceleration sensor of the electronic device, and determining the magnetic inclination angle and the earth magnetic field intensity according to the measurement data of the geomagnetic sensor and the measurement data of the gyroscope sensor.
3. The method of claim 2, wherein, The method further comprises: In the case that the second time length between the current time and the second time is equal to the first threshold, calibrating the gyroscope sensor based on the measurement data of the calibrated geomagnetic sensor and the measurement data of the acceleration sensor.
4. The method of claim 2, wherein, The method further comprises: Before the first time, calibrating the gyroscope sensor according to the first action of shaking the electronic device by the user.
5. The method of claim 1, wherein, The method further comprises: acquire a first duration between a first time when the geomagnetic sensor is interfered by a magnetic field and a second time when a gyroscope sensor of the electronic device is calibrated last time; in a case where the first duration is greater than or equal to a first threshold, determine the yaw angle as an input angle of a user, determine the pitch angle and the roll angle according to measurement data of an acceleration sensor of the electronic device, and determine the inclination angle and the earth magnetic field strength according to measurement data of the geomagnetic sensor.
6. A geomagnetic sensor calibration apparatus characterized by comprising: The apparatus comprises: an acquisition module configured to acquire a current yaw angle, a pitch angle, a roll angle, an inclination angle and an earth magnetic field strength of the electronic device in a case where it is detected that a geomagnetic sensor of the electronic device is interfered by a magnetic field; a first determination module configured to determine standard three-axis magnetic field data of the electronic device according to the yaw angle, the pitch angle, the roll angle, the inclination angle and the earth magnetic field strength; a second determination module configured to determine a three-axis magnetic field deviation value of the geomagnetic sensor according to measurement data of the geomagnetic sensor and the standard three-axis magnetic field data; a first calibration module configured to calibrate the geomagnetic sensor based on the three-axis magnetic field deviation value; the first determination module comprises: a sixth determination sub-module configured to determine three-axis magnetic field data in a first reference coordinate system according to the yaw angle, the inclination angle and the earth magnetic field strength, wherein the first reference coordinate system is a North-East-Ground coordinate system; a seventh determination sub-module configured to determine three-axis magnetic field data of the electronic device in the first reference coordinate system according to the pitch angle, the roll angle and the three-axis magnetic field data in the first reference coordinate system; an eighth determination sub-module configured to determine three-axis magnetic field data of the electronic device in a second reference coordinate system according to a coordinate conversion relationship between the first reference coordinate system and the second reference coordinate system and the three-axis magnetic field data of the electronic device in the first reference coordinate system, wherein the second reference coordinate system is a North-East-Sky coordinate system; a ninth determination sub-module configured to determine the three-axis magnetic field data of the electronic device in the second reference coordinate system as the standard three-axis magnetic field data of the electronic device.
7. The apparatus of claim 6, wherein, the acquisition module comprises: a first acquisition sub-module configured to acquire a first duration between a first time when the geomagnetic sensor is interfered by a magnetic field and a second time when a gyroscope sensor of the electronic device is calibrated last time; a first determination sub-module configured to determine the yaw angle, the pitch angle and the roll angle according to measurement data of the gyroscope sensor and measurement data of an acceleration sensor of the electronic device in a case where the first duration is less than a first threshold; a second determination sub-module configured to determine the inclination angle and the earth magnetic field strength according to measurement data of the geomagnetic sensor and measurement data of the gyroscope sensor.
8. The apparatus of claim 7, wherein, The apparatus further comprises: The second calibration module is configured to, when a second time length between the current time and the second time is equal to the first threshold, calibrate the gyroscope sensor based on the calibrated measurement data of the geomagnetic sensor and the measurement data of the acceleration sensor.
9. The apparatus of claim 7, wherein, The device further comprises: The third calibration module is configured to, before the first time, calibrate the gyroscope sensor according to a first action of the user shaking the electronic device.
10. The apparatus of claim 6, wherein, The acquisition module comprises: The second acquisition sub-module is configured to acquire a first time length between a first time when the geomagnetic sensor is disturbed by a magnetic field and a second time when the gyroscope sensor of the electronic device is calibrated last time; The third determination sub-module is configured to, when the first time length is greater than or equal to a first threshold, determine the input angle of the user as the yaw angle; The fourth determination sub-module is configured to determine the pitch angle and the roll angle according to the measurement data of the acceleration sensor of the electronic device; The fifth determination sub-module is configured to determine the magnetic inclination angle and the earth magnetic field strength according to the measurement data of the geomagnetic sensor.
11. An electronic device, comprising: The electronic device comprises a processor and a memory, the memory stores programs or instructions capable of running on the processor, and the programs or instructions are executed by the processor to implement the steps of the geomagnetic sensor calibration method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Geomagnetic vector measurement error calibration method with combination of element restriction and summation restriction
CN105785477A
Automatic calibration method and system for geomagnetic sensor, medium and computer
CN118209134A