Device posture detection method, device, electronic device and computer storage medium

By combining observation data of gyroscope, accelerometer and magnetometer for attitude update and error correction, the problem of inaccurate attitude detection in the prior art is solved, and higher attitude detection accuracy and stability are achieved.

CN114322991BActive Publication Date: 2025-05-16ALIBABA INNOVATION PRIVATE LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111673722.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-05-16
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In the prior art, in equipment attitude detection, due to the influence of errors of sensors such as gyroscopes, accelerometers and magnetometers, attitude detection is inaccurate.

Method used

By combining observation data from gyroscope, accelerometer and magnetometer, attitude update, vertical error correction and horizontal error correction are performed separately to achieve accurate acquisition of attitude information.

Benefits of technology

It improves the accuracy and stability of posture detection, reduces the dependence on paired observation data, and is suitable for situations where data frequency is inconsistent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114322991B_ABST
    Figure CN114322991B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, electronic device and computer storage medium for detecting the posture of a device. A method for detecting the posture of a device, wherein the device is equipped with a gyroscope, an accelerometer and a magnetometer, and the method comprises: obtaining the posture update information of the device according to the gyroscope observation data at the kth moment and the acquired posture information; correcting the vertical error in the posture update information according to the accelerometer observation data output by the accelerometer and the acquired cumulative vertical error, and / or correcting the horizontal error in the posture update information according to the magnetometer observation data output by the magnetometer and the acquired cumulative horizontal error; determining the posture information of the device according to the corrected vertical error and / or horizontal error. This method can accurately detect the posture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of positioning technology, and in particular to a device posture detection method, device, electronic device and computer storage medium. Background Art

[0002] In navigation scenarios, the real-time and accuracy of positioning are important factors that affect navigation results. Especially in AR (Augmented Reality) navigation scenarios, AR technology makes navigation more intuitive so as to help guide users to reach their destinations more quickly. In the AR navigation process, the image acquisition position and posture (angle) of the image acquisition device are calculated in real time, and combined with the corresponding images, videos, or 3D models collected, the virtual guidance information is superimposed on the image of the real environment on the screen, thereby realizing interaction with the user.

[0003] The prior art calculates the attitude of the device according to the observation data output by the gyroscope, accelerometer and magnetometer when determining the attitude of the device. However, the problem with this method is that the gyroscope, accelerometer and magnetometer are all affected by errors, resulting in errors in the attitude calculated according to the observation data output by them, making the attitude detection inaccurate. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a posture detection solution for a device to at least partially solve the above-mentioned problem.

[0005] According to a first aspect of an embodiment of the present application, a posture detection method for a device is provided, wherein the device is equipped with a gyroscope, an accelerometer and a magnetometer, and the method comprises: obtaining posture update information of the device according to gyroscope observation data at the kth moment and the acquired posture information; correcting the vertical error in the posture update information according to accelerometer observation data output by the accelerometer and the acquired cumulative vertical error, and / or correcting the horizontal error in the posture update information according to magnetometer observation data output by the magnetometer and the acquired cumulative horizontal error; determining the posture information of the device according to the corrected vertical error and / or horizontal error.

[0006] According to a second aspect of an embodiment of the present application, a posture detection device for a device is provided, and the device is applied to a device equipped with a gyroscope, an accelerometer and a magnetometer, and the device includes: an updating module, used to obtain posture update information of the device according to gyroscope observation data at the kth moment and the acquired posture information; a correction module, used to correct the vertical error in the posture update information according to the accelerometer observation data output by the accelerometer and the acquired cumulative vertical error, and / or, correct the horizontal error in the posture update information according to the magnetometer observation data output by the magnetometer and the acquired cumulative horizontal error; a determination module, used to determine the posture information of the device according to the corrected vertical error and / or horizontal error.

[0007] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.

[0008] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0009] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, which, when executed by a processor, implements the method described in the first aspect.

[0010] According to the attitude detection solution provided in the embodiment of the present application, the attitude information of the device is updated based on the gyroscope observation data to obtain the attitude update information, and the vertical error of the attitude update information is corrected based on the accelerometer observation data and the accumulated vertical error, and / or the horizontal error of the attitude update information is corrected based on the magnetometer observation data and the accumulated horizontal error. In this way, the decoupling correction of the horizontal error and the vertical error is achieved, and the gyroscope observation data, the accelerometer observation data and the magnetometer observation data are all fused separately, and correction can be performed without paired observation data, which reduces the dependence and can be applied to the situation where the data frequency is inconsistent. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0012] Figure 1 A flowchart of a method for detecting a posture of a device according to Embodiment 1 of the present application;

[0013] Figure 2A A flowchart of a method for detecting a posture of a device according to Embodiment 2 of the present application;

[0014] Figure 2B for Figure 2A A schematic diagram of a usage scenario in the illustrated embodiment;

[0015] Figure 2C for Figure 2A A schematic diagram of a coordinate system for initializing posture information;

[0016] Figure 2D for Figure 2A A schematic diagram of cumulative error update in a usage scenario of the embodiment shown in FIG.

[0017] Figure 3 This is a structural block diagram of a posture detection device of a device according to Embodiment 3 of the present application;

[0018] Figure 4 This is a schematic diagram of the structure of an electronic device according to the fourth embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0020] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0021] Embodiment 1

[0022] Reference Figure 1 , showing a step flow chart of the posture detection method of the device of Example 1 of the present application.

[0023] In this embodiment, the method can be applied to a device equipped with an accelerometer, a magnetometer, and a gyroscope. The accelerometer, the magnetometer, the gyroscope, etc. can collect observation data to detect the posture information of the device.

[0024] The method comprises the following steps:

[0025] Step S102: obtaining attitude update information of the device according to the gyroscope observation data at the kth moment and the acquired attitude information.

[0026] The gyroscope observation data can be used to indicate the angular velocity of the device. By integrating the angular velocity with time, the angle of motion within a certain period of time can be calculated, and the attitude update information (i.e., new attitude information) can be obtained by combining the angle with the acquired attitude information.

