Improved Mahony complementary filtering unmanned aerial vehicle attitude settlement method based on differential evolution
An improved Mahony complementary filtering method, which adaptively adjusts the gain parameters using a differential evolution algorithm, solves the problems of gyroscope error and environmental interference in UAV attitude estimation, achieving high-precision and high-stability attitude calculation.
Patent Information
- Application Number
- CN202511012554.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-11-25
AI Technical Summary
In existing UAV attitude estimation methods, gyroscopes suffer from temperature drift and measurement errors, accelerometers are sensitive to body vibrations, and magnetometers are easily affected by surrounding magnetic fields, resulting in decreased attitude calculation accuracy and poor robustness. Furthermore, the adjustment of gain parameters depends on experience and cannot effectively cope with dynamic environmental interference.
An improved Mahony complementary filtering method based on differential evolution is adopted. The gain parameter is adaptively calculated through the DE algorithm. Combined with accelerometer and magnetometer data, the gain is automatically adjusted to correct the gyroscope estimate and reduce the attitude estimation error.
It improves the accuracy and stability of UAV attitude calculation, reduces attitude estimation error, reduces dependence on hardware platform, and improves attitude calculation efficiency and anti-interference capability.
Smart Images

Figure CN121007553A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of digitalization and information, and particularly belongs to an improved Mahony complementary filter unmanned aerial vehicle attitude calculation method based on differential evolution. BACKGROUND
[0002] Accurate and reliable positioning and attitude determination are primary conditions for autonomous navigation of mobile robots, and among numerous autonomous navigation technologies, an inertial navigation system is widely adopted due to wide application range, good dynamic performance and high short-time precision. Obtaining unmanned aerial vehicle attitude information by using an inertial measurement unit is a key to realizing precise navigation and stable flight of the unmanned aerial vehicle. However, the gyroscope has problems such as temperature drift and measurement error, the accelerometer is sensitive to high-frequency noise such as body vibration, and the magnetometer is easily disturbed by the surrounding magnetic field, so it is difficult to accurately solve the attitude information alone.
[0003] Mahony filter based on structure, Madgwick filter and the like are widely applied in related researches on unmanned aerial vehicle attitude estimation by using the complementary characteristics of sensors. However, when the unmanned aerial vehicle attitude is estimated, the gain parameters of the complementary filter need to be properly adjusted according to experience, the deviation cannot be accurately evaluated, the gain parameters are adjusted by using a method based on a probabilistic multi-model, but the range of the gain parameters still needs to be determined by prior knowledge, that is, the developer needs to know the performance of the sensor hardware platform, and then the parameter adjustment is performed according to the understanding, so that the algorithm formed cannot effectively cope with dynamic disturbances in the environment, has poor robustness and is dependent on the platform, and trial and error according to experience also causes the filter to fail to play its best theoretical performance, so that the attitude calculation precision is reduced and the development cost is increased. SUMMARY
[0004] The technical problem of the application is to provide a filter structure based on DE cascaded complementary filter, and introduce a differential evolution algorithm for correcting the estimated value of the gyroscope and adaptively calculating the gain parameters of the DE algorithm, so as to reduce the attitude estimation error, improve the unmanned aerial vehicle attitude calculation precision and stability.
[0005] The application aims to solve the above problems, and provides an improved Mahony complementary filter unmanned aerial vehicle attitude calculation method based on differential evolution, which comprises the following steps. S1: establishing a body coordinate system and being fixed to the robot through the body coordinate system and the navigation coordinate system, and describing the robot attitude by using Euler angles and a quaternion method: S2: constructing an MCF algorithm based on a Mahony algorithm and a first-order linear complementary filter, and performing cross multiplication on measurement data of an accelerometer and a magnetometer and a theoretical attitude to obtain a deviation vector; S3: Compensate the deviation vector to the raw data measured by the gyroscope through the PI regulator, combine the raw acceleration and magnetometer measured element data to obtain the first level attitude data, and perform first order linear complementary fusion with the raw gyroscope data to obtain the optimized accurate attitude angle; S4: Construct a DE differential evolution algorithm, take the unknown to be optimized as the gene of the species, and generate more samples through mutation and crossover operation; S5: Through the condition of natural selection, the minimum value of the error between the theoretical attitude and the measured attitude is obtained through iteration.
[0006] Further, step S1 includes using quaternion method, selecting quaternion as the operation method for describing attitude, solving the singular point and gimbal deadlock of Euler angle method, and converting the collective coordinate system into the navigation coordinate system through the conversion matrix.
[0007] Preferably, the calculation formula of the conversion matrix is: ; In the formula, Cnb represents the conversion matrix, n represents the navigation coordinate system, b represents the body coordinate system, respectively represent the four elements of the quaternion vector .
[0008] Preferably, in step S2, the MCF algorithm is introduced on the basis of the algorithm to form the MCF algorithm by introducing the first order linear complementary algorithm CF, and a layer of CF algorithm is nested outside the Mahony algorithm. The data fused by Mahony is fused again with the original gyroscope data in the CF algorithm.
[0009] Further, step S2 further includes the following sub-steps: 1) Collect three-axis acceleration, three-axis angular velocity and three-axis magnetic field intensity data through the accelerometer, gyroscope and magnetometer respectively to form a data set, and the expression is: ; ; ; In the formula, G represents a three-axis acceleration vector measured by an accelerometer, represents the acceleration component on a specific axis; W represents a three-axis angular velocity vector measured by a gyroscope, x, y and z represent the x-axis, y-axis and z-axis in the b coordinate system, M represents a three-axis magnetic field intensity vector measured by a magnetometer, and T represents an operator symbol, that is, the transpose of a matrix; 2) Preprocess the data set, and normalize the acceleration and three-axis magnetic field intensity data in the data set, and the calculation formula is: ; ; In the formula, represents an operator, which represents the length of the matrix; 3) The magnetic field intensity in the body coordinate system is converted into the navigation coordinate system and a magnetic field vector b is constructed, and then the horizontal component is extracted through the magnetic field vector b, and the calculation formula is: ; ; In the formula, represents the current attitude quaternion, represents the conjugate of , represents the three-axis magnetic field intensity vector measured by the magnetometer, represents the magnetic field vector, represents the magnetic field intensity components on the x-axis and the z-axis in the navigation coordinate system; 4) The theoretical gravity of the body coordinate system and the theoretical projection of the body coordinate system are calculated, and the calculation formula is: × ; × ; In the formula, represents the theoretical gravity of the navigation coordinate system, represents the theoretical gravity of the body coordinate system, represents the three-axis magnetic field intensity vector in the navigation coordinate system, represents the three-axis magnetic field intensity vector in the body coordinate system, and n and b represent the navigation coordinate system and the body coordinate system, respectively; 5) The error vector is calculated, and the cross product calculates the error of the measured values of the accelerometer and the magnetometer and the theoretical vector, and then the original data measured by the gyroscope is corrected through a PI controller, and the calculation formula is: ; In the formula, represents the angular velocity vector of the corrected gyroscope, , respectively represent the compensation values.
[0010] Preferably, step S3 includes calculating the integral of the quaternion formed by the corrected gyroscope measurement data and the integral of the quaternion formed by the original gyroscope measurement data, fusing the two quaternions through spherical linear interpolation, and correcting the result with a weight to obtain the corrected attitude quaternion, and then normalizing and outputting the Euler angle.
[0011] Further, the modified attitude quaternion and the output Euler angle are calculated as follows: ; ; wherein, is the modified attitude quaternion, is the attitude quaternion obtained only from the gyro data, denotes the included angle between two attitudes.
[0012] Preferably, the step S4 comprises collecting , calculating the fitness value of the population and evaluating the fitness value, and the fitness value is calculated as follows: ; wherein, denotes the fitness value of the individual of the species, denotes the size of the error.
[0013] Further, the DE differential evolution algorithm in the step S4 comprises the following sub-steps: 1) initializing the population, and the calculation formula is as follows: ; ; ; wherein, denotes the number of the individual in the population, denotes the number of evolution, represents the population size. Wherein represents the gene of the individual; j represents the jth gene, denotes how to initialize the gene of each individual; respectively denote the corresponding relationship of the gene of each individual and the unknown quantity to be optimized , , ; 2) performing differential mutation vector for each target, and the calculation formula is as follows: ; ; wherein, denotes the mutation vector, [] denotes the downward rounding of the data inside, , , 3) different from each other, denoting selecting three different individuals, denotes the maximum number of iterations.
[0014] 3) Perform a crossover operation between the mutated vector and the target vector. The calculation formula is as follows: = ; In the formula, Represents the test variable. , This represents the first generation of a random number generator that generates random numbers between [0,1]. One estimated value, ∈ (1,2,...,D) represents a randomly selected sequence used to ensure At least from Obtain a parameter, Represents the crossover operator. = ; 4) After mutation and crossover of the population, another selection process is performed to determine whether the test vector is sufficient to enter and be accepted as the next generation individual. The formula is as follows. This completes one iteration. When the number of iterations ends or the best individual in the population meets the requirements, the process ends. If the value is less than 0.0005, stop the iteration. The calculation formula is: ; = ; In the formula, each test vector is compared with the original population vector. The smaller values can be retained as the original population vector for the next iteration.
[0015] Preferably, step S4 further includes traversing the population and extracting the best individual in the population. After completing the iteration, calculations are performed on each individual in the population. The individual with the smallest value is selected as the best individual and output.
[0016] Compared with the prior art, the beneficial effects of the present invention include: 1) The improved Mahony complementary filter UAV attitude calculation method proposed in this invention automatically adjusts to obtain the optimal gain parameters, thereby reducing the attitude estimation error.
[0017] 2) The improved Mahony complementary filter UAV attitude calculation method based on differential evolution proposed in this invention does not require complex mathematical modeling in the process of calculating the UAV attitude angle, thus improving the efficiency of human-machine attitude calculation.
[0018] 3) The improved Mahony complementary filter UAV attitude calculation method based on differential evolution proposed in this invention does not rely on a specific hardware platform. The algorithm can automatically adjust the most suitable gain parameters, improve the attitude calculation effect, and reduce the research and development time. Attached Figure Description
[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0020] Figure 1 This is a schematic diagram of the improved Mahony complementary filter UAV attitude calculation method based on differential evolution, which is an example of the present invention. Figure 2 This is a schematic diagram of the navigation coordinate system and the body coordinate system in an embodiment of the present invention; Figure 3 An example of this invention is an adaptive PI improvement based on the differential evolution algorithm. A schematic diagram of the overall framework of the filter-based UAV attitude estimation method; Figure 4 This is a schematic diagram of the MCF framework of the DMCF algorithm in an implementation example of the present invention; Figure 5 This is a schematic diagram of the DE calculation process of the DMCF algorithm in an embodiment of the present invention; Figure 6 This is a schematic diagram showing the acceleration, angular velocity, and magnetometer measurements compared under a stationary state in an embodiment of the present invention. Figure 7 This is a schematic diagram comparing the filtering algorithms in a static state in an embodiment of the present invention; Figure 8 This is a schematic diagram comparing the acceleration, angular velocity, and magnetometer measurements under dynamic conditions in an embodiment of the present invention. Figure 9 This is a schematic diagram comparing filtering algorithms under motion conditions in an embodiment of the present invention. Detailed Implementation
[0021] like Figure 1 As shown, the improved Mahony complementary filter UAV attitude calculation method based on differential evolution includes the following steps: S1: Establish the body coordinate system and fix it to the robot using the body coordinate system and navigation coordinate system, and then describe the robot's posture using Euler angles and quaternions: like Figure 2 As shown, step S1 includes using the quaternion method, selecting quaternions as the way to describe the attitude, to solve the singularity of the Euler angle method and the deadlock of the gimbal, and converting the collective coordinate system into the navigation coordinate system through the transformation matrix.
[0022] The formula for calculating the transformation matrix is: ; In the formula, represents a conversion evidence, n represents a navigation coordinate system, b represents a body coordinate system, respectively represent four elements of a quaternion vector .
[0023] S2: Constructing MCF algorithm based on Mahony algorithm and first-order linear complementary filtering, and using the measurement data of accelerometer and magnetometer and the theoretical attitude to cross multiply to obtain the bias vector; In step S2, the MCF algorithm contains the first-order linear complementary algorithm CF introduced on the basis of the Mahony algorithm to form the MCF algorithm, and a layer of CF algorithm is nested outside the Mahony algorithm, and the data fused by the Mahony algorithm is fused again with the original gyroscope data in the CF algorithm.
[0024] In step S2, the following sub-steps are further included: 1) Collecting three-axis acceleration, three-axis angular velocity and three-axis magnetic field intensity data by accelerometer, gyroscope and magnetometer respectively to form a data set, the expression is: ; ; ; In the formula, G represents a three-axis acceleration vector measured by an accelerometer, represents an acceleration component on a specific axis; W represents a three-axis angular velocity vector measured by a gyroscope, x, y and z represent x-axis, y-axis and z-axis in b coordinate system respectively, M represents a three-axis magnetic field intensity vector measured by a magnetometer, and T represents an operator symbol, i.e. matrix transpose; 2) Preprocessing the data set, and normalizing the acceleration and three-axis magnetic field intensity data in the data set, the calculation formula is: ; ; In the formula, represents an operator symbol, which represents the length of the matrix; 3) Converting the magnetic field intensity in the body coordinate system into the navigation coordinate system and constructing the magnetic field vector b, and then extracting the horizontal component through the magnetic field vector b, the calculation formula is: ; ; In the formula, represents the current attitude quaternion, represents the conjugate of . a, b, c represent the three-axis magnetic field intensity vector measured by the magnetometer, a, b, c represent the magnetic field vector, a, b represent the magnetic field intensity components on the x-axis and z-axis in the navigation coordinate system; 4) Theoretical gravity of the body coordinate system and the theoretical projection of the body coordinate system The calculation formula is: × ; × ; In the formula, a, b, c represent the three-axis magnetic field intensity vector measured by the magnetometer, a, b, c represent the three-axis magnetic field intensity vector measured by the magnetometer, a, b, c represent the three-axis magnetic field intensity vector measured by the magnetometer, a, b, c represent the three-axis magnetic field intensity vector measured by the magnetometer, n and b represent the navigation coordinate system and the body coordinate system respectively; 5) Calculate the error vector The cross product calculates the error of the measured values of the accelerometer and the magnetometer and the theoretical vector, and then corrects the raw data obtained by the gyroscope measurement through the PI controller. The calculation formula is: ; In the formula, a, b, c represent the three-axis magnetic field intensity vector measured by the magnetometer, , respectively represent the compensation value.
[0025] S3: Compensate the deviation vector to the raw data obtained by the gyroscope measurement through the PI regulator, and combine the raw acceleration and magnetometer measured element data to obtain the first level attitude data, and then this data still needs to be combined with the first order linear complementary fusion of the raw gyroscope data to obtain the final accurate attitude angle; In step S3, the integral of the quaternion formed by the corrected gyroscope measurement data and the integral of the quaternion formed by the raw gyroscope measurement data are calculated, and the two quaternions are fused through spherical linear interpolation, and the result is corrected by weight to obtain the corrected attitude quaternion, which is normalized and output as Euler angle.
[0026] Further, the calculation formula of the corrected attitude quaternion and the output Euler angle is: ; ; In the formula, is the corrected attitude quaternion, is the attitude quaternion obtained only by the gyroscope data, is the included angle between the two postures.
[0027] S4: Constructing DE differential evolution algorithm, taking the unknown to be optimized as the gene of the species, generating more samples through mutation and crossover operation; As shown in Figure 3 and Figure 4 , step S4 includes collecting error error vectors, calculating the fitness value of the population and evaluating the fitness value, and the calculation formula of the fitness value is: ; In the formula, , represents the fitness value of the individual of the species, , represents the size of the error.
[0028] The DE differential evolution algorithm in step S4 includes the following sub-steps: 1) Initialize the population, and the calculation formula is: ; ; ; In the formula, , represents the number of individuals in the population, , represents the number of evolution times, , represents the population size. Among them , represents the gene of the individual; j represents the jth gene, , represents how to initialize the gene of each individual; , respectively represents the corresponding relationship of the gene of each individual and the unknown to be optimized , , ; 2) Perform differential mutation vector for each target, and the calculation formula is: ; ; In the formula, , represents the mutation vector, , represents rounding down the data inside, , , 3, which are different from each other, represent selecting three different individuals, , represents the maximum number of iterations.
[0029] 3) Perform crossover operation on the mutation vector and the target vector, and the calculation formula is: = ; In the formula, the test variable is defined as: , represents the first estimate value of the random number generator between [0, 1], represents a randomly selected sequence to ensure that at least one parameter is obtained from , represents a crossover operator, ; 4) After mutation and crossover of the population, the test vector is judged again to determine whether it is sufficient to enter and be accepted as the next generation individual. The formula is as follows. One iteration is completed at this time, and the iteration is stopped when the iteration number ends or the optimal individual in the population meets the requirements, i.e. <0.0005, the iteration is stopped, and the calculation formula is: ; ; In the formula, each test vector is compared with the original population vector The value is smaller and can be left as the original population vector for the next iteration.
[0030] In step S4, the population is also traversed and the best individual in the population is extracted. After the iteration is completed, the calculation of each individual in the population is performed, and the individual with the smallest value is taken as the best individual and output.
[0031] S5: Through the conditions of natural selection, the minimum value of the theoretical attitude and the measurement attitude error is obtained through iteration.
[0032] In order to verify the improved Mahony complementary filter unmanned aerial vehicle attitude determination method based on differential evolution, static IMU and dynamic IMU data are simulated and generated on matlab. After DMCF filtering, the reference attitude angle is calculated by comparing the original data, and the root mean square error of the reference attitude angle and the estimated attitude angle is calculated. Then, by using different gain parameters and , the algorithm is compared with , and algorithms respectively, and the performance of the structure is analyzed; The calculation formula of the root mean square error is: . In the formula, denotes the root mean square error result, denotes a reference attitude, denotes a measured attitude, i denotes a count unit, and n denotes a maximum value; k denotes a search variable of a vector, and takes values of 1 to 3; In order to verify the attitude solving capability of the application, the application is compared with the Mahony, MCF algorithm, and the total root mean square difference of attitude is used to measure the accuracy of attitude solving, and the calculation formula of the total root mean square difference of attitude is as follows: ; In the formula, p denotes a pitch angle, r denotes a roll angle, and h denotes a heading angle.
[0033] As shown in FIGS. Figure 5 and 6 , the application and the comparative algorithm are respectively applied to IMU data of static sitting and motion in which three kinds of interference are introduced: (1) for the fixed offset of 0.1962 rad of the accelerometer in the b coordinate system to the x axis, and the noise of 0.012361 is introduced; (2) for the fixed offset of 1 rad of the gyroscope in the b coordinate system to the y axis, the fixed offset of 0.5 rad to the Z axis, and the noise of 0.012361 is introduced; (3) for the fixed offset of 1 rad of the magnetometer in the b coordinate system to the x axis, the fixed offset of 0.5 rad to the Z axis, and the noise of [0.6 0.6 0.9] / 10000 is introduced.
[0034] The experiment is repeated four times in the static state, and is respectively marked as M1, M2, M3 and M4. The average RESM calculated from the IMU data is shown in Table 1: Table 1
[0035] As can be seen from the results in the table, the total average of the four repeated experiments of the application on the IMU data in the static state in which interference is introduced is ±0.002 rad, which is improved by 68% compared with the MCF of ±0.009 rad without introducing the differential filtering DE algorithm, and is improved by 88% compared with the Mahony algorithm.
[0036] As shown in FIGS. Figure 7 The filtering result diagram of M1 is shown, compared with the two algorithms of Mahony and MCF, DMCF can converge to the theoretical reference Euler angle curve faster, indicating that in practical application, DMCF not only has the accuracy advantage of the traditional algorithm, but also has faster convergence speed.
[0037] Further verification of the application of the application to the dynamic IMU with three different interferences, the experiment is randomly generated four times IMU trajectory in the motion state M1, M2, M3, M4, the average RESM calculated from the IMU data is shown in Table 2: Table 2
[0038] In the working IMU data, the application shows that it is not affected by the motion, as can be seen from Table 2, the error of Mahony in the motion state comes to ±0.173 rad, the error of MCF is increased to ±0.070 rad, which can be obviously compared to see that compared with the error level in the static state, there is a significant increase, while the error of DMCF algorithm is still ±0.005 rad, the results show that compared with the traditional algorithm, the method provided by the application has very excellent anti-motion interference ability.
[0039] In summary, in the same experimental environment in the motion and static state, the method compared with the traditional Mahony and MCF algorithm shows obvious accuracy improvement. Figure 7 The fast convergence ability of the curve as shown in the above-mentioned curve indicates that the algorithm has the advantage of faster convergence speed in practical application, and the total average The numerical comparison shows that compared with the traditional algorithm, the method provided by the application has very excellent anti-motion interference ability.
Claims
1. An improved Mahony complementary filter UAV attitude determination method based on differential evolution, characterized in that, The method comprises the following steps: S1: Establish the body coordinate system and fix it to the robot through the body coordinate system and the navigation coordinate system, and describe the robot attitude through Euler angles and quaternion method; S2: Construct the MCF algorithm based on Mahony algorithm and first-order linear complementary filtering, and obtain the bias vector by cross-multiplying the measurement data of the accelerometer and the magnetometer with the theoretical attitude; S3: Compensate the bias vector to the raw data measured by the gyroscope through the PI regulator, combine the raw acceleration and magnetic field intensity data measured by the accelerometer and the magnetometer to obtain the first-order attitude data, and perform first-order linear complementary fusion on the raw gyroscope data to obtain the optimized accurate attitude angle; S4: Construct the DE differential evolution algorithm, take the unknown quantity to be optimized as the gene of the species, and generate more samples through mutation and crossover operation; S5: Through the condition of natural selection, the minimum value of the error between the theoretical attitude and the measured attitude is obtained through iteration.
2. The differential evolution-based improved Mahony complementary filtering UAV attitude calculation method according to claim 1, wherein in step S1, the quaternion method is used, and the quaternion is selected as the operation method for describing the attitude, which is used to solve the singular point and the dead lock of the gimbal of the Euler angle method, and the collective coordinate system is converted into the navigation coordinate system through the conversion matrix.
3. The improved Mahony complementary filter UAV attitude solution method based on differential evolution according to claim 2, characterized in that, The calculation formula of the conversion matrix is: ; wherein represents the transformation of the proof, n represents the navigation coordinate system, b represents the body coordinate system, respectively represent the four elements of the quaternion vector .
4. The improved Mahony complementary filter UAV attitude estimation method based on differential evolution according to claim 1, wherein the MCF algorithm comprises a first-order linear complementary algorithm CF based on the algorithm. The MCF algorithm is formed by introducing the first-order linear complementary algorithm CF based on the algorithm. The CF algorithm is nested outside the Mahony algorithm. The data fused by the Mahony algorithm is fused again with the original gyroscope data in the CF algorithm.
5. The differential evolution-based improved Mahony complementary filtering UAV attitude calculation method according to claim 1, wherein step S2 further comprises the following sub-steps: 1) Collect three-axis acceleration, three-axis angular velocity and three-axis magnetic field intensity data through the accelerometer, the gyroscope and the magnetometer respectively to form a data set; 2) Preprocess the data set, and normalize the acceleration and three-axis magnetic field intensity data in the data set; 3) Convert the magnetic field intensity in the body coordinate system into the navigation coordinate system, construct a magnetic field vector, and then extract the horizontal component through the magnetic field vector; 4) Calculate the theoretical gravity of the body coordinate system and the theoretical projection of the body coordinate system; 5) Calculate the error vector, and calculate the error of the measured values of the accelerometer and the magnetometer and the theoretical vector through cross product, and then correct the raw data measured by the gyroscope through the PI controller.
6. The improved Mahony complementary filter UAV attitude solution method based on differential evolution according to claim 1, characterized in that, In step S3, the integral of the quaternion formed by the corrected gyroscope measurement data is calculated, and the integral of the quaternion formed by the raw gyroscope measurement data is calculated, the two quaternions are fused through spherical linear interpolation, and the result is corrected with a weight to obtain the corrected attitude quaternion, which is normalized to output the Euler angle.
7. The improved Mahony complementary filter UAV attitude solution method based on differential evolution according to claim 6, characterized in that, The calculation formula of the corrected attitude quaternion and the output Euler angle is: ; ; wherein denotes the corrected attitude quaternion, denotes the attitude quaternion obtained from the gyro data, is the angle between the two attitudes.
8. The improved Mahony complementary filter UAV attitude solution method based on differential evolution according to claim 1, characterized in that, In step S4, the error vector is collected, the fitness value of the population is calculated, and the fitness value is evaluated.
9. The improved Mahony complementary filter UAV attitude solution method based on differential evolution according to claim 1, characterized in that, The DE differential evolution algorithm in step S4 comprises the following sub-steps: 1) Initialize the population, and the expression is: 2) Perform differential mutation vector for each target; 3) Perform crossover operation on the mutation vector and the target vector; 4) After completing the mutation and crossover of the population, it is judged again whether the test vector is enough to enter and be accepted as the next generation individual formula, and one iteration is completed at this time. When the iteration times end or the optimal individual in the population, the iteration is stopped.
10. The improved Mahony complementary filter UAV attitude solution method based on differential evolution according to claim 9, characterized in that, The step S4 further comprises traversing the population and extracting the best individual in the population, and after completing the iteration, calculating the best individual for each individual in the population, taking the individual with the minimum value as the best individual output.