IMU attitude resolving method, device and equipment and storage medium
By dynamically updating the gain parameters and error compensation of the Mahony complementary filtering algorithm, the accuracy and stability issues of IMU attitude calculation under different hardware platforms and dynamic environments are resolved, achieving higher attitude calculation accuracy and device stability.
Patent Information
- Application Number
- CN202511397356.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-02-13
AI Technical Summary
Existing IMU attitude calculation algorithms have poor accuracy and stability on different hardware platforms or in dynamic environments, and are prone to causing equipment malfunction or abnormal operation, especially under conditions of violent movement and external vibration.
By acquiring raw IMU data, the gain parameters of the Mahony complementary filter algorithm, including proportional gain and integral gain, are dynamically updated. Differential calculations and maximum difference value filtering are performed based on triaxial acceleration measurements to update the gain parameters. Finally, the triaxial angular velocity values are corrected through error compensation to solve the body attitude information.
It improves the accuracy of attitude calculation, reduces error fluctuations under rapid motion, and enhances the adaptability and stability of the algorithm in different environments.
Smart Images

Figure CN121521158A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of motion control, and in particular to an IMU attitude solving method and device, equipment and a storage medium. BACKGROUND
[0002] In the low-end consumer electronics market of toy balance cars, air mice, and bracelets, in order to control costs, a six-axis inertial measurement unit (IMU, i.e., three-axis accelerometer + three-axis gyroscope) is usually used to obtain attitude angle information, which needs to be processed by an attitude solving algorithm into stable attitude estimation information.
[0003] Currently, high-performance attitude solving algorithms are not open source, and the key parameters (proportional gain Kp and integral gain Ki) of the open-source Mahony complementary filtering algorithm are usually fixed values, which are only optimized for specific sensors or motion states, and are difficult to adapt to different hardware platforms or dynamic environments (such as intense motion, external vibration, etc.). Therefore, in the case of large differences in sensor characteristics or complex motion conditions, the attitude estimation accuracy and stability of the Mahony algorithm will decrease significantly, and even cause the device to lose control or function abnormally. SUMMARY
[0004] The present application provides an IMU attitude solving method, device, equipment and storage medium to solve the technical problem of poor IMU attitude solving accuracy and stability.
[0005] In a first aspect, the present application provides an IMU attitude solving method, comprising: obtaining IMU raw data, the IMU raw data including three-axis acceleration measurement values and three-axis angular velocity measurement values; dynamically updating gain parameters of a Mahony complementary filtering algorithm based on the three-axis acceleration measurement values, the gain parameters including a proportional gain parameter and an integral gain parameter; correcting the three-axis angular velocity measurement values based on the gain parameters to obtain target three-axis angular velocity values; solving body attitude information based on the three-axis acceleration measurement values and the target three-axis angular velocity values.
[0006] In some embodiments, the dynamically updating gain parameters of the Mahony complementary filtering algorithm based on the three-axis acceleration measurement values comprises: calculating three-axis acceleration differential data at each time point based on the three-axis acceleration measurement values, the three-axis acceleration differential data being absolute value data; selecting maximum differential data of the three-axis acceleration differential data at each time point; selecting a maximum value of the maximum differential data at the most recent preset number of consecutive time points; update a gain parameter of the Mahony complementary filter algorithm based on the maximum value.
[0007] In some embodiments, the updating the gain parameter of the Mahony complementary filter algorithm based on the maximum value comprises: comparing the maximum value with a preset value range to determine a motion level corresponding to the maximum value; determining a proportional gain parameter and an integral gain parameter corresponding to the motion level based on a preset gain parameter update table.
[0008] In some embodiments, the correcting the three-axis angular velocity measurement value based on the gain parameter to obtain a target three-axis angular velocity value comprises: obtaining a gravity acceleration measured value and a gravity acceleration predicted value; cross-multiplying the gravity acceleration measured value and the gravity acceleration predicted value to obtain an error value; compensating the error value based on the gain parameter to obtain a compensated error value; correcting the three-axis angular velocity measurement value based on the compensated error value to obtain a target three-axis angular velocity value.
[0009] In some embodiments, the obtaining a gravity acceleration measured value and a gravity acceleration predicted value comprises: obtaining a gravity acceleration measured value in a geodetic coordinate system; converting the gravity acceleration measured value to a gravity acceleration predicted value in a body coordinate system based on a rotation matrix, the rotation matrix being a t-1 time four-element number corresponding to a body attitude, the t-1 time four-element number being obtained by updating a t-2 time four-element number based on a target three-axis angular velocity value at t-1 time.
[0010] In some embodiments, the solving the body attitude information based on the three-axis acceleration measurement value and the target three-axis angular velocity value comprises: updating a target four-element number corresponding to a body attitude at a current time based on the target three-axis angular velocity value; converting the target four-element number to body attitude information based on a preset inverse solution Euler angle formula, the body attitude information including a roll angle, a pitch angle and a heading angle.
[0011] In some embodiments, the target four-element number is obtained by updating a t-1 time four-element number based on a first-order Runge-Kutta method differential equation according to the target three-axis angular velocity value.
[0012] In a second aspect, the application further provides an IMU attitude solving device, comprising: The acquisition module is used to acquire raw IMU data, which includes triaxial acceleration measurements and triaxial angular velocity measurements. The update module is used to dynamically update the gain parameters of the Mahony complementary filter algorithm based on the triaxial acceleration measurement values. The gain parameters include proportional gain parameters and integral gain parameters. The correction module is used to correct the triaxial angular velocity measurement value based on the gain parameter to obtain the target triaxial angular velocity value; The calculation module is used to calculate the body attitude information based on the triaxial acceleration measurement value and the target triaxial angular velocity value.
[0013] Thirdly, this application also provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program, and the computer program, when executed by the processor, implements the above-described IMU attitude calculation method.
[0014] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described IMU attitude calculation method.
[0015] Compared with the prior art, this application has the following beneficial effects: By acquiring raw IMU data, which includes triaxial acceleration measurements and triaxial angular velocity measurements; Based on the triaxial acceleration measurements, the gain parameters of the Mahony complementary filter algorithm are dynamically updated, including proportional gain parameters and integral gain parameters. Based on the gain parameter, the triaxial angular velocity measurement value is corrected to obtain the target triaxial angular velocity value; Based on the triaxial acceleration measurement and the target triaxial angular velocity, the body attitude information is calculated.
[0016] Compared with the prior art, this application has the following beneficial effects: By dynamically updating the proportional gain and integral gain parameters of the Mahony complementary filter algorithm using triaxial acceleration measurements, this method is better adapted to the attitude calculation of the current aircraft. The updated gain parameters are then used to correct the triaxial angular velocity measurements, resulting in more accurate triaxial angular velocity-based attitude calculations. Compared to the traditional Mahony algorithm which uses fixed gain parameters, this method reduces error fluctuations in rapid aircraft motion and improves the accuracy of attitude calculations.
[0017] This application also uses differential operations and filtering of the maximum difference value to update the gain parameter. Compared with the variance operation method, the computational load is smaller, and the gain parameter can be updated quickly, achieving the effect of rapid calibration by combining dynamic and static methods. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the IMU attitude calculation method in an embodiment of this application; Figure 2 This is a schematic diagram of the pitch angle change curves corresponding to the three algorithms shown in the embodiments of this application; Figure 3 As shown in the embodiments of this application Figure 2 A graph showing the motion level magnified 10 times; Figure 4 This is a structural block diagram of the IMU attitude calculation device shown in the embodiments of this application; Figure 5 This is a structural block diagram of an electronic device shown in an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0020] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating an IMU attitude calculation method provided in an embodiment of this application. The IMU attitude calculation method of this application can be applied to electronic devices equipped with an IMU, including but not limited to remote controls, smartphones, laptops, tablets, smart bracelets, and smart VR headsets. Figure 1 As shown, the IMU attitude calculation method in this embodiment includes steps S101 to S104, which are detailed below: Step S101: Obtain raw IMU data, which includes triaxial acceleration measurements and triaxial angular velocity measurements.
[0021] In this step, the raw IMU data is the raw data acquired by the IMU on the machine body. The triaxial acceleration measurement value can be recorded as follows: , , The measured values of the three-axis angular velocity can be recorded as follows: , , .
[0022] Step S102: Based on the triaxial acceleration measurement values, dynamically update the gain parameters of the Mahony complementary filter algorithm, including proportional gain parameters and integral gain parameters.
[0023] In this step, the Mahony complementary filtering algorithm is a correction algorithm based on the IMU system that uses a PID feedback controller to compensate for gyroscope errors. Traditional Mahony algorithms use fixed proportional and integral gain parameters for calculation, which can lead to significant error fluctuations under conditions of rapid body movement. This step uses real-time feedback of the body's motion state from triaxial acceleration measurements and dynamically updates the gain parameters accordingly, making it more suitable for attitude calculation under the current body motion state.
[0024] In some embodiments, step S102 includes: Based on the triaxial acceleration measurements, triaxial acceleration difference data at each time point is calculated, and the triaxial acceleration difference data is absolute value data; The maximum difference data of the triaxial acceleration differential data at each time step was selected; Filter out the maximum value among the maximum difference data at the most recent preset consecutive time points; Based on the maximum value, the gain parameter of the Mahony complementary filtering algorithm is updated.
[0025] In this embodiment, the triaxial acceleration differential data includes X-axis acceleration differential data. Y-axis acceleration difference data Z-axis acceleration difference data For example, the X-axis can be calculated based on the following formula: ,in The X-axis acceleration difference data at time t. The X-axis acceleration measurement value at time t; then from the triaxial acceleration difference data , and Filter out the data with the largest difference at each time point. A sliding window of N is used to filter out the data with the largest difference over the most recent N consecutive time points. The maximum value in the range, for example, if N=6, then the maximum value is: Finally, based on Update the gain parameters of the Mahony algorithm. This embodiment uses differential operations and maximum value filtering to reduce the computational load, enabling rapid updates of the gain parameters and achieving a combined dynamic and static calibration effect.
[0026] Optionally, the maximum value is compared with a preset range of values to determine the motion level corresponding to the maximum value; based on a preset gain parameter update table, the proportional gain parameter and integral gain parameter corresponding to the motion level are determined.
[0027] In this optional embodiment, updating parameters using a preset gain parameter update table can further reduce the computational load. Optionally, the motion level corresponding to the maximum value can be determined based on the preset gain parameter update table, and the proportional gain parameter can be determined as well. and integral gain parameter For example, the preset gain parameter update table is shown in Table 1 below.
[0028] Table 1 Preset Gain Parameter Update Table
[0029] Among them, motion level 0 represents the body in a static state, motion level 1 represents the body in a slow motion state, motion level 2 represents the body in a small-amplitude motion state, and motion level 3 represents the body in a fast motion state.
[0030] Step S103: Based on the gain parameter, correct the triaxial angular velocity measurement value to obtain the target triaxial angular velocity value.
[0031] In this step, the error is compensated based on the gain parameter, and then the compensated error is corrected to the triaxial angular velocity measurement value to obtain the target triaxial angular velocity value.
[0032] In some embodiments, step S103 includes: Obtain measured and predicted values of gravitational acceleration; The error value is obtained by cross-productting the measured value of gravitational acceleration and the predicted value of gravitational acceleration. Based on the gain parameter, the error value is compensated to obtain the compensated error value; Based on the compensation error value, the triaxial angular velocity measurement value is corrected to obtain the target triaxial angular velocity value.
[0033] In this embodiment, optionally, obtaining the measured value and the predicted value of gravitational acceleration includes: obtaining the measured value of gravitational acceleration in the Earth coordinate system; and converting the measured value of gravitational acceleration into the predicted value of gravitational acceleration in the body coordinate system based on a rotation matrix, wherein the rotation matrix is the quaternion at time t-1 corresponding to the body attitude, and the quaternion at time t-1 is obtained by updating the quaternion at time t-2 with the target three-axis angular velocity value at time t-1.
[0034] For example: Initialize quaternion A: ; The raw IMU data is converted into quaternions (for details on the conversion principle, please refer to "Inertial Navigation", Qin Yongyuan, pp. 292-297, the relationship between quaternions and attitude matrices), i.e., the rotation matrix. : ; Using the Earth's center as the navigation coordinate system n, the Mahony algorithm defaults to using only the measured values of gravitational acceleration. (9.8m / s) 2 ),right Unitization: ; The measured values of gravitational acceleration are rotated from the n-frame to the predicted values of gravitational acceleration in the body coordinate system b. : ; Because the gyroscope data (i.e., the three-axis angular velocity measurements) from the IMU are subject to drift, Not exactly equal to Therefore, the error between the two is calculated using the cross product operation. : ; Will and If normalized to 1, then ; when When I was very young, ; Error based on proportional gain parameter and integral gain parameter Compensation is performed to obtain the compensation error value. : ; Finally, the compensation error value is added to the triaxial angular velocity measurement value to obtain the target triaxial angular velocity value. , , For example, the target angular velocity value along the X-axis is: .
[0035] Step S104: Based on the triaxial acceleration measurement value and the target triaxial angular velocity value, calculate the body attitude information.
[0036] In this step, the body attitude information is calculated based on the triaxial acceleration measurement value and the target triaxial angular velocity value after error compensation, so as to eliminate the calculation error and improve the accuracy of attitude estimation.
[0037] In some embodiments, step S104 includes: Based on the target triaxial angular velocity value, update the target quaternion corresponding to the body attitude at the current moment; Based on the preset inverse Euler angle formula, the target quaternion is converted into aircraft attitude information, which includes roll angle, pitch angle and yaw angle.
[0038] In this embodiment, optionally, the target quaternion is obtained by updating the quaternion at time t-1 based on the target triaxial angular velocity value using the first-order Runge-Kutta method micro-powder equation. The expression of the first-order Runge-Kutta method micro-powder equation is as follows: ; Will 、 , Substituting into the above expression, we obtain a new quaternion A; Using the pre-defined inverse Euler angle formula, the roll angle is calculated based on the new quaternion A. Pitch angle and heading angle : .
[0039] As an example, not a limitation, pose calculations were performed using the traditional Mahongy algorithm, a commercial air mouse algorithm, and this method, and the pitch angle changes corresponding to the three algorithms were observed (e.g., Figure 2 As shown). Figure 3 As shown, for Figure 2 The motion levels in the image are magnified 10 times for easier observation. Line L1 represents the motion level, line L2 represents the pitch angle (gain parameter unknown) of the commercial air mouse algorithm, line L3 represents the pitch angle (dynamic gain parameter) of this method, and line L4 represents the pitch angle of the traditional Mahongy algorithm. =3.0, =1.0). By Figure 3 It is evident that the traditional Mahony algorithm exhibits significant fluctuations and deviates from the actual angle during rapid motion. Our proposed method, however, shows waveforms that largely overlap with those of the commercial air mouse algorithm, and converges faster after rapid movement followed by stillness. Therefore, our method demonstrates a substantial improvement in accuracy compared to the traditional Mahony algorithm.
[0040] To implement the IMU attitude calculation method corresponding to the above method embodiments, and to achieve the corresponding functions and technical effects, see [link to documentation]. Figure 4 , Figure 4 This diagram illustrates a structural block diagram of an IMU attitude calculation device according to an embodiment of this application. For ease of explanation, only the parts relevant to this embodiment are shown. The IMU attitude calculation device provided in this embodiment includes: The acquisition module 401 is used to acquire raw IMU data, which includes triaxial acceleration measurements and triaxial angular velocity measurements. Update module 402 is used to dynamically update the gain parameters of the Mahony complementary filter algorithm based on the triaxial acceleration measurement values. The gain parameters include proportional gain parameters and integral gain parameters. The correction module 403 is used to correct the triaxial angular velocity measurement value based on the gain parameter to obtain the target triaxial angular velocity value; The calculation module 404 is used to calculate the body attitude information based on the triaxial acceleration measurement value and the target triaxial angular velocity value.
[0041] In some embodiments, the update module 402 includes: The calculation unit is used to calculate triaxial acceleration difference data at each time point based on the triaxial acceleration measurement values, wherein the triaxial acceleration difference data is absolute value data; The first filtering unit is used to filter out the maximum difference data of the triaxial acceleration difference data at each time moment; The second filtering unit is used to filter out the maximum value among the maximum difference data at the most recent preset consecutive time points; The first update unit is used to update the gain parameter of the Mahony complementary filtering algorithm based on the maximum value.
[0042] In some embodiments, the updating unit is specifically used for: The maximum value is compared with a preset range to determine the exercise level corresponding to the maximum value; Based on a preset gain parameter update table, the proportional gain parameter and integral gain parameter corresponding to the motion level are determined.
[0043] In some embodiments, the correction module 403 includes: The acquisition unit is used to acquire measured values and predicted values of gravitational acceleration. The cross-product unit performs a cross-product between the measured value of gravitational acceleration and the predicted value of gravitational acceleration to obtain an error value; A compensation unit is used to compensate the error value based on the gain parameter to obtain a compensated error value; The correction unit is used to correct the triaxial angular velocity measurement value based on the compensation error value to obtain the target triaxial angular velocity value.
[0044] In some embodiments, the acquisition unit is specifically used for: Obtain measured values of gravitational acceleration in the Earth coordinate system; Based on the rotation matrix, the measured value of gravitational acceleration is converted into the predicted value of gravitational acceleration in the body coordinate system. The rotation matrix is the quaternion at time t-1 corresponding to the body attitude. The quaternion at time t-1 is obtained by updating the quaternion at time t-2 with the target three-axis angular velocity value at time t-1.
[0045] In some embodiments, the solving module 404 includes: The second update unit is used to update the target quaternion corresponding to the body attitude at the current moment based on the target three-axis angular velocity value; The conversion unit is used to convert the target quaternion into airframe attitude information based on a preset inverse Euler angle formula. The airframe attitude information includes roll angle, pitch angle, and yaw angle.
[0046] In some embodiments, the target quaternion is obtained by updating the quaternion at time t-1 based on the target triaxial angular velocity value using the first-order Runge-Kutta method micropowder equation.
[0047] The IMU attitude calculation device described above can implement the IMU attitude calculation method of the above method embodiments. The options in the above method embodiments are also applicable to this embodiment, and will not be detailed here. The remaining content of this application embodiment can be referred to the content of the above method embodiments, and will not be repeated in this embodiment.
[0048] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 5 As shown, the computer device 5 of this embodiment includes: at least one processor 50 ( Figure 5 (Only one is shown in the diagram), memory 51, and computer program 52 stored in said memory 51 and executable on said at least one processor 50, wherein said processor 50 executes said computer program 52 to implement the steps in any of the above method embodiments.
[0049] The computer device 5 may be a computing device such as a remote control, smartphone, tablet, smart bracelet, and smart VR glasses. This computer device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will understand that... Figure 5 The computer device 5 is merely an example and does not constitute a limitation on the computer device 5. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0050] The processor 50 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0051] In some embodiments, the memory 51 may be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. In other embodiments, the memory 51 may be an external storage device of the computer device 5, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 5. Furthermore, the memory 51 may include both internal and external storage units of the computer device 5. The memory 51 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been output or will be output.
[0052] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above method embodiments.
[0053] This application provides a computer program product that, when run on a computer device, enables the computer device to execute the steps described in the various method embodiments above.
[0054] In the several embodiments provided in this application, it will be understood that each block in the flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
[0055] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0056] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.
Claims
1. An IMU attitude calculation method, characterized in that, include: Acquire raw IMU data, which includes triaxial acceleration measurements and triaxial angular velocity measurements; Based on the triaxial acceleration measurements, the gain parameters of the Mahony complementary filter algorithm are dynamically updated, including proportional gain parameters and integral gain parameters. Based on the gain parameter, the triaxial angular velocity measurement value is corrected to obtain the target triaxial angular velocity value; Based on the triaxial acceleration measurement and the target triaxial angular velocity, the body attitude information is calculated.
2. The IMU attitude calculation method as described in claim 1, characterized in that, The dynamic updating of the gain parameters of the Mahony complementary filter algorithm based on the triaxial acceleration measurements includes: Based on the triaxial acceleration measurements, triaxial acceleration difference data at each time point is calculated, and the triaxial acceleration difference data is absolute value data; The maximum difference data of the triaxial acceleration differential data at each time step was selected; Filter out the maximum value among the maximum difference data at the most recent preset consecutive time points; Based on the maximum value, the gain parameter of the Mahony complementary filtering algorithm is updated.
3. The IMU attitude calculation method as described in claim 2, characterized in that, The step of updating the gain parameter of the Mahony complementary filtering algorithm based on the maximum value includes: The maximum value is compared with a preset range to determine the exercise level corresponding to the maximum value; Based on the preset gain parameter update table, the proportional gain parameter and integral gain parameter corresponding to the motion level are determined.
4. The IMU attitude calculation method as described in claim 1, characterized in that, The step of correcting the triaxial angular velocity measurement value based on the gain parameter to obtain the target triaxial angular velocity value includes: Obtain measured and predicted values of gravitational acceleration; The error value is obtained by cross-productting the measured value of gravitational acceleration and the predicted value of gravitational acceleration. Based on the gain parameter, the error value is compensated to obtain the compensated error value; Based on the compensation error value, the triaxial angular velocity measurement value is corrected to obtain the target triaxial angular velocity value.
5. The IMU attitude calculation method as described in claim 4, characterized in that, The acquisition of measured and predicted values of gravitational acceleration includes: Obtain measured values of gravitational acceleration in the Earth coordinate system; Based on the rotation matrix, the measured value of gravitational acceleration is converted into the predicted value of gravitational acceleration in the body coordinate system. The rotation matrix is the quaternion at time t-1 corresponding to the body attitude. The quaternion at time t-1 is obtained by updating the quaternion at time t-2 with the target three-axis angular velocity value at time t-1.
6. The IMU attitude calculation method as described in claim 1, characterized in that, The calculation of the aircraft attitude information based on the triaxial acceleration measurement value and the target triaxial angular velocity value includes: Based on the target triaxial angular velocity value, update the target quaternion corresponding to the body attitude at the current moment; Based on the preset inverse Euler angle formula, the target quaternion is converted into aircraft attitude information, which includes roll angle, pitch angle and yaw angle.
7. The IMU attitude calculation method as described in claim 6, characterized in that, The target quaternion is obtained by updating the quaternion at time t-1 based on the target triaxial angular velocity value using the first-order Runge-Kutta method micro-powder equation.
8. An IMU attitude calculation device, characterized in that, include: The acquisition module is used to acquire raw IMU data, which includes triaxial acceleration measurements and triaxial angular velocity measurements. The update module is used to dynamically update the gain parameters of the Mahony complementary filter algorithm based on the triaxial acceleration measurement values. The gain parameters include proportional gain parameters and integral gain parameters. The correction module is used to correct the triaxial angular velocity measurement value based on the gain parameter to obtain the target triaxial angular velocity value; The calculation module is used to calculate the body attitude information based on the triaxial acceleration measurement value and the target triaxial angular velocity value.
9. A computer device, characterized in that, It includes a processor and a memory, the memory being used to store a computer program, which, when executed by the processor, implements the IMU attitude calculation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the IMU attitude calculation method as described in any one of claims 1 to 7.
Citation Information
Cited By
Exoskeleton attitude measurement method and system
CN121881273A
Exoskeleton posture measurement method and system
CN121881273B