[0027] When integrating the angular velocity, the smaller the integration time, the more accurate the output angle. However, the working principle of the gyroscope determines that its measurement reference is itself, without external reference, and the integration time cannot be infinitely small in actual work. Therefore, the cumulative error of the calculated angle will increase rapidly over time, making the attitude update information obtained only based on the gyroscope observation data update inaccurate.

[0028] To solve this problem, the attitude update information can be combined with other observation data to perform error correction to obtain more accurate attitude information.

[0029] Step S104: correcting the vertical error in the attitude update information according to the accelerometer observation data output by the accelerometer and the accumulated vertical error obtained, and / or correcting the horizontal error in the attitude update information according to the magnetometer observation data output by the magnetometer and the accumulated horizontal error obtained.

[0030] In this embodiment, the error is split into horizontal error and vertical error (vertical error can be considered as error in the direction of gravity), wherein the correction of vertical error by accelerometer observation data is in the Lie group space of angle error, while the correction of horizontal error by magnetometer observation data is in angle error. In this way, the decoupling correction of horizontal error and vertical error is realized, which can not only improve the accuracy of the corrected attitude information, but also make the corrected attitude information smooth, without sudden change of attitude information, and can realize error correction without pairing accelerometer observation data and magnetometer observation data, so the data frequency of accelerometer and magnetometer can be appropriately reduced.

[0031] It should be noted that, during calibration, there is no particular order between performing vertical error correction using accelerometer observation data and performing horizontal error correction using magnetometer observation data.

[0032] In one feasible manner, the vertical error correction of the attitude update information can be implemented as follows through the accelerometer observation data and the accumulated vertical error:

[0033] The accelerometer observation data is projected using the attitude update information to map the accelerometer observation data to the world coordinate system. Then, based on the principle that when the device is stationary, it is only affected by gravity and the gravitational acceleration is known, the angle between the projection result of the accelerometer observation data and the gravitational acceleration is determined. The instantaneous vertical error corresponding to the current correction can be determined, and then the vertical error correction is performed on the attitude update information according to the instantaneous vertical error and the accumulated vertical error to obtain the correction result.

[0034] In this embodiment, the accumulated vertical error includes information of historical vertical errors. Therefore, using the accumulated vertical error to perform vertical error correction can avoid the problem of reduced accuracy of attitude information caused by accumulated errors in gyroscope observation data.

[0035] In another feasible manner, the horizontal error of the attitude update information is corrected according to the magnetometer observation data and the acquired accumulated horizontal error, which can be implemented as follows:

[0036] The attitude update information is decomposed, and the horizontal heading information in the attitude update information is removed to obtain the attitude projection result of the attitude update information in the gravity coordinate system. The attitude projection result is used to calculate with the magnetometer observation data to obtain the magnetic field heading angle determined according to the attitude observation data. Since the horizontal heading information is removed from the attitude projection result, it is guaranteed that the obtained magnetic field heading angle will not be affected by the horizontal error in the attitude update information. Based on the magnetic field heading angle and the horizontal heading information, the instantaneous horizontal error corresponding to the current correction can be determined, and then the horizontal error in the attitude update information is corrected according to the instantaneous horizontal error and the accumulated horizontal error, so as to obtain the correction result.

[0037] Step S106: Determine the posture information of the device according to the corrected vertical error and / or horizontal error.

[0038] In a feasible manner, the posture information corresponding to the correction result after the horizontal error correction and / or the vertical error correction can be used as the posture information of the device.

[0039] The following is a description of the posture detection method in combination with a usage scenario:

[0040] In this usage scenario, the application of AHRS (Attitude and Heading Reference System) is used as an example to detect the attitude information of the target device (such as a mobile phone, aircraft, etc.) by referring to the gravity field and magnetic field of the earth through the accelerometer, magnetometer and gyroscope mounted on the device.

[0041] The attitude information includes the device's heading angle (yaw), roll angle (roll), and pitch angle (pitch). In this usage scenario, the device's attitude information can be expressed in the form of attitude quaternions of the device's body coordinate system relative to the world coordinate system. In this usage scenario, the world coordinate system uses the northeast celestial coordinate system. The x-axis of the world coordinate system points to the east, the y-axis points to the north, and the z-axis points to the sky.

[0042] Since the data frequencies of the gyroscope, accelerometer and magnetometer are different, the observation data of the gyroscope, accelerometer and magnetometer can be processed asynchronously. Therefore, for the sake of clarity, the attitude information is updated based on the gyroscope observation data, the vertical error correction of the attitude information is performed based on the accelerometer observation data, and the horizontal error correction of the attitude information is performed based on the magnetometer observation data. Whether the attitude information is updated or corrected, it refers to the new attitude information that can be obtained at the current moment (for the sake of clarity and uniformity, the new attitude information that can be obtained at the current moment is hereinafter referred to as attitude update information).

[0043] The angular velocity ω indicated by the gyroscope observation data at the kth moment can be expressed as [0,ω x ,ω y ,ω z ]. Based on the gyroscope observation data, the attitude update information of the device can be updated to obtain new attitude update information.

[0044] When the accelerometer observation data is obtained, the vertical error of the attitude update information is corrected according to the accelerometer observation data and the accumulated vertical error, so that the attitude update information is more accurate, and the corrected attitude update information can be used as the basis for correction or update at the next moment. And / or, when the magnetometer observation data is received, the attitude update information is decomposed to obtain its attitude projection result in the gravity coordinate system, and then the attitude projection result is used in combination with the magnetometer observation data to determine the observed magnetic field heading angle, and the attitude update information is corrected for the horizontal error according to the magnetic field heading angle and the accumulated horizontal error, and new attitude update information is obtained.

[0045] In this way, the horizontal error and vertical error of the attitude update information can be decoupled and corrected, so the attitude update information can be corrected without paired accelerometer observation data and magnetometer observation data, which improves adaptability. Paired accelerometer observation data and magnetometer observation data refer to the time interval between the two being small enough. Since such paired observation data is not required, this method can be applied to devices with inconsistent accelerometer and magnetometer data frequencies, so it has better applicability.

