Attitude calculation method, device and equipment of ornithopter, medium and ornithopter
By acquiring the acceleration and angular velocity sensor data of the flapping wing aircraft, Kalman filtering and sliding mean filtering are performed, combined with the confidence setting of the body state, and volume Kalman filtering fusion is performed, the problem of poor attitude resolution accuracy of the flapping wing aircraft is solved, and more accurate attitude angle calculation and posture information acquisition are achieved.
Patent Information
- Application Number
- CN202510101318.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art is difficult to effectively solve the problem of poor attitude resolution accuracy of flapping wing vehicles, especially in bionic flapping wing vehicles with severe vibration, where traditional filtering methods cannot meet the needs of use.
By obtaining the attitude parameters collected by the acceleration sensor and the angular velocity sensor, the pitch angle and roll angle of the flapping aircraft are determined respectively, and the corresponding confidence is set based on the fuselage state, and the fusion process is performed to generate the fusion attitude angle. The specific steps include Kalman filtering and sliding mean filtering of the attitude parameters, determining the confidence level based on the body state, and fusing through volume Kalman filtering.
It effectively reduces the impact of the vibration of the flapping wing aircraft on sensor data, improves the accuracy and accuracy of attitude solution, and realizes the accurate calculation of the attitude angle of the flapping wing aircraft and the acquisition of posture information.
Smart Images