[0046] Through this embodiment, the attitude information of the device is updated based on the gyroscope observation data to obtain the attitude update information, the vertical error of the attitude update information is corrected based on the accelerometer observation data and the accumulated vertical error, and / or the horizontal error of the attitude update information is corrected based on the magnetometer observation data and the accumulated horizontal error. In this way, the decoupling correction of the horizontal error and the vertical error is achieved, and the gyroscope observation data, the accelerometer observation data and the magnetometer observation data are all fused separately, and correction can be performed without paired observation data, which reduces the dependence and can be applied to situations where the data frequency is inconsistent.

[0047] The method of this embodiment can be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.

[0048] Embodiment 2

[0049] Reference Figure 2A , showing a step flow chart of the posture detection method of the device of Example 2 of the present application.

[0050] In this embodiment, the method can be configured in a device including sensors such as a gyroscope, an accelerometer, and a magnetometer to detect the posture information of the device. Of course, in other embodiments, the method can also be configured on other devices other than the device, obtain the observation data of each sensor by communicating with the device, and determine the posture information of the device based on the observation data.

[0051] Among them, Figure 2B As shown, the method comprises the following steps:

[0052] Step S200: determining the initial posture information of the device relative to the world coordinate system based on the accelerometer observation data and the magnetometer observation data whose observation time difference is less than a set value.

[0053] The accelerometer observation data and magnetometer observation data whose observation time difference is less than or equal to the set value (hereinafter referred to as the matched accelerometer observation data and magnetometer observation data) can be observation data whose data collection time interval is less than or equal to the set value (which can be determined as needed, for example, 1ms, 2ms, 2.5ms, etc., the smaller the set value, the higher the accuracy), and are non-abnormal value observation data.

[0054] For example, if the accelerometer observation data is collected at time t1 and the magnetometer observation data is collected at time t2, and the time interval between time t1 and time t2 is less than 1ms, it can be considered that the observation time difference between the accelerometer observation data and the magnetometer observation data is less than the set value. Since the time difference is small, it is guaranteed that the attitude information of the device changes little when collecting the accelerometer observation data and the magnetometer observation data.

[0055] Since the attitude information of the device changes continuously over time, a pair of accelerometer observation data and magnetometer observation data with a short time interval is required when initializing the attitude information of the device. This can ensure that the accelerometer observation data and the magnetometer observation data reflect the same attitude information, thereby improving the accuracy of initialization.

[0056] When using the received sensor observation data (the sensors include the aforementioned gyroscope, accelerometer and magnetometer), in order to further improve the accuracy and prevent the sensor observation data itself from being an outlier and causing significant interference to data fusion, outlier detection and sensor status detection can be performed on the received sensor observation data.

[0057] Among them, abnormal values ​​include wild values, illegal values, and disorderly jump values. Wild values ​​are, for example, values ​​that deviate greatly from normal values. Illegal values ​​are, for example, "N / A" and "NULL" output when a sensor fails. Disorderly jump values ​​are, for example, values ​​that are inconsistent with the attitude change trend of the device and have a large difference. Since the movement of the device conforms to the law of rigid body movement, the attitude information of the device should be continuous and smoothly changed within a short time interval. If the attitude information shows a sharp jump trend, it indicates that it is an abnormal value.

[0058] State detection includes, for example, high dynamic detection and magnetic field interference detection.

[0059] In high dynamic conditions, the accelerometer direction will not point to the direction of gravity, resulting in low accuracy of the vertical fusion result. The vertical fusion accuracy and the horizontal fusion accuracy are coupled, which will further lead to a decrease in the horizontal fusion accuracy and reduce the accuracy of the attitude information. In order to avoid this problem, high dynamic detection is required.

[0060] A feasible high-dynamic detection method can rely on the difference between the modulus value determined by the accelerometer observation data and the gravity modulus value, and combine the angular velocity modulus value determined by the gyroscope observation data to determine whether it is in high dynamics.

[0061] Magnetic field interference will affect the accuracy of magnetometer observation data. The magnetic field is susceptible to soft magnetic interference and hard magnetic interference, which will cause the magnetic field to deform and the center of the sphere to shift. At this time, horizontal fusion correction will cause the horizontal fusion accuracy to deteriorate, affecting the accuracy of attitude information. In order to avoid this problem, magnetic field interference detection is required.

[0062] A feasible method for detecting magnetic field interference is to determine whether there is magnetic field interference based on the difference between the magnetic field intensity values ​​at different longitudes and latitudes and the magnetic field intensity of the magnetometer observation data, the degree of deviation between the center of the magnetic field ellipsoid fitting determined based on the magnetometer observation data and the set center, and the smoothness of the magnetic field vector change determined by the magnetometer observation data.

[0063] If the sensor observation data received by the detection is not an abnormal value and the state detection passes, the sensor observation data is usable data and can be processed accordingly.

[0064] In the initialization phase, when the matched accelerometer observation data and magnetometer observation data are obtained, the initial attitude information of the device needs to be determined through the AHRS fusion algorithm. For example, the initial attitude information is determined by dual-vector attitude solution, and then the initial attitude information can be corrected based on the acquired observation data to obtain more accurate posture update information. In order to ensure accuracy, the initial attitude information can be re-obtained every period of time.

[0065] The following is an example to illustrate the process of determining the initial posture information:

[0066] When the state detection is not highly dynamic and the magnetic field interference is small, if the device is in a static state, the acceleration vector determined by the accelerometer observation data mainly points to the direction of gravity, and the magnetic vector determined by the magnetometer observation data mainly points to the geomagnetic field. When these two vectors (i.e., the acceleration vector and the magnetic vector) are not collinear, such as Figure 2C As shown, the acceleration vector is represented as v1, and the magnetic force vector is represented as v2. Then their representations in the world coordinate system (t) are respectively and Their representations in the body coordinate system (b) are respectively denoted as and Right now is the acceleration vector indicated by the accelerometer observation data, The magnetic field vector indicated by the magnetometer observation data.

[0067] By introducing auxiliary vectors, the relationship between the world coordinate system and the body coordinate system can be constructed, such as Figure 2C As shown. Based on this relationship, the rotation matrix of the body coordinate system relative to the world coordinate system can be determined The rotation matrix can be used as the initial posture information of the device at the time of initialization. It can be expressed by the acceleration vector and the magnetic force vector as follows, where is the direction of gravity, is the direction of the Earth's magnetic field:

[0068]

[0069] The rotation matrix It can be used as the initialized posture information, which can be corrected later.

[0070] Step S202: obtaining attitude update information of the device according to the gyroscope observation data at the kth moment and the acquired attitude information.

[0071] It should be noted that, in order to ensure accuracy, the gyroscope observation data used to update the attitude information is a non-abnormal value that has passed the detection.

[0072] If the kth moment is the first moment after the initial posture information is obtained, the posture information obtained may be the initial posture information. If the kth moment is not the first moment, the posture information obtained may be the posture information corrected at the previous moment.

[0073] In a feasible manner, based on the high accuracy of the short-time integrated angle of the gyroscope, the acquired attitude information is updated using the angular velocity vector indicated by the gyroscope observation data, thereby obtaining attitude update information. The manner of obtaining the attitude update information is, for example, calculating the tensor product of the acquired attitude information and the gyroscope observation data at the kth moment; and determining the attitude update information according to the tensor product. The attitude update information is used to indicate the mapping attitude of mapping the attitude of the device in the local coordinate system to the time coordinate system, and the attitude update information can be represented by the attitude quaternion of the body coordinate system in the world coordinate system.

[0074] Among them, the gyroscope observation data ω can be expressed as ω=[0,ω x ,ω y ,ω z The acquired attitude information can be expressed as the attitude quaternion of the body coordinate system relative to the world coordinate system. The differential form of updating the attitude information based on the gyroscope observation data is expressed as follows:

[0075]

[0076] in, is the updated attitude quaternion (that is, attitude update information).

[0077] Based on the gyroscope observation data, the attitude quaternion The updated integral form is expressed as follows:

[0078]

[0079] Among them, q(k) is the updated attitude quaternion (that is, attitude update information).

[0080] Subsequently, if the magnetometer observation data is received first and then the accelerometer observation data is received, the magnetometer observation data can be used to perform horizontal error correction on the attitude update information, and then the accelerometer observation data can be used to perform vertical error correction on the attitude update information after the horizontal error correction.

[0081] Alternatively, if the accelerometer observation data is received first and then the magnetometer observation data is received, the accelerometer observation data can be used to perform vertical error correction on the attitude update information, and then the magnetometer observation data can be used to perform horizontal error correction on the attitude update information of the vertical error correction. Since each correction is performed based on a new attitude that can be obtained, for the sake of convenience, the new attitude is collectively referred to as attitude update information.

[0082] The vertical error correction and horizontal error correction are described below:

[0083] Step S204: correcting the vertical error in the attitude update information according to the accelerometer observation data output by the accelerometer and the acquired accumulated vertical error.

[0084] Accelerometer observations may be useful observations for outlier detection and state detection determination.

[0085] like Figure 2D As shown, in one feasible manner, step S204 includes the following sub-steps:

[0086] Sub-step S2041: upon receiving the accelerometer observation data, determining the vertical adjustment parameter according to the number of corrections and the accelerometer observation data.

[0087] The vertical adjustment parameters include the vertical magnification factor K ca , the gain coefficient K of the instantaneous vertical error pa And the gain factor K of the accumulated vertical error ia .

[0088] The vertical magnification factor K ca The value of decreases as the number of corrections increases until the number of corrections reaches a set number, and the vertical magnification factor remains unchanged.

[0089] For example, the vertical magnification factor K of the first correction after initialization is ca is the first set value. The first set value can be set according to the requirements. The vertical magnification factor K increases with each additional correction. ca The value of will reduce the set step size until the number of corrections reaches the set number, and the vertical magnification factor K ca The value of remains the current value.

[0090] Due to the vertical magnification factor K caThe initial value is relatively large, so it can solve the problem that the initial posture information is initialized at a single point and the observation data at the initialization point may have large interference, so that the early stage after initialization can converge quickly.

[0091] The gain coefficient K of the instantaneous vertical error pa and the gain coefficient K of the cumulative vertical error ia They are all negatively correlated with the linear acceleration of the accelerometer observation data.

[0092] Among them, the gain coefficient K of the instantaneous vertical error is pa Used to correct the instantaneous vertical error. The gain factor K of the accumulated vertical error ia Used to correct the accumulated vertical error. Through these gain coefficients, when correcting the updated attitude information, the residual error after the historical state correction of the attitude information can be fully considered, which can not only prevent the influence of wild values ​​on the attitude information of the current correction, but also accelerate the convergence speed when the accumulated vertical error is too large.

[0093] In one possible approach, the gain factor K of the instantaneous vertical error is pa It can be determined based on the linear acceleration indicated by the accelerometer observation data. When the linear acceleration increases, the gain coefficient K of the instantaneous vertical error is pa In this embodiment, the linear acceleration can be input into the instant adjustment function to determine the specific instant vertical error gain coefficient K pa , the instant adjustment function can be determined as needed.

[0094] Gain factor K of cumulative vertical error ia The gain factor K of the instantaneous vertical error pa Similar, the difference is the gain factor K of the accumulated vertical error ia Determined using the corresponding cumulative adjustment function.

[0095] In this way, adaptive adjustment of these coefficients can be achieved.

[0096] Sub-step S2042: Projecting the accelerometer observation data based on the attitude update information to obtain a projection result of the accelerometer observation data.

[0097] When performing vertical error correction, the acceleration vector a indicated by the accelerometer observation data is m , project the accelerometer observation data by the attitude quaternion to obtain the projection result (which represents the acceleration vector a in the world coordinate system) wm ). The projection process can be expressed as:

[0098]

[0099] Sub-step S2043: Determine the error of the projection result of the accelerometer observation data relative to the gravity direction as the instantaneous vertical error corresponding to the current correction.

[0100] In a stationary state, the projection result of the accelerometer observation data should be consistent with the direction of gravity. When the direction of gravity of the earth's magnetic field is known, the acceleration vector a wm By cross-multiplying the gravity vector used to represent the direction of gravity, the instantaneous vertical error r of the attitude quaternion in the Lie algebra space can be obtained. vcur .

[0101] Gravity vector a w It can be expressed as: w =[0,0,-g].