Figure CN119984168A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of aircraft, and in particular to an attitude calculation method, device, equipment, medium and aircraft for a flapping-wing aircraft. Background Art
[0002] Nowadays, there are many types of unmanned aerial vehicles. According to their wings, they are mainly classified into rotary wings, fixed wings, and flapping wings. Different wings have different flight modes and phenomena. The flight of rotary wings and fixed wings is relatively stable and controllable, while the flight vibration of flapping wings is more violent and more difficult to control. However, they have good bionic characteristics and good concealment, so they have high research value. Since the vibration of the wings of the bionic flapping-wing aircraft causes the vibration of the entire body to be more violent, the sensors mounted on it are also greatly affected by the vibration. Therefore, it is particularly important to process the data while ensuring the accuracy and stability of the data collected by the sensors.
[0003] At present, the influence of noise is generally reduced through simple filtering processing. However, the solution accuracy and applicability of this method when applied to bionic flapping-wing aircraft are general and cannot meet the use requirements. Summary of the invention
[0004] In view of this, the present invention provides a method, device, equipment, medium and aircraft for calculating the attitude of a flapping-wing aircraft, so as to solve the problem of poor accuracy in calculating the attitude of a flapping-wing aircraft.
[0005] In a first aspect, the present invention provides a method for calculating an attitude of a flapping-wing aircraft, comprising:
[0006] Acquire a first posture parameter collected by a first sensor, and acquire a second posture parameter collected by a second sensor; the first sensor is an acceleration sensor, and the second sensor is an angular velocity sensor;
[0007] Determine a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determine a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle;
[0008] Determining a body state for indicating a degree of stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter;
[0009] Based on the body state of the flapping-wing aircraft, setting corresponding confidence levels for the first attitude angle and the second attitude angle respectively;
[0010] The first attitude angle and the second attitude angle are fused according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
[0011] In some optional embodiments, determining the first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determining the second attitude angle of the flapping-wing aircraft according to the second attitude parameter, comprises:
[0012] The first attitude parameter is first subjected to Kalman filtering and then subjected to sliding mean filtering; a first attitude angle of the flapping-wing aircraft is determined according to the filtered first attitude parameter;
[0013] The second attitude parameter is first subjected to Kalman filtering processing and then subjected to sliding mean filtering processing; and the second attitude angle of the flapping-wing aircraft is determined according to the filtered second attitude parameter.
[0014] In some optional implementations, determining the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter includes:
[0015] Determine a body pitch state for indicating a pitch stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to pitch in the second attitude parameter;
[0016] Determine a body roll state for indicating the roll stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to the roll in the second attitude parameter;
[0017] The step of setting corresponding confidence levels for the first attitude angle and the second attitude angle based on the body state of the flapping-wing aircraft comprises:
[0018] When the first attitude angle includes a first pitch angle and the second attitude angle includes a second pitch angle, based on a body pitch state of the flapping-wing aircraft, setting corresponding confidences for the first pitch angle and the second pitch angle respectively;
[0019] In a case where the first attitude angle includes a first roll angle and the second attitude angle includes a second roll angle, corresponding confidence levels are set for the first roll angle and the second roll angle respectively based on a body roll state of the flapping-wing aircraft.
[0020] In some optional implementations, determining the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter includes:
[0021] According to the variance of the first attitude parameter and / or the second attitude parameter within a preset time period, a body state used to represent the stability of the flapping-wing aircraft is determined; the smaller the variance is, the higher the stability of the flapping-wing aircraft is.
[0022] In some optional implementations, fusing the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft includes:
[0023] updating a first process noise covariance according to the confidence level corresponding to the first attitude angle, and updating a second process noise covariance according to the confidence level corresponding to the second attitude angle;
[0024] Taking the fused attitude angle determined last time as a state quantity and the first attitude angle as an observation quantity, performing cubature Kalman filtering processing according to the first process noise covariance to generate a predicted attitude angle;
[0025] The predicted attitude angle is used as a state quantity, the second attitude angle is used as an observation quantity, and cubature Kalman filtering processing is performed again according to the second process noise covariance to generate a fusion attitude angle of the flapping-wing aircraft.
[0026] In some optional embodiments, the method further comprises:
[0027] Determine the current position of the flapping-wing aircraft within a current positioning cycle, and determine the initial heading angle of the flapping-wing aircraft according to the current position and a historical position; the historical position is the position of the flapping-wing aircraft determined within a historical positioning cycle;
[0028] In the current positioning cycle, determining the yaw angle displacement of the flapping-wing aircraft in real time according to the second attitude parameter;
[0029] The yaw angle displacement is interpolated on the basis of the initial heading angle to generate a real-time heading angle of the flapping-wing aircraft.
[0030] In some optional embodiments, the method further comprises:
[0031] Determining the flight speed of the flapping-wing aircraft in real time during the current positioning cycle;
[0032] Integrating the flight speed according to the yaw angle displacement to determine the short-term displacement of the flapping-wing aircraft within the speed sampling time;
[0033] The short-term displacement is interpolated based on the current position to generate the real-time position of the flapping-wing aircraft.
[0034] In a second aspect, the present invention provides an attitude calculation device for a flapping-wing aircraft, comprising:
[0035] A parameter acquisition module, used to acquire a first posture parameter acquired by a first sensor, and to acquire a second posture parameter acquired by a second sensor; the first sensor is an acceleration sensor, and the second sensor is an angular velocity sensor;
[0036] an attitude determination module, configured to determine a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and to determine a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle;
[0037] A fusion processing module is used to determine a body state representing the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter; based on the body state of the flapping-wing aircraft, set corresponding confidence levels for the first attitude angle and the second attitude angle respectively; and fuse the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
[0038] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the attitude solution method for a flapping-wing aircraft according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the attitude solution method for a flapping-wing aircraft according to the first aspect or any corresponding embodiment thereof.
[0040] In a fifth aspect, the present invention provides a flapping-wing aircraft, comprising: an aircraft body, a controller, and an actuator controlled by the controller; the controller is used to execute the attitude solution method of the flapping-wing aircraft according to the first aspect or any corresponding embodiment thereof.
[0041] The present invention determines the pitch angle, roll angle and other attitude angles of a flapping-wing aircraft based on different sensors, and sets a corresponding confidence level for each attitude angle based on the state of the aircraft. Then, according to the confidence level of each attitude angle, the attitude angles determined by multiple sensors can be fused, thereby effectively reducing the impact of the vibration of the flapping-wing aircraft on the sensor collected data, and the attitude angle of the flapping-wing aircraft can be determined more accurately, so as to obtain more accurate posture information and realize accurate attitude solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a schematic flow chart of a method for calculating an attitude of a flapping-wing aircraft according to an embodiment of the present invention;
[0044] Figure 2 is a schematic flow chart of another method for calculating the attitude of a flapping-wing aircraft according to an embodiment of the present invention;
[0045] Figure 3 is a schematic diagram of a process of fusing pitch angle and roll angle according to an embodiment of the present invention;
[0046] Figure 4 is a schematic diagram of a process of cubature Kalman filtering according to an embodiment of the present invention;
[0047] Figure 5 is a schematic diagram of a fusion process based on two volumetric Kalman filters according to an embodiment of the present invention;
[0048] Figure 6 is a schematic diagram of determining a real-time heading angle according to an embodiment of the present invention;
[0049] Figure 7 is a schematic diagram of determining a real-time position according to an embodiment of the present invention;
[0050] Figure 8 is a structural block diagram of a posture solving device for a flapping-wing aircraft according to an embodiment of the present invention;
[0051] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0053] For unmanned aerial vehicles, sensors are needed to sense their own and environmental information, so as to make corresponding actions to achieve their working purpose. The general method of calculating the posture of unmanned aerial vehicles mainly processes the acceleration value obtained by the accelerometer of the six-axis sensor and the angular velocity value obtained by the gyroscope through simple sliding mean filtering, low-pass filtering, etc., and then calculates the pitch angle and roll angle through quaternion or complementary filtering.
[0054] Among them, the accelerometer is an acceleration sensor that mainly works through the "piezoelectric effect". The specific working principle is that the mass block is in a regular hexahedron composed of sensitive elements. As the body moves, the mass block hits the inner surface of the hexahedron. The size of the piezoelectric effect caused by the different sizes of external forces is also different, so the corresponding acceleration and direction values are obtained through conversion.
[0055] A gyroscope is an angular velocity sensor that works mainly through the "Coriolis effect", which refers to the phenomenon that an object moving in a rotating coordinate system will deflect. The Coriolis force converts the angular velocity into the displacement of a specific sensing structure, which produces a change in capacitance. The sensing part measures the displacement caused by the Coriolis force on the sensing mass by measuring the change in capacitance. The size of the displacement is proportional to the size of the applied angular velocity, so the angular velocity and angular acceleration can be obtained.
[0056] Based on the working principles of sensors such as accelerometers and gyroscopes, it can be seen that the flight characteristics of bionic flapping-wing aircraft have a great impact on the two. The traditional attitude solution method used for rotor and fixed-wing aircraft basically does not consider the influence of vibration noise and is not suitable for bionic flapping-wing aircraft, especially the low-frequency periodic vibration noise caused by the flapping wings of bionic flapping-wing aircraft is very influential.
[0057] The attitude calculation method for a flapping-wing aircraft provided in this embodiment determines the pitch angle, roll angle and other attitude angles of the flapping-wing aircraft based on different sensors, sets corresponding confidence levels based on the state of the aircraft, and then fuses the attitude angles determined by multiple sensors according to the confidence levels of each attitude angle. This can effectively reduce the impact of the vibration of the flapping-wing aircraft on the sensor collected data, can relatively accurately determine the attitude angle of the flapping-wing aircraft, and achieve accurate attitude calculation.
[0058] According to an embodiment of the present invention, an embodiment of a method for solving an attitude calculation of a flapping-wing aircraft is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0059] In this embodiment, a method for calculating the attitude of a flapping-wing aircraft is provided, which can be applied to a controller for controlling the flapping-wing aircraft, and the controller can be, for example, a single-chip microcomputer. Figure 1 is a flow chart of a method for calculating the attitude of a flapping-wing aircraft according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps.
[0060] Step S101, obtaining a first posture parameter collected by a first sensor, and obtaining a second posture parameter collected by a second sensor; the first sensor is an acceleration sensor, and the second sensor is an angular velocity sensor.
[0061] In this embodiment, the flapping-wing aircraft is provided with a variety of sensors, including an acceleration sensor (eg, an accelerometer) and an angular velocity sensor (eg, a gyroscope). For ease of description, the acceleration sensor is referred to as the first sensor, and the angular velocity sensor is referred to as the second sensor.
[0062] The first sensor and the second sensor can collect corresponding attitude parameters, namely, a first attitude parameter and a second attitude parameter. It can be understood that the first attitude parameter is an acceleration parameter of the flapping-wing aircraft, and the second attitude parameter is an angular velocity parameter of the flapping-wing aircraft.
[0063] For example, a six-axis sensor composed of an accelerometer and a gyroscope can collect accelerations in the front-back, left-right, and vertical directions, as well as angular velocities in three directions. These accelerations can be used as the first posture parameters, and these angular velocities can be used as the second posture parameters.
[0064] Step S102, determining a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determining a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle.
[0065] In this embodiment, in order to realize the attitude solution of the flapping-wing aircraft, it is necessary to determine the pitch angle and / or roll angle (also called roll angle) of the flapping-wing aircraft. For the convenience of description, the pitch angle and / or roll angle are collectively referred to as attitude angle.
[0066] Furthermore, based on the first attitude parameter collected by the acceleration sensor, the pitch angle and / or roll angle of the flapping-wing aircraft, i.e., the first attitude angle, can be calculated. Furthermore, based on the second attitude parameter collected by the angular velocity sensor, the pitch angle and / or roll angle of the flapping-wing aircraft, i.e., the second attitude angle, can be calculated.
[0067] For example, based on the first attitude parameter related to acceleration, the pitch angle and roll angle, that is, the first attitude angle, can be calculated by using the vector relationship through the gravity decomposition method; based on the second attitude parameter related to angular velocity, the angular displacement of pitch and roll can be obtained by the trapezoidal integration method, and the angular displacement can represent the pitch angle and roll angle, that is, the second attitude angle.
[0068] Step S103: determining a body state for indicating the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter.
[0069] In this embodiment, in order to facilitate the subsequent setting of an appropriate confidence level, it is necessary to determine the body state of the flapping-wing aircraft, and the body state can represent the stability of the flapping-wing aircraft.
[0070] Specifically, after obtaining the first attitude parameter and the second attitude parameter collected by the sensor, the current body state of the flapping-wing aircraft can be determined according to at least one of the attitude parameters. The body state of the flapping-wing aircraft can be determined based on the change of the first attitude parameter and / or the second attitude parameter.
[0071] The stability of the flapping-wing aircraft can be quantified to represent different aircraft states. Alternatively, the aircraft states can be simply divided into a small number of categories; for example, the aircraft states can be divided into a stable state representing stable flight and a maneuverable state representing high maneuverable flight, and the stable state and maneuverable state are used to represent the stability of the flapping-wing aircraft.
[0072] Step S104: setting corresponding confidence levels for the first attitude angle and the second attitude angle respectively based on the body state of the flapping-wing aircraft.
[0073] In this embodiment, the flapping-wing aircraft has different impacts on different sensors when it is in different states. Specifically, the inventors found that the vibration caused by the bionic flapping-wing aircraft has the following impact on the six-axis sensor:
[0074] (1) During flight, the bionic flapping-wing aircraft tilts its head slightly upward, with an elevation angle of about 20 degrees. The larger the elevation angle, the slower the flight speed and the greater the vibration impact. Conversely, the smaller the elevation angle, the faster the flight speed and the smaller the vibration impact.
[0075] (2) The direction of the wings of the bionic flapping-wing aircraft during flight is a periodic motion of pressing down obliquely backward and then lifting obliquely forward. When the bionic flapping-wing aircraft is flying straight forward, the vertical direction is most affected by the acceleration of the aircraft, followed by the front and rear directions, and the left and right directions are less affected. When the bionic flapping-wing aircraft is turning, the left and right directions will be affected more. When the bionic flapping-wing aircraft is flying straight forward, the pitch rotation direction around the center is most affected by the angular velocity of the aircraft, followed by the roll and yaw rotation directions around the center. When the bionic flapping-wing aircraft is turning, the left and right directions will be affected more.
[0076] (3) The amplitude and frequency of the wings of a bionic flapping-wing aircraft change during flight, so the data collected by the sensor also changes with the flapping of the wings. It is not a completely regular periodic change. The noise of the wing flapping is a low-frequency noise with small amplitude and variable period.
[0077] When the flapping-wing aircraft is in a stable state, the attitude angle calculated based on an acceleration sensor such as an accelerometer (i.e., the first attitude angle) is more accurate, while when the flapping-wing aircraft is in a maneuvering state, the attitude angle calculated based on an angular velocity sensor such as a gyroscope (i.e., the second attitude angle) is more accurate. Therefore, corresponding confidence levels can be set for the first attitude angle and the second attitude angle respectively based on the body state of the flapping-wing aircraft.
[0078] Specifically, the higher the stability of the flapping-wing aircraft (i.e., the more stable it is), the higher the confidence set for the first attitude angle, and the lower the confidence set for the second attitude angle; conversely, the lower the stability of the flapping-wing aircraft (i.e., the more unstable it is), the lower the confidence set for the first attitude angle, and the higher the confidence set for the second attitude angle. For example, when the flapping-wing aircraft is in a stable state, the confidence set for the first attitude angle is greater than the confidence set for the second attitude angle; when the flapping-wing aircraft is in a maneuvering state, the confidence set for the first attitude angle is less than the confidence set for the second attitude angle.
[0079] Step S105 , fusing the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
[0080] In this embodiment, after determining the confidence of each of the first attitude angle and the second attitude angle, the first attitude angle and the second attitude angle can be fused based on the two confidences, for example, by weighted summation, so that the fused attitude angle, i.e., the fused attitude angle, can be determined. The fused attitude angle can be used as the attitude angle finally determined after attitude solution.
[0081] It can be understood that if the attitude angle includes the pitch angle and the roll angle, the fused attitude angle also includes the pitch angle and the roll angle. Accordingly, it is assumed that the first attitude angle includes the first pitch angle and the first roll angle, and the first attitude angle includes the second pitch angle and the second roll angle; when fusion is performed, the first pitch angle and the second pitch angle are fused to obtain a fused pitch angle; and the first roll angle and the second roll angle are fused to obtain a fused roll angle. The fused pitch angle and the fused roll angle can be used as the final pitch angle and roll angle of the flapping-wing aircraft to realize the attitude solution of the flapping-wing aircraft.
[0082] The attitude calculation method for a flapping-wing aircraft provided in this embodiment determines the pitch angle, roll angle and other attitude angles of the flapping-wing aircraft based on different sensors, and sets a corresponding confidence level for each attitude angle based on the state of the aircraft. Then, according to the confidence level of each attitude angle, the attitude angles determined by multiple sensors can be fused, thereby effectively reducing the impact of the vibration of the flapping-wing aircraft on the sensor collected data, and can more accurately determine the attitude angle of the flapping-wing aircraft, obtain more accurate posture information, and achieve accurate attitude calculation.
[0083] In this embodiment, a method for calculating the attitude of a flapping-wing aircraft is provided, which can be applied to a controller for controlling the flapping-wing aircraft, and the controller can be, for example, a single-chip microcomputer. Figure 2 is a flow chart of a method for calculating the attitude of a flapping-wing aircraft according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps.
[0084] Step S201, obtaining a first posture parameter collected by a first sensor, and obtaining a second posture parameter collected by a second sensor; the first sensor is an acceleration sensor, and the second sensor is an angular velocity sensor.
[0085] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0086] Step S202, determining a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determining a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle.
[0087] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0088] In some optional implementations, the above step S202 "determining a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determining a second attitude angle of the flapping-wing aircraft according to the second attitude parameter" may include the following steps A1 to A2.
[0089] Step A1, first perform Kalman filtering on the first attitude parameter, and then perform sliding mean filtering; determine the first attitude angle of the flapping-wing aircraft according to the filtered first attitude parameter.
[0090] Step A2, first perform Kalman filtering on the second attitude parameter, and then perform sliding mean filtering on the second attitude parameter; determine the second attitude angle of the flapping-wing aircraft according to the filtered second attitude parameter.
[0091] In this embodiment, in order to improve the effect of subsequent data fusion, the raw data collected by the sensor is first filtered. There are currently a variety of filtering methods, such as low-pass, high-pass, band-pass, mean, median, Kalman and other filtering methods, and generally only one filtering method is used. In order to improve the filtering effect, this embodiment combines the filtering methods, and by comparing the filtering effects of different combined methods, it is determined that for flapping-wing aircraft, the best effect is to first perform Kalman filtering on attitude parameters such as acceleration and angular velocity, and then perform sliding mean filtering, which can meet the real-time and accuracy of the data, retain the periodic changes of the flapping wings, and also meet the needs of eliminating vibration and other noise in the data.
[0092] Among them, the Kalman filter algorithm is an algorithm that uses the linear system state equation, process noise and observation noise, gives reasonable weights, and optimally estimates the system state through system input and output observation data. This algorithm is mainly based on the signal observed at the current moment and the related noise, and recursively estimates and calculates the signal at the next moment through the Kalman filter algorithm. Its calculation process only needs to store the value of the signal at the current moment and give the related noise. It occupies very few resources, has high real-time performance, good filtering effect, high controllability, and is easy to implement in embedded systems. Therefore, Kalman filtering is used to perform different degrees of filtering on the six-axis sensor data. The Kalman filter algorithm is roughly as follows:
[0093] The time update equation of Kalman filter is:
[0094]
[0095] The state update equation of Kalman filter is:
[0096]
[0097] in, and are the posterior estimates at time k-1 and k, i.e. the updated results; is the prior state estimate at time k and is an intermediate parameter of the filtering process; u k-1 is the control input at time k-1; and are the posterior estimated covariances at time k-1 and k respectively; is the prior estimated covariance at time k, which is the intermediate parameter of the filtering process; H is the conversion matrix from state variables to observation variables, which represents the relationship between state and observation, H T is its transpose; z k is the measured value, also the observed value, that is, the input of the filter; K k is the calculated Kalman gain matrix; A is the state transfer matrix, which is an assumption about the target state; B is the control matrix, which is also the input matrix, which converts the input into the state matrix; Q is the covariance of the process noise, which is used to represent the error between the state transition matrix and the actual process; R is the covariance of the measurement noise, which is mainly the covariance value of the measurement value noise error; I is the unit matrix.
[0098] Among them, the covariance of the measurement noise error mainly comes from the sensor itself, which can be obtained by looking up the manual of the six-axis sensor. This embodiment mainly achieves the desired filtering effect by changing the covariance value of the process noise. For example, the process noise can be set to 0.018 and the observation noise to 0.075, which can be determined based on actual conditions.
[0099] The sliding mean filtering algorithm is to establish a data buffer, that is, a queue, and push the data into it in the order in which it is generated. Every time a new data is obtained, it is pushed to the end of the queue and the first and earliest data at the head of the queue is removed. Finally, the arithmetic mean or weighted average of all the data in the current queue including the new data is calculated. The general process of the algorithm is as follows:
[0100]
[0101] in, is the latest data sliding mean filtering result; x n+1 is the latest acquired data; x1 is the earliest acquired data in the queue; n is the sliding filter window length.
[0102] The effect of the sliding mean filter algorithm depends on the size of the sliding filter window length n. The larger the window, the more obvious and smooth the filtering effect. The smaller the window, the less obvious the filtering effect and the lower the smoothness. In this embodiment, the sliding filter window length n is set to a value less than a preset threshold; for example, n = 10, etc., which can be determined based on actual conditions. While ensuring the filtering effect, the amount of calculation can be reduced and the processing efficiency can be improved.
[0103] It can be understood that the six-axis sensor can collect six raw data (including three accelerations and three angular velocities), and Kalman filtering + sliding mean filtering can be performed on these six raw data respectively.
[0104] The periodic vibration caused by the flight characteristics of the bionic flapping-wing aircraft has the greatest impact on the vertical direction of the mass block of the accelerometer and the pitch axis of the gyroscope. This embodiment adopts the method of first Kalman filtering and then sliding mean filtering, which can minimize the impact of wing flapping on the accelerometer and gyroscope, and improve the accuracy of attitude solution.
[0105] Step S203: determining a body state for indicating the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter.
[0106] Specifically, the above step S203 "determining the body state for indicating the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter" may include the following steps S2031 and S2032.
[0107] Step S2031: Determine a body pitch state for indicating the pitch stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to pitch in the second attitude parameter.
[0108] Step S2032: Determine the body roll state for indicating the roll stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to the roll in the second attitude parameter.
[0109] In this embodiment, the pitch angle and the roll angle need to be fused separately, and the body state of the flapping-wing aircraft in different directions may be different. Therefore, this embodiment separately determines the body state of the flapping-wing aircraft in the pitch direction and the body state in the roll direction, that is, the body pitch state and the body roll state.
[0110] Specifically, there are attitude parameters related to pitch in the first attitude parameter and / or the second attitude parameter, such as front and rear acceleration, pitch angular velocity, etc. Based on the change of the attitude parameters, the body state that can represent the pitch stability of the flapping-wing aircraft, that is, the body pitch state, can be determined. Similarly, there are attitude parameters related to roll in the first attitude parameter and / or the second attitude parameter, such as left and right acceleration, roll angular velocity, etc. Based on the change of the attitude parameters, the body state that can represent the roll stability of the flapping-wing aircraft, that is, the body roll state, can be determined.
[0111] Optionally, the body state of the flapping-wing aircraft may be determined based on the variance of the attitude parameter. Specifically, the above step S203 "determining the body state used to indicate the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter" may include: determining the body state used to indicate the stability of the flapping-wing aircraft according to the variance of the first attitude parameter and / or the second attitude parameter within a preset time period; the smaller the variance, the higher the stability of the flapping-wing aircraft.
[0112] In this embodiment, the preset time period can be a time period of a certain length determined based on the current time. Within the preset time period, the variance of the corresponding attitude parameters can be determined. The smaller the variance, the more stable the flight of the flapping-wing aircraft within the preset time period, that is, the higher the degree of stability.
[0113] Specifically, the variance of the pitch-related attitude parameter in the first attitude parameter and / or the second attitude parameter within a preset time period can be calculated, and then the body pitch state used to represent the pitch stability of the flapping-wing aircraft can be determined based on the variance. Similarly, the variance of the roll-related attitude parameter in the first attitude parameter and / or the second attitude parameter within a preset time period can also be calculated, and the body roll state used to represent the roll stability of the flapping-wing aircraft can be determined based on the variance.
[0114] For example, if the body state is divided into a stable state and a maneuvering state, a corresponding threshold can be set for the variance; if the variance is less than the threshold, the body state of the flapping-wing aircraft is determined to be a stable state; if the variance is greater than the threshold, the body state of the flapping-wing aircraft is determined to be a maneuvering state.
[0115] In this embodiment, the stability of the flapping-wing aircraft can be determined simply and quickly by using the variance of the attitude parameter within a preset time period, and further the body state of the flapping-wing aircraft can be determined.
[0116] Step S204: setting corresponding confidence levels for the first attitude angle and the second attitude angle respectively based on the body state of the flapping-wing aircraft.
[0117] Specifically, the above step S204 of “setting corresponding confidence levels for the first attitude angle and the second attitude angle respectively based on the body state of the flapping-wing aircraft” includes the following steps S2041 and S2042.
[0118] Step S2041, when the first attitude angle includes the first pitch angle and the second attitude angle includes the second pitch angle, based on the body pitch state of the flapping-wing aircraft, respectively set corresponding confidences for the first pitch angle and the second pitch angle.
[0119] Step S2042, when the first attitude angle includes the first roll angle and the second attitude angle includes the second roll angle, based on the body roll state of the flapping-wing aircraft, respectively set corresponding confidence levels for the first roll angle and the second roll angle.
[0120] In this embodiment, if the first attitude angle and the second attitude angle both include the pitch angle, that is, the first attitude angle includes the first pitch angle, and the second attitude angle includes the second pitch angle, in order to be able to fuse the first pitch angle and the second pitch angle, based on the pitch state of the flapping-wing aircraft, corresponding confidence levels are set for the first pitch angle and the second pitch angle, respectively.
[0121] Among them, the higher the degree of stability represented by the pitch state of the flapping-wing aircraft, the higher the confidence set for the first pitch angle, and the lower the confidence set for the second pitch angle; conversely, the lower the degree of stability represented by the pitch state of the flapping-wing aircraft, the lower the confidence set for the first pitch angle, and the higher the confidence set for the second pitch angle.
[0122] Similarly, if the first attitude angle and the second attitude angle both include a roll angle, that is, the first attitude angle includes the first roll angle, and the second attitude angle includes the second roll angle, in order to be able to fuse the first roll angle and the second roll angle, based on the body roll state of the flapping-wing aircraft, corresponding confidence levels are set for the first roll angle and the second roll angle, respectively.
[0123] Moreover, the higher the degree of stability represented by the body roll state of the flapping-wing aircraft, the higher the confidence set for the first roll angle, and the lower the confidence set for the second roll angle; conversely, the lower the degree of stability represented by the body roll state of the flapping-wing aircraft, the lower the confidence set for the first roll angle, and the higher the confidence set for the second roll angle.
[0124] Step S205: fuse the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
[0125] For details, please see Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0126] In some optional embodiments, the first attitude angle and the second attitude angle can be fused based on a volumetric Kalman filter algorithm; wherein, according to the confidence levels of the first attitude angle and the second attitude angle, the parameters of the volumetric Kalman filter are changed, i.e., based on a volumetric Kalman filter with variable parameters, data fusion is achieved to determine the fused attitude angle.
[0127] Figure 3 FIG. 1 shows a schematic diagram of a process for determining the fused pitch angle and roll angle. Figure 3 As shown, the original information collected by the sensor (the first attitude parameter and the second attitude parameter) can be first subjected to Kalman filtering and sliding mean filtering, and then the accelerometer and gyroscope are respectively determined to fuse the pitch angle and roll angle using a variable parameter cubature Kalman filter. In the fusion process, the confidence corresponding to the accelerometer and gyroscope can be modified in real time based on the body state, so that the fused pitch angle and roll angle can be as unaffected by the body vibration as possible, thereby ensuring the accuracy of the attitude solution result.
[0128] Specifically, the above step S205 "fusing the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft" includes the following steps B1 to B3.
[0129] Step B1, updating the first process noise covariance according to the confidence level corresponding to the first attitude angle, and updating the second process noise covariance according to the confidence level corresponding to the second attitude angle.
[0130] Step B2, taking the last determined fusion attitude angle as the state quantity and the first attitude angle as the observation quantity, performing cubature Kalman filtering processing according to the first process noise covariance, and generating a predicted attitude angle.
[0131] Step B3, taking the predicted attitude angle as the state quantity and the second attitude angle as the observation quantity, performing cubature Kalman filtering again according to the second process noise covariance to generate a fusion attitude angle of the flapping-wing aircraft.
[0132] In this embodiment, two cubature Kalman filters are used to achieve the fusion of the first attitude angle and the second attitude angle. In addition, by correcting and updating the process noise covariance P of the cubature Kalman filter by confidence, the corresponding attitude angle can be filtered and updated based on different confidences.
[0133] Among them, the volumetric Kalman filter algorithm is mainly based on the third-order spherical radial volume criterion, which approximates a set of volume points to the state mean and covariance of a nonlinear system with additional Gaussian noise. It is an approximate algorithm close to Bayesian filtering and is more applicable to solving the problem of nonlinear system state estimation. Among them, transforming the nonlinear Gaussian filter integral form into the spherical radial integral form and the third-order spherical radial criterion are two key steps. Figure 4 As shown in the figure, the algorithm mainly includes three parts: initialization, time update and measurement update. The main process is as follows:
[0134] 1. Initialization:
[0135]
[0136] in, is the state vector, x0 is the initial quantity, P k is the estimated covariance.
[0137] 2. Time update:
[0138] (2.1) Calculate volume points:
[0139] (Cholesky decomposition);
[0140] And i is the coefficient of the ith volume point;
[0141]
[0142] Where n is the dimension of the state variable, e is the unit matrix, S k is the Cholesky decomposition result, is the i-th volume point.
[0143] (2.2) Propagation volume point:
[0144] (2.3) Calculate the predicted value of state quantity and the predicted value of error covariance:
[0145]
[0146] Among them, x is the state quantity, P is the process noise covariance, and Q is the measurement noise covariance; is the i-th propagation volume point, is the predicted value of the state quantity, P k+1|k is the estimated covariance predicted value.
[0147] 3. Measurement update:
[0148] (3.1) Calculate volume points:
[0149] (3.2) Propagation volume point:
[0150] (3.3) Calculate the measured predicted value:
[0151] Among them, S k+1|k is the Cholesky decomposition result, Propagate volume points for measured values, To measure the predicted value.
[0152] (3.4) Calculate the estimated covariance and cross-covariance;
[0153]
[0154] in, To measure the estimated covariance, To measure the estimated cross-covariance, Transpose of the points in the volume propagation for the measurements.
[0155] (3.5) Gain, state, and estimated covariance update.
[0156]
[0157] Among them, K k+1 is the filter gain, is the prediction result of the filtering state quantity, P k+1 To estimate the covariance prediction results.
[0158] In this embodiment, when the first attitude angle is processed by volumetric Kalman filtering, the process noise covariance used in the process is called the first process noise covariance, and the first process noise covariance is updated according to the confidence corresponding to the first attitude angle; for example, the higher the confidence, the lower the value in the process noise covariance. In addition, when the first attitude angle is processed by volumetric Kalman filtering, in addition to taking the first attitude angle as the collected observation quantity, the last determined fusion attitude angle is also taken as the estimated state quantity, and the state quantity can be randomly generated initially. Based on this, the first attitude angle is processed by volumetric Kalman filtering, and the first attitude angle can be updated using the corresponding confidence, and the prediction result of the attitude angle can be obtained, that is, the predicted attitude angle, such as the predicted pitch angle, the predicted roll angle, etc.
[0159] After that, the second attitude angle is processed by volume Kalman filtering; at this time, the process noise covariance used in the process is called the second process noise covariance, and the second process noise covariance is updated according to the confidence corresponding to the second attitude angle; in addition, in addition to taking the second attitude angle as the collected observation quantity, the predicted attitude angle determined in step B2 is also used as the estimated state quantity, based on which the second attitude angle is processed by volume Kalman filtering, while realizing the update of the second attitude angle based on the corresponding confidence degree, the fusion of the first attitude angle and the second attitude angle can also be realized. And, the fused attitude angle determined at this time can be used as the state quantity for the next fusion, and this is repeated.
[0160] Figure 5 The schematic diagram of the fusion process based on two cubature Kalman filters is shown. It can be understood that when the pitch angle and the roll angle need to be predicted, they need to be fused separately, that is, both are fused through two cubature Kalman filters.
[0161] In this embodiment, the pitch angle and roll angle calculated respectively by the acceleration and angular velocity collected by the six-axis accelerometer and gyroscope are subjected to two variable parameter cubature Kalman filtering algorithms according to the real-time state of the aircraft to fuse the two pitch angles and the two roll angles together to obtain a fused pitch angle and a fused roll angle. This fusion method combines the stability of the accelerometer and the speed of the gyroscope, and can obtain a more accurate and real-time attitude angle.
[0162] In some optional embodiments, the method further includes a process of determining the heading angle of the flapping-wing aircraft in real time, and the process may specifically include the following steps C1 to C3.
[0163] Step C1, determining the current position of the flapping-wing aircraft in the current positioning cycle, and determining the initial heading angle of the flapping-wing aircraft according to the current position and the historical position; the historical position is the position of the flapping-wing aircraft determined in the historical positioning cycle.
[0164] Step C2: in the current positioning cycle, determining the yaw angle displacement of the flapping-wing aircraft in real time according to the second attitude parameter.
[0165] Step C3, interpolating the yaw angle displacement based on the initial heading angle to generate the real-time heading angle of the flapping-wing aircraft.
[0166] Flapping-wing aircraft generally determine their own position information based on satellite positioning. However, since the time interval for obtaining civil satellite positioning information is about once per second, and the flight speed of the bionic flapping-wing aircraft is about 8m / s, such a time interval is too long, and the calculated positioning information and heading angle information have a long delay, which affects the attitude solution result and control effect of the aircraft. In this embodiment, based on the time interval for obtaining satellite positioning information, the positioning process is divided into multiple positioning cycles; in each positioning cycle, the position of the flapping-wing aircraft at the beginning of the positioning cycle can be determined based on the satellite positioning module of the flapping-wing aircraft. On this basis, combined with the characteristics of sensors that can collect data in real time, the attitude determined in the positioning cycle is interpolated, so that the real-time attitude can be determined in the presence of a time interval.
[0167] Specifically, in the current positioning cycle, the current position of the flapping-wing aircraft can be determined, and the historical position of the flapping-wing aircraft in the historical positioning cycle (generally the previous positioning cycle of the current positioning cycle) can be determined. Based on the two positions, the heading angle of the flapping-wing aircraft can be simply determined, which is referred to as the initial heading angle in this embodiment. It can be understood that the initial heading angle can be used as the heading angle of the flapping-wing aircraft when the current position is determined in the current positioning cycle.
[0168] Moreover, in the current positioning cycle, the angular velocity sensor of the gyroscope can determine the second attitude parameter in real time (generally in milliseconds), and then based on the yaw angular velocity therein, the yaw angular displacement of the flapping-wing aircraft can be determined. For example, the yaw angular displacement can be calculated by trapezoidal integration, and the yaw angular displacement is the size of the yaw angle.
[0169] Therefore, in the current positioning cycle, the yaw angle displacement determined in real time can be interpolated based on the initial heading angle, so that the heading angle can be updated in real time, the real-time heading angle of the flapping-wing aircraft can be determined, and the fusion of satellite positioning and angular velocity sensor can be realized.
[0170] Figure 6 FIG. 2 shows a schematic diagram of determining the real-time heading angle. Figure 6As shown, through the satellite positioning module of the flapping-wing aircraft, the real-time position at the current moment, that is, the current position, can be obtained, and the position of the previous moment recorded before, that is, the historical position can also be obtained; based on the two positions, the heading angle within this time period can be calculated, for example, the heading angle can be a heading angle based on the north direction of the earth (absolute value). In addition, the yaw angular velocity collected by the gyroscope is subjected to the above-mentioned Kalman filtering and sliding mean filtering to obtain the filtered yaw angular velocity; in each positioning cycle, the filtered yaw angular velocity is subjected to trapezoidal integration to obtain the yaw angular displacement. Finally, the yaw angular displacement obtained by the real-time integration is conditionally interpolated to each heading angle, and abnormal values can be eliminated, so as to obtain the real-time heading angle through fusion correction.
[0171] In some optional embodiments, the method further includes a process of determining the real-time position of the flapping-wing aircraft in real time, and the process may specifically include the following steps C4 to C6.
[0172] Step C4, determining the flight speed of the flapping-wing aircraft in real time during the current positioning cycle.
[0173] Step C5, integrating the flight speed according to the yaw angle displacement to determine the short-term displacement of the flapping-wing aircraft within the speed sampling time.
[0174] Step C6, interpolating the short-term displacement based on the current position to generate the real-time position of the flapping-wing aircraft.
[0175] In this embodiment, similar to the above process of determining the real-time heading angle, the real-time flight speed of the flapping-wing aircraft can be integrated to determine the displacement of the flapping-wing aircraft, and then the current position of the flapping-wing aircraft can be interpolated to determine the real-time position of the flapping-wing aircraft.
[0176] Specifically, the flight speed of the flapping-wing aircraft can be calculated in real time based on the data collected by the sensors of the flapping-wing aircraft (for example, data collected by a six-axis sensor). The flight speed corresponds to the sampling time of the sensor (generally in milliseconds); within the sampling time, the displacement of the flapping-wing aircraft along the yaw angle can be determined by integration. Since the sampling time is generally short, it is called "short-time displacement", and the "short-time" here has no specific physical meaning. Moreover, the real-time position of the flapping-wing aircraft can be generated in real time by interpolating the short-time displacement based on the current position.
[0177] Figure 7 Schematic diagram of determining real-time position is shown. Figure 7 As shown, through the satellite positioning module of the flapping-wing aircraft, the real-time position at the current moment and the position coordinates recorded at the previous moment can be obtained, and the real-time flight speed can be determined; and Figure 6As shown in the figure, the yaw angular velocity collected by the gyroscope is subjected to the above-mentioned Kalman filtering and sliding mean filtering to obtain the filtered yaw angular velocity; in each positioning cycle, the filtered yaw angular velocity is integrated through trapezoidal integration to obtain the yaw angular displacement.
[0178] Through geometric relationships, the yaw angle displacement between satellite positioning intervals can be used to integrate the real-time flight speed to obtain a short-time displacement, i.e., a short-time displacement. Finally, the obtained short-time displacement is converted to obtain the satellite coordinates of the satellite positioning interval, which are interpolated and fused into the real-time satellite coordinates to determine the real-time position of the flapping-wing aircraft.
[0179] The attitude solution method for flapping-wing aircraft provided in this embodiment filters and then fuses the attitude parameters collected by the sensor, and can calculate the pitch angle and roll angle in the Euler angle of the body; and when fusing the pitch angle and roll angle, the confidence is set based on the pitch state and roll state of the flapping-wing aircraft respectively, which can ensure that the pitch angle and the roll angle do not affect each other, and can ensure the accuracy of the determined attitude. The fusion is performed by two cubature Kalman filters, which combines the stability of the accelerometer and the rapidity of the gyroscope, and can obtain a more accurate and real-time attitude angle. In addition, the yaw angle change of the body is calculated based on the angular velocity sensor, and then the obtained yaw angle change is fused and interpolated to the flight heading angle to obtain a real-time heading angle with better real-time performance and accuracy; and by fusing and interpolating the displacement determined based on the flight speed, a real-time position with better real-time performance and accuracy can also be obtained.
[0180] This embodiment also provides a flapping-wing aircraft, which includes: an aircraft body, a controller, and an actuator controlled by the controller; the controller is used to execute the attitude solution method of the flapping-wing aircraft provided in any of the above embodiments.
[0181] In this embodiment, the body of the flapping-wing aircraft may specifically include mechanical structures such as wings and tail wings, and the actuator may specifically include motors, servos, etc. The actuator drives the mechanical structure to move, so that the flapping-wing aircraft can complete the required flight mission.
[0182] For example, the execution structure includes a steering servo and a pitch servo located at the tail wing. After the attitude of the flapping-wing aircraft is solved, the corresponding steering control amount and pitch control amount can be determined based on the actual mission requirements, and then the steering servo and the pitch servo can be controlled separately.
[0183] Among them, steering is achieved by driving the steering blades through the action of the steering servo, generating airflow changes, and the directionality of the steering control quantity output by the controller determines the direction of left and right steering. Similarly, pitching is achieved by driving the pitch servo through the action of the pitch servo, generating airflow changes, and the directionality of the pitch control quantity output by the controller determines the up and down direction of pitching.
[0184] In this embodiment, a device for calculating the attitude of a flapping-wing aircraft is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0185] This embodiment provides a device for calculating the attitude of a flapping-wing aircraft. Figure 8 As shown, including:
[0186] The parameter acquisition module 801 is used to acquire a first posture parameter acquired by a first sensor and acquire a second posture parameter acquired by a second sensor; the first sensor is an acceleration sensor and the second sensor is an angular velocity sensor;
[0187] An attitude determination module 802 is used to determine a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and to determine a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle;
[0188] The fusion processing module 803 is used to determine the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter; set corresponding confidence levels for the first attitude angle and the second attitude angle based on the body state of the flapping-wing aircraft; and fuse the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
[0189] In some optional implementations, the attitude determination module 802 determines a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determines a second attitude angle of the flapping-wing aircraft according to the second attitude parameter, including:
[0190] The first attitude parameter is first subjected to Kalman filtering and then subjected to sliding mean filtering; a first attitude angle of the flapping-wing aircraft is determined according to the filtered first attitude parameter;
[0191] The second attitude parameter is first subjected to Kalman filtering processing and then subjected to sliding mean filtering processing; and the second attitude angle of the flapping-wing aircraft is determined according to the filtered second attitude parameter.
[0192] In some optional implementations, the fusion processing module 803 determines the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter, including:
[0193] Determine a body pitch state for indicating a pitch stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to pitch in the second attitude parameter;
[0194] Determine a body roll state for indicating the roll stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to the roll in the second attitude parameter;
[0195] The fusion processing module 803 sets corresponding confidence levels for the first attitude angle and the second attitude angle based on the body state of the flapping-wing aircraft, including:
[0196] When the first attitude angle includes a first pitch angle and the second attitude angle includes a second pitch angle, based on a body pitch state of the flapping-wing aircraft, setting corresponding confidences for the first pitch angle and the second pitch angle respectively;
[0197] In a case where the first attitude angle includes a first roll angle and the second attitude angle includes a second roll angle, corresponding confidence levels are set for the first roll angle and the second roll angle respectively based on a body roll state of the flapping-wing aircraft.
[0198] In some optional implementations, the fusion processing module 803 determines the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter, including:
[0199] According to the variance of the first attitude parameter and / or the second attitude parameter within a preset time period, a body state used to represent the stability of the flapping-wing aircraft is determined; the smaller the variance is, the higher the stability of the flapping-wing aircraft is.
[0200] In some optional implementations, the fusion processing module 803 fuses the first attitude angle and the second attitude angle according to the confidence level to generate a fusion attitude angle of the flapping-wing aircraft, including:
[0201] updating a first process noise covariance according to the confidence level corresponding to the first attitude angle, and updating a second process noise covariance according to the confidence level corresponding to the second attitude angle;
[0202] Taking the fused attitude angle determined last time as a state quantity and the first attitude angle as an observation quantity, performing cubature Kalman filtering processing according to the first process noise covariance to generate a predicted attitude angle;
[0203] The predicted attitude angle is used as a state quantity, the second attitude angle is used as an observation quantity, and cubature Kalman filtering processing is performed again according to the second process noise covariance to generate a fusion attitude angle of the flapping-wing aircraft.
[0204] In some optional implementations, the fusion processing module 803 is further configured to:
[0205] Determine the current position of the flapping-wing aircraft within a current positioning cycle, and determine the initial heading angle of the flapping-wing aircraft according to the current position and a historical position; the historical position is the position of the flapping-wing aircraft determined within a historical positioning cycle;
[0206] In the current positioning cycle, determining the yaw angle displacement of the flapping-wing aircraft in real time according to the second attitude parameter;
[0207] The yaw angle displacement is interpolated on the basis of the initial heading angle to generate a real-time heading angle of the flapping-wing aircraft.
[0208] In some optional implementations, the fusion processing module 803 is further configured to:
[0209] Determining the flight speed of the flapping-wing aircraft in real time during the current positioning cycle;
[0210] Integrating the flight speed according to the yaw angle displacement to determine the short-term displacement of the flapping-wing aircraft within the speed sampling time;
[0211] The short-term displacement is interpolated based on the current position to generate the real-time position of the flapping-wing aircraft.
[0212] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0213] The attitude solving device of the flapping-wing aircraft in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0214] The embodiment of the present invention also provides a computer device having the above Figure 8 The attitude solver of the flapping-wing aircraft shown.
[0215] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0216] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0217] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0218] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0219] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0220] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0221] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0222] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0223] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations should all be included in the protection scope of the present invention.
Claims
1. A method for calculating the attitude of a flapping-wing aircraft, characterized in that: The method comprises: Acquire a first posture parameter collected by a first sensor, and acquire a second posture parameter collected by a second sensor; the first sensor is an acceleration sensor, and the second sensor is an angular velocity sensor; Determine a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determine a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle; Determining a body state for indicating a degree of stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter; Based on the body state of the flapping-wing aircraft, setting corresponding confidence levels for the first attitude angle and the second attitude angle respectively; The first attitude angle and the second attitude angle are fused according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
2. The method according to claim 1, characterized in that Determining a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and determining a second attitude angle of the flapping-wing aircraft according to the second attitude parameter, comprises: The first attitude parameter is first subjected to Kalman filtering and then subjected to sliding mean filtering; a first attitude angle of the flapping-wing aircraft is determined according to the filtered first attitude parameter; The second attitude parameter is first subjected to Kalman filtering processing and then subjected to sliding mean filtering processing; and the second attitude angle of the flapping-wing aircraft is determined according to the filtered second attitude parameter.
3. The method according to claim 1, characterized in that Determining the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter includes: Determine a body pitch state for indicating a pitch stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to pitch in the second attitude parameter; Determine a body roll state for indicating the roll stability of the flapping-wing aircraft according to the first attitude parameter and / or the attitude parameter related to the roll in the second attitude parameter; The step of setting corresponding confidence levels for the first attitude angle and the second attitude angle based on the body state of the flapping-wing aircraft comprises: When the first attitude angle includes a first pitch angle and the second attitude angle includes a second pitch angle, based on a body pitch state of the flapping-wing aircraft, setting corresponding confidences for the first pitch angle and the second pitch angle respectively; In a case where the first attitude angle includes a first roll angle and the second attitude angle includes a second roll angle, corresponding confidence levels are set for the first roll angle and the second roll angle respectively based on a body roll state of the flapping-wing aircraft.
4. The method according to claim 1 or 3, characterized in that: Determining the body state used to represent the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter includes: According to the variance of the first attitude parameter and / or the second attitude parameter within a preset time period, a body state used to represent the stability of the flapping-wing aircraft is determined; the smaller the variance is, the higher the stability of the flapping-wing aircraft is.
5. The method according to claim 1, characterized in that: The step of fusing the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft includes: updating a first process noise covariance according to the confidence level corresponding to the first attitude angle, and updating a second process noise covariance according to the confidence level corresponding to the second attitude angle; Taking the fused attitude angle determined last time as a state quantity and the first attitude angle as an observation quantity, performing cubature Kalman filtering processing according to the first process noise covariance to generate a predicted attitude angle; The predicted attitude angle is used as a state quantity, the second attitude angle is used as an observation quantity, and cubature Kalman filtering processing is performed again according to the second process noise covariance to generate a fusion attitude angle of the flapping-wing aircraft.
6. The method according to claim 1, characterized in that Also includes: Determine the current position of the flapping-wing aircraft within the current positioning cycle, and determine the initial heading angle of the flapping-wing aircraft according to the current position and the historical position; The historical position is the position of the flapping-wing aircraft determined within a historical positioning period; In the current positioning cycle, determining the yaw angle displacement of the flapping-wing aircraft in real time according to the second attitude parameter; The yaw angle displacement is interpolated on the basis of the initial heading angle to generate a real-time heading angle of the flapping-wing aircraft.
7. The method according to claim 6, characterized in that Also includes: Determining the flight speed of the flapping-wing aircraft in real time during the current positioning cycle; Integrating the flight speed according to the yaw angle displacement to determine the short-term displacement of the flapping-wing aircraft within the speed sampling time; The short-term displacement is interpolated based on the current position to generate the real-time position of the flapping-wing aircraft.
8. An attitude calculation device for a flapping-wing aircraft, characterized in that: The device comprises: A parameter acquisition module, used to acquire a first posture parameter acquired by a first sensor, and to acquire a second posture parameter acquired by a second sensor; the first sensor is an acceleration sensor, and the second sensor is an angular velocity sensor; an attitude determination module, configured to determine a first attitude angle of the flapping-wing aircraft according to the first attitude parameter, and to determine a second attitude angle of the flapping-wing aircraft according to the second attitude parameter; the first attitude angle and the second attitude angle both include a pitch angle and / or a roll angle; A fusion processing module is used to determine a body state representing the stability of the flapping-wing aircraft according to the first attitude parameter and / or the second attitude parameter; based on the body state of the flapping-wing aircraft, set corresponding confidence levels for the first attitude angle and the second attitude angle respectively; and fuse the first attitude angle and the second attitude angle according to the confidence level to generate a fused attitude angle of the flapping-wing aircraft.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the attitude solution method for a flapping-wing aircraft according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the attitude calculation method for a flapping-wing aircraft according to any one of claims 1 to 7.
11. A flapping-wing aircraft, characterized in that: include: A machine body, a controller and an actuator controlled by the controller; The controller is used to execute the attitude solution method of the flapping-wing aircraft according to any one of claims 1 to 7.