[0102] Instant vertical error r vcur The error of the projection result of the accelerometer observation data relative to the gravity direction can be expressed as: vcur =a wm ×a w .

[0103] Sub-step S2044: correcting the vertical error of the attitude update information according to the instantaneous vertical error, the vertical adjustment parameter and the acquired cumulative vertical error.

[0104] In one example, sub-step S2044 includes the following process:

[0105] Process A1: According to the instantaneous vertical error and the set vertical weight, a smoothing filter process is performed on the acquired cumulative vertical error to obtain the cumulative vertical error corresponding to the current correction.

[0106] The cumulative vertical error can be expressed as: vsm (k) = α*r vsm (k-1)+(1-α)*r vcur .

[0107] Among them, r vsm (k) is the cumulative vertical error corresponding to the current correction.

[0108] α is a vertical weight, which can be determined as needed and is not limited in this embodiment. Its value is between 0 and 1.

[0109] r vsm (k-1) is the existing accumulated vertical error.

[0110] r vcur is the instantaneous vertical error.

[0111] In this way, the cumulative vertical error including historical vertical error information is continuously calculated by means of smoothing filtering.

[0112] Process B1: correcting the vertical error of the attitude update information according to the accumulated vertical error of the current correction, the instantaneous vertical error, the gain coefficient of the instantaneous vertical error, the gain coefficient of the accumulated vertical error and the vertical amplification coefficient.

[0113] In one example, the correction of the vertical error of the attitude update information can be expressed as:

[0114]

[0115] Among them, q vc It is the attitude quaternion (i.e. attitude information) after vertical error correction.

[0116] q v is the updated attitude quaternion.

[0117] Exp() is the exponential function of e.

[0118] K ia is the gain factor of the accumulated vertical error.

[0119] r vsm is the cumulative vertical error corresponding to the current correction.

[0120] K pa is the gain coefficient of the instantaneous vertical error.

[0121] r vcur is the instantaneous vertical error corresponding to the current correction.

[0122] K ca is the vertical magnification factor.

[0123] In this way, through the spatial mapping relationship from Lie algebra to Lie group, the current attitude information is updated based on the instantaneous vertical error and the accumulated vertical error, so that the accuracy of the attitude update information is improved.

[0124] Step S206: Correcting the horizontal error in the attitude update information according to the magnetometer observation data output by the magnetometer and the acquired accumulated horizontal error.

[0125] The magnetometer observation data may be magnetometer observation data that is detected as having no abnormality by state detection and abnormal value detection.

[0126] In one example, step S206 includes the following sub-steps:

[0127] Sub-step S2061: Determine the horizontal adjustment parameters according to the number of corrections and the magnetometer observation data.

[0128] The horizontal adjustment parameters include the horizontal magnification factor K cm , the gain coefficient K of the instantaneous horizontal error pm and the gain factor K of the accumulated horizontal error im .

[0129] The horizontal magnification factor K cm The value of decreases as the number of corrections increases until the number of corrections reaches a set number, and the horizontal magnification factor remains unchanged.

[0130] For example, the horizontal magnification factor K of the first calibration after initialization cm is the second setting value. The second setting value can be set according to the requirements. cm The value of will reduce the set step size until the number of corrections reaches the set number, and the horizontal magnification factor K cm The value of remains the current value.

[0131] Since the horizontal magnification factor K cm The initial value is relatively large, so it can solve the problem that the initial posture information is initialized at a single point and the observation data at the initialization point may have large interference, so that the early stage after initialization can converge quickly.

[0132] The gain coefficient K of the instantaneous horizontal error pm and the gain factor K of the accumulated horizontal error im Both are negatively correlated with the magnetic field interference intensity.

[0133] Among them, the gain coefficient K of the instantaneous horizontal error pm Used to correct the instantaneous horizontal error. The gain factor K of the accumulated horizontal error im Used to correct the accumulated horizontal error. Through these gain coefficients, when correcting the updated posture information, the residual error after the historical state correction of the posture information can be fully considered, which can not only prevent the influence of wild values ​​on the posture information of the current correction, but also accelerate the convergence speed when the accumulated horizontal error is too large.

[0134] In one possible approach, the gain factor K of the instantaneous horizontal error is pm It can be determined according to the intensity of magnetic field interference. As the intensity of magnetic field interference increases, the gain coefficient K of the instantaneous horizontal error increases. pm In this embodiment, the magnetic field interference intensity can be input into the instantaneous level adjustment function to determine the specific instantaneous level error gain coefficient K pm , the instant level adjustment function can be determined as needed.

[0135] Gain factor K of cumulative horizontal errorim The gain factor K of the instantaneous horizontal error pm Similar, except that the gain factor K of the accumulated horizontal error im Determined using the corresponding cumulative level adjustment function.

[0136] In this way, adaptive adjustment of these coefficients can be achieved.

[0137] Sub-step S2062: obtaining a posture projection result of the posture update information in the gravity coordinate system.

[0138] By decomposing the attitude update information and removing the horizontal heading information, the projection quaternion in the gravity coordinate system is obtained as the attitude projection result. It can be expressed as:

[0139]

[0140] in, is the projection quaternion, that is, the result of attitude projection.

[0141] is the updated attitude quaternion, that is, attitude update information.

[0142] The horizontal heading information determined based on the updated attitude quaternion.

[0143] Sub-step S2063: Determine the instantaneous horizontal error corresponding to the current correction according to the attitude projection result, the magnetometer observation data and the horizontal heading information in the attitude update information.

[0144] In one example, sub-step S2063 is implemented by the following process:

[0145] Process A2: Based on the posture projection result, the magnetometer observation posture of the magnetometer observation data mapped to the gravity coordinate system is obtained.

[0146] Through the attitude projection result (i.e., projecting the quaternion in the gravity direction), the quaternion observed by the magnetometer in the body coordinate system indicated by the magnetometer observation data is converted to the gravity coordinate system, and then the magnetic field heading angle is calculated.

[0147] The process can be expressed as:

[0148]

[0149] H hor is the magnetic field yaw angle determined based on magnetometer observation data.

[0150] is the posture projection result.

[0151] Hm The data are from magnetometer observation.

[0152] Process B2: Determine the magnetic field heading angle according to the x-axis projection and y-axis projection of the magnetometer observation data in the gravity coordinate system.

[0153] The determination of the magnetic field heading angle can be expressed as:

[0154] y m =arctan2(H hor .x,H hor .y).

[0155] Among them, y m is the magnetic field heading angle.

[0156] H hor .x is the x-axis projection of the magnetometer observation data in the gravity coordinate system.

[0157] H hor .y is the y-axis projection of the magnetometer observation data in the gravity coordinate system.

[0158] Process C2: determining the instantaneous horizontal error according to the magnetic field heading angle and the horizontal heading information.

[0159] The determination of the instantaneous horizontal error can be expressed as:

[0160] r hcur =y m -y cur .

[0161] Among them, r hcur is the instantaneous horizontal error.

[0162] y m is the magnetic field heading angle.

[0163] y cur is the horizontal heading angle.

[0164] Sub-step S2064: Correcting the horizontal error of the horizontal heading information in the attitude update information according to the instantaneous horizontal error, the horizontal adjustment parameter and the acquired cumulative horizontal error.

[0165] Based on the instantaneous horizontal error and the set horizontal weight, the existing accumulated horizontal error is smoothed and filtered, which can make the attitude information transition smoother and avoid sudden changes in attitude information.

[0166] The process of updating the existing accumulated horizontal error can be expressed as:

[0167] r hsm (k) = β*r hsm(k-1)+(1-β)*r hcur .

[0168] Among them, r hsm (k) is the updated cumulative horizontal error.

[0169] β is the setting level weight.

[0170] r hsm (k-1) is the existing cumulative horizontal error.

[0171] r hcur is the instantaneous horizontal error.

[0172] In this way, the instantaneous horizontal error is calculated by decomposing the horizontal heading angle and the magnetic field heading angle. At the same time, the cumulative horizontal error containing the historical error information is continuously calculated by means of smoothing filtering, so that the subsequent attitude update information is smoother.

[0173] Correcting the horizontal error of the horizontal heading information in the attitude update information can be expressed as:

[0174] y hc =y cur +K cm *(K pm *r hcur +K im *r hsm ).

[0175] Among them, y hc For updated horizontal heading information.

[0176] y cur It is the horizontal heading information determined based on the gyroscope observation data.

[0177] K cm is the horizontal magnification factor.

[0178] K pm is the gain coefficient of the instantaneous horizontal error.

[0179] K im is the gain factor of the accumulated horizontal error.

[0180] The correction result determined based on the horizontal heading information after horizontal error correction is expressed as follows:

[0181]

[0182] Among them, p cur ,r cur ,y cur They are respectively the pitch angle, roll angle and heading angle (i.e. horizontal heading information) before the horizontal correction at the current moment.

[0183] q hc is the attitude quaternion after horizontal error correction.

[0184] Step S208: Determine the posture information of the device according to the corrected vertical error and / or horizontal error.

[0185] In one feasible method, if only the accelerometer observation data is used for calibration, the attitude quaternion corrected by the vertical error can be used as the attitude information; if only the magnetometer observation data is used for calibration, the attitude quaternion corrected by the horizontal error can be used as the attitude information; if both the accelerometer observation data and the magnetometer observation data are involved in the calibration, the attitude quaternion after both the vertical error and the horizontal error are corrected is used as the attitude information.

[0186] In another feasible manner, the corrected attitude quaternion may be converted into corresponding pitch angle, yaw angle, and roll angle as attitude information, which is not limited in this embodiment.

[0187] The method of this embodiment includes a posture information prediction process based on gyroscope observation data, and at the same time, error correction of multiple parameters is performed with reference to accelerometer observation data and magnetometer observation data, taking into account the requirements of fast and smooth convergence.

[0188] Based on the weighting of gyroscope observation data, gain parameters such as Kim and Kia are introduced to comprehensively consider the influence of the historical error correction state, and solve the problem that the integral angle weight of gyroscope observation data caused by weighted averaging at a single moment is large, resulting in cumulative error; if the weight is small, the result is not smooth and the final fusion result is unstable.

[0189] In addition, this method also achieves the following effects:

[0190] The error is corrected directly in the linearized error space, which solves the nonlinear error caused by the Mahony weighted angular velocity, and the short-time Gyroscope angular velocity integral is more accurate, thus improving the accuracy.

[0191] By introducing Kca and Kcm parameters, the convergence speed is improved when the initialization is disturbed. In addition, the data frequency requirement is very low, and the observation data of the magnetometer and accelerometer do not need to form a pair. It supports low-frequency scenarios and can directly perform single-channel fusion when receiving the observation data of any sensor.

[0192] Due to the addition of accelerometer and magnetometer status detection, the attitude results can still remain stable in scenarios such as large linear acceleration and interference with the magnetometer.

[0193] Combined with the detection state of the current state, the gain coefficient is adaptively adjusted according to the linear acceleration and magnetic field interference to improve the robustness of the fusion algorithm and the accuracy of the attitude information.

[0194] Different sensor calibration and angle spaces use different gain coefficients and amplification factors for correction, rather than controlling all errors with just one parameter, which improves accuracy. Error correction is performed directly in the linearized error space, without the need for multiple linearizations and iterations, and the computing power requirement is lower than Madgwick.

[0195] The problem of EKF introducing linearization errors in the quaternion linearization process is solved by directly performing corrections in the Lie group and angle space. There is no need to know the noise coefficient and related model of the sensor. There is no need for repeated state updates and covariance updates, and the algorithm consumes less energy.

[0196] In summary, this method decouples the vertical error correction from the horizontal error correction, and controls the vertical error and horizontal error correction through different gain coefficients and amplification factors. The vertical error correction is in the Lie group linear space, and the horizontal correction is directly in the angle linear space, which will not introduce linearization errors and does not require multiple iterative linearization processes.

[0197] The observation data of any sensor do not need to be teamed up, and a single-channel fusion method can be used. Magnetometer fusion does not require teaming, has low dependence, and has low requirements on the frequency of sensor data. It can be used in scenarios such as unstable frequency and inconsistent frequency. It has strong applicability and a wide range of applications. It can be widely used in the navigation and attitude control of various devices such as mobile phones, drones, and robots.

[0198] Considering that the initialization is single-point initialization and the observation data at the initialization point may have large interference, the two amplification factors Kca and Kcm are adjusted in the early stage after the initialization to accelerate the rapid convergence of the early stage after initialization.

[0199] In addition, it fully combines the high dynamic response of the gyroscope and the low dynamic response of the accelerometer and magnetometer. In high dynamics, the attitude information is mainly updated through the gyroscope observation data, and in low dynamics, the accelerometer observation data and magnetometer observation data are used to correct the gyroscope's integrated cumulative error, making full use of the complementary characteristics of the gyroscope, accelerometer and magnetometer outputs for fusion solution.

[0200] The fusion method combines the idea of ​​residual correction based on optimization to decouple and fuse the states of each axis. Different from the Madgwick method (which requires continuous linearization to obtain the Jacobian and error update through multiple iterations, and the gradient descent method is prone to fall into local optimization or slow oscillation convergence), this method directly decouples the 3DOF attitude fusion in the angle space, transfers it to the horizontal fusion and vertical fusion dimensions, and directly fuses it in the angle error space, which avoids the error introduced by the Mahony method (combining the attitude projection error and controlling the angular velocity integral through negative feedback PID) by directly transferring the attitude projection error to the angular velocity space.

[0201] By detecting the state and dynamically adjusting the error gain coefficient and amplification coefficient, the system can perform better in a variety of environments. This method can be applied to any scenario that requires posture information detection, especially in AR navigation scenarios.

[0202] Through the detected posture information, the virtual guidance information is integrated with the collected real scene, making the interaction more vivid and intuitive. In this way, AR technology can be combined to form a cross-platform indoor and outdoor AR navigation solution to meet the indoor and outdoor AR real scene navigation needs of scenic spots, shopping malls, airports, high-speed rail stations, hospitals, smart parks, and vehicle-mounted scenes. In addition, it can also be applied to vehicle navigation and direction solution of traditional pedestrian navigation, drone navigation control, scale-free AR special effects and other scenes.

[0203] Embodiment 3

[0204] Reference Figure 3 , shows a schematic diagram of the structure of the device posture detection apparatus of Example 3 of the present application.

[0205] The device posture detection device comprises:

[0206] An updating module 302, configured to obtain attitude update information of the device according to the gyroscope observation data at the kth moment and the acquired attitude information;

[0207] A correction module 304, configured to correct a vertical error in the attitude update information according to the accelerometer observation data output by the accelerometer and the accumulated vertical error obtained, and / or to correct a horizontal error in the attitude update information according to the magnetometer observation data output by the magnetometer and the accumulated horizontal error obtained;

[0208] The determination module 306 is used to determine the posture information of the device according to the corrected vertical error and / or horizontal error.

[0209] Optionally, the update module 302 is used to calculate the tensor product of the acquired posture information and the gyroscope observation data at the kth moment; determine the posture update information based on the tensor product, wherein the posture update information of the device is used to indicate the mapping posture of the device in the body coordinate system to the world coordinate system.

[0210] Optionally, the correction module 304 is used to determine a vertical adjustment parameter based on the number of corrections and the accelerometer observation data when receiving the accelerometer observation data; project the accelerometer observation data based on the attitude update information to obtain a projection result of the accelerometer observation data; determine an error of the projection result of the accelerometer observation data relative to the direction of gravity as an instantaneous vertical error corresponding to the current correction; and correct the vertical error of the attitude update information based on the instantaneous vertical error, the vertical adjustment parameter and the acquired cumulative vertical error.

[0211] Optionally, the vertical adjustment parameters include a vertical amplification factor, a gain factor of an instantaneous vertical error, and a gain factor of a cumulative vertical error; the value of the vertical amplification factor decreases as the number of corrections increases until the number of corrections reaches a set number, at which time the vertical amplification factor remains unchanged; the gain factor of the instantaneous vertical error and the gain factor of the cumulative vertical error are both negatively correlated with the linear acceleration of the accelerometer observation data.

[0212] Optionally, the correction module 304 is used to perform smoothing filtering on the acquired cumulative vertical error according to the instantaneous vertical error and the set vertical weight to obtain the cumulative vertical error corresponding to the current correction; and correct the vertical error of the attitude update information according to the cumulative vertical error of the current correction, the instantaneous vertical error, the gain coefficient of the instantaneous vertical error, the gain coefficient of the cumulative vertical error and the vertical amplification coefficient.

[0213] Optionally, the correction module 304 is used to determine a horizontal adjustment parameter based on the number of corrections and the magnetometer observation data; obtain a posture projection result of the posture update information in the gravity coordinate system; determine an instantaneous horizontal error corresponding to the current correction based on the posture projection result, the magnetometer observation data and the horizontal heading information in the posture update information; and correct the horizontal error of the horizontal heading information in the posture update information based on the instantaneous horizontal error, the horizontal adjustment parameter and the acquired cumulative horizontal error.

[0214] Optionally, the correction module 304 is used to obtain the magnetometer observation attitude of the magnetometer observation data mapped to the gravity coordinate system based on the attitude projection result; determine the magnetic field heading angle according to the x-axis projection and y-axis projection of the magnetometer observation data in the gravity coordinate system; and determine the instantaneous horizontal error according to the magnetic field heading angle and the horizontal heading information.

[0215] Optionally, the device further comprises:

[0216] The initialization module 300 is used to determine the initial posture information of the device relative to the world coordinate system based on the accelerometer observation data and the magnetometer observation data whose observation time difference is less than or equal to the set value.

[0217] The device of this embodiment is used to implement the corresponding methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.

[0218] Embodiment 4

[0219] Reference Figure 4 , shows a schematic diagram of the structure of an electronic device according to the fourth embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.

[0220] like Figure 4 As shown, the electronic device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0221] in:

[0222] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .

[0223] The communication interface 404 is used to communicate with other electronic devices or servers.

[0224] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned posture detection method embodiment.

[0225] Specifically, the program 410 may include program codes, which include computer operation instructions.

[0226] The processor 402 may be a processor CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0227] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0228] The program 410 may be specifically used to enable the processor 402 to execute operations corresponding to the aforementioned method.

[0229] According to another aspect of the present application, a computer program product is provided, which implements the aforementioned method when executed by a processor.

[0230] The specific implementation of each step in program 410 can refer to the corresponding description of the corresponding steps and units in the above-mentioned posture detection method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.

[0231] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0232] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and will be stored in a local recording medium, so that the method described here can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (for example, RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the gesture detection method described here is implemented. In addition, when a general-purpose computer accesses a code for implementing the gesture detection method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the gesture detection method shown here.

[0233] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0234] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A method for detecting the posture of a device, wherein: The device is equipped with a gyroscope, an accelerometer and a magnetometer, and the method includes: Obtaining attitude update information of the device according to the gyroscope observation data at the kth moment and the acquired attitude information; According to the accelerometer observation data output by the accelerometer and the accumulated vertical error obtained, the vertical error in the attitude update information is corrected, and / or, according to the magnetometer observation data output by the magnetometer and the accumulated horizontal error obtained, the horizontal error in the attitude update information is corrected; wherein, the correction of the vertical error by the accelerometer observation data is in the Lie group space of the angle error, and the correction of the horizontal error by the magnetometer observation data is in the linear space of the angle error, so as to realize the decoupling correction of the horizontal error and the vertical error; The attitude information of the device is determined according to the corrected vertical error and / or horizontal error.

2. The method according to claim 1, wherein: The step of obtaining the attitude update information of the device according to the gyroscope observation data at the kth moment and the acquired attitude information includes: Calculate the tensor product of the acquired attitude information and the gyroscope observation data at the kth moment; The posture update information is determined according to the tensor product, wherein the posture update information of the device is used to indicate a mapping posture of mapping the posture of the device in the body coordinate system to the world coordinate system.

3. The method according to claim 1, wherein: The correcting the vertical error in the attitude update information according to the accelerometer observation data output by the accelerometer and the acquired accumulated vertical error includes: When receiving the accelerometer observation data, determining the vertical adjustment parameter according to the number of corrections and the accelerometer observation data; Projecting the accelerometer observation data based on the attitude update information to obtain a projection result of the accelerometer observation data; Determine the error of the projection result of the accelerometer observation data relative to the gravity direction as the instantaneous vertical error corresponding to the current correction; The vertical error of the attitude update information is corrected according to the instantaneous vertical error, the vertical adjustment parameter and the acquired cumulative vertical error.

4. The method according to claim 3, wherein: The vertical adjustment parameters include a vertical amplification factor, a gain factor of an instantaneous vertical error, and a gain factor of a cumulative vertical error; The value of the vertical magnification factor decreases as the number of corrections increases, until the number of corrections reaches a set number, at which time the vertical magnification factor remains unchanged; The gain coefficient of the instantaneous vertical error and the gain coefficient of the cumulative vertical error are both negatively correlated with the linear acceleration of the accelerometer observation data.

5. The method according to claim 4, wherein: The correcting the vertical error of the attitude update information according to the instantaneous vertical error, the vertical adjustment parameter and the acquired cumulative vertical error includes: According to the instantaneous vertical error and the set vertical weight, a smoothing filter process is performed on the acquired cumulative vertical error to obtain the cumulative vertical error corresponding to the current correction; The vertical error of the attitude update information is corrected according to the accumulated vertical error of the current correction, the instantaneous vertical error, the gain coefficient of the instantaneous vertical error, the gain coefficient of the accumulated vertical error and the vertical amplification coefficient.

6. The method according to claim 1, wherein: The step of correcting the horizontal error in the attitude update information according to the magnetometer observation data output by the magnetometer and the accumulated horizontal error obtained includes: Determining horizontal adjustment parameters according to the number of corrections and the magnetometer observation data; Obtaining a posture projection result of the posture update information in a gravity coordinate system; Determine the instantaneous horizontal error corresponding to the current correction according to the attitude projection result, the magnetometer observation data and the horizontal heading information in the attitude update information; The horizontal error of the horizontal heading information in the attitude update information is corrected according to the instantaneous horizontal error, the horizontal adjustment parameter and the acquired cumulative horizontal error.

7. The method according to claim 6, wherein: The step of determining the instantaneous horizontal error corresponding to the current correction according to the attitude projection result, the magnetometer observation data and the horizontal heading information in the attitude update information comprises: Based on the posture projection result, obtaining the magnetometer observation posture mapped to the magnetometer observation data in the gravity coordinate system; Determine the magnetic field heading angle according to the x-axis projection and y-axis projection of the magnetometer observation data on the gravity coordinate system; The instantaneous horizontal error is determined according to the magnetic field heading angle and the horizontal heading information.

8. The method according to any one of claims 1 to 7, wherein: Before updating the attitude information of the target object according to the gyroscope observation data at the kth moment, the method further includes: The initial posture information of the device relative to the world coordinate system is determined based on the accelerometer observation data and the magnetometer observation data whose observation time difference is less than or equal to the set value.

9. A device for detecting the posture of a device, the device being applied to a device equipped with a gyroscope, an accelerometer and a magnetometer, the device comprising: An updating module, used to obtain attitude update information of the device according to the gyroscope observation data at the kth moment and the acquired attitude information; A correction module, used for correcting the vertical error in the attitude update information according to the accelerometer observation data output by the accelerometer and the accumulated vertical error obtained, and / or, for correcting the horizontal error in the attitude update information according to the magnetometer observation data output by the magnetometer and the accumulated horizontal error obtained; wherein the correction of the vertical error by the accelerometer observation data is in the Lie group space of the angle error, and the correction of the horizontal error by the magnetometer observation data is in the linear space of the angle error, so as to realize the decoupling correction of the horizontal error and the vertical error; The determination module is used to determine the posture information of the device according to the corrected vertical error and / or horizontal error.

10. A computer stored program product, which, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Attitude angle acquisition method and device and handle

    CN108534744A

  • Police dog gesture recognizing data waistcoat based on multiple sensors and gesture recognizing method

    CN109673529A