A micro flapping-wing aircraft autonomous obstacle avoidance method and device based on ToF sensing

CN122593359APending Publication Date: 2026-08-18UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610703757.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-21
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

传统飞行控制器在进行姿态误差解算时多依赖欧拉角直接相减,当飞行器在避障大机动中跨越±180°边界时,极易产生万向节死锁或角度突变,这种奇异点现象会导致比例-积分-微分(Proportional-Integral-Derivative,PID)控制器瞬间输出满舵指令,从而引发严重的炸机事故

Benefits of technology

[0010]本发明实施例提供的技术方案带来的有益效果至少包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593359A_ABST
    Figure CN122593359A_ABST
Patent Text Reader

Abstract

The application discloses a kind of micro flapping wing aircraft autonomous obstacle avoidance method and device based on ToF perception, it is related to flapping wing aircraft control technical field.The method comprises the following steps: based on DFS algorithm, according to original depth data matrix and target state code, connected domain clustering is carried out, and obstacle feature is extracted;Based on the hierarchical obstacle avoidance strategy of spatial partition, according to the independent obstacle feature set, partition obstacle avoidance instruction mapping is carried out;Based on historical obstacle avoidance instruction queue, according to autonomous obstacle avoidance instruction, deadlock state check is carried out, and instruction smoothing processing is carried out;Based on the heading control mode, according to the safe navigation parameter, through dual-mode heading control mechanism, attitude closed-loop control is carried out;According to the yaw channel control quantity and safe navigation parameter fusion control signal, drive micro flapping wing aircraft to carry out autonomous obstacle avoidance flight control.The application is a kind of micro flapping wing aircraft autonomous obstacle avoidance method based on ToF perception, hardware light weight, low and high degree of adaptation of computing power expenditure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of flapping-wing aircraft control technology, and in particular to a method and device for autonomous obstacle avoidance of a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. Background Technology

[0002] Micro flapping-wing aircraft, with their excellent low-speed flight capability, high maneuverability, and small size, have shown great application potential in fields such as indoor reconnaissance and confined space exploration. Micro flapping-wing aircraft typically rely on the high-frequency periodic flapping of their wings to generate lift and thrust, and achieve attitude control through the deflection of the tail mechanism. However, achieving autonomous obstacle avoidance flight on such a highly dynamic and strongly coupled micro-platform still faces many insurmountable bottlenecks in current technology.

[0003] The payload capacity of micro ornithopter aircraft is typically only a few grams to a dozen grams, and the computing power of the onboard microprocessor is extremely limited. Traditional autonomous obstacle avoidance solutions mostly rely on simultaneous localization and mapping (SLAM) technology using lidar or binocular vision. However, lidar is bulky and heavy, completely exceeding the payload limit of micro ornithopter aircraft. Even if we turn to vision and deep learning solutions, their high computing power requirements are difficult to efficiently deploy on the extremely lightweight general-purpose onboard microcontroller unit (MCU) of ornithopter aircraft. Furthermore, the high-frequency, periodic, and severe vibrations of the fuselage during flight can easily cause severe blurring of the images captured by the camera, leading to frequent failures of feature point extraction and visual obstacle avoidance algorithms.

[0004] Multi-area Time of Flight (ToF) sensor arrays are unaffected by ambient light and insensitive to vibration, making them ideal lightweight sensing sources for micro flapping-wing aircraft. However, existing ToF-based obstacle avoidance solutions still have significant shortcomings in practical applications. Because the depth matrix output by ToF is extremely sparse, conventional simple threshold obstacle avoidance logic cannot effectively extract obstacle contours, causing the aircraft to easily fall into decision deadlock due to frequent left-right swaying when facing complex environments such as corners or concave obstacles. Micro flapping-wing flying robots have extremely strong aerodynamic coupling; even slight asymmetric deformation of the wings and airflow disturbances can lead to severe yaw drift. Under this strong coupling characteristic, traditional attitude control, which does not decouple obstacle avoidance maneuvers from straight-line cruise, is prone to causing uncontrolled spinning when general obstacle avoidance commands are directly superimposed. Traditional flight controllers often rely on direct subtraction of Euler angles when calculating attitude errors. When an aircraft crosses the ±180° boundary during obstacle avoidance maneuvers, it is prone to gimbal lock-up or sudden angle changes. This singularity phenomenon can cause the proportional-integral-derivative (PID) controller to output full control commands instantaneously, which can lead to serious crashes.

[0005] In the existing technology, there is a lack of an autonomous obstacle avoidance method for micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing that is lightweight in hardware, has low computing power consumption, and is highly adaptable. Summary of the Invention

[0006] To address the technical problems of load limitations, computational bottlenecks, and control instability caused by high-dynamic aerodynamic coupling in existing obstacle avoidance technologies in confined, unstructured environments, this invention provides an autonomous obstacle avoidance method and device for a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. The technical solution is as follows: On the one hand, a method for autonomous obstacle avoidance of a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing is provided. This method is implemented by an autonomous obstacle avoidance device for the micro flapping-wing aircraft and includes: Environmental information is collected using a multi-region ToF sensor to obtain the raw depth data matrix and target status code; the current heading angle and current angular velocity of the micro flapping-wing aircraft are also obtained. Based on the DFS algorithm, connected component clustering is performed according to the original depth data matrix and target state codes, and obstacle features are extracted to obtain an independent obstacle feature set. A hierarchical obstacle avoidance strategy based on spatial partitioning maps obstacle avoidance commands to autonomous obstacle avoidance commands based on an independent set of obstacle features and preset system control parameters. Obtain the historical obstacle avoidance command queue of the micro flapping-wing aircraft; based on the historical obstacle avoidance command queue, perform deadlock state verification according to the autonomous obstacle avoidance commands, and perform command smoothing to obtain safe navigation parameters; The heading control mode is determined based on the safe navigation parameters; based on the heading control mode, attitude closed-loop control is performed through a dual-mode heading control mechanism according to the safe navigation parameters, the current heading angle and the current angular velocity to obtain the yaw channel control quantity; Based on the yaw channel control quantity and safe navigation parameters, the control signals are fused through a polarity mixing matrix to obtain the PWM duty cycle signal; based on the PWM duty cycle signal, the micro flapping-wing aircraft is driven to perform autonomous obstacle avoidance flight control.

[0007] On the other hand, a ToF-based autonomous obstacle avoidance device for micro flapping-wing aircraft is provided. This device is applied to the ToF-based autonomous obstacle avoidance method for micro flapping-wing aircraft, and includes: The information acquisition module is used to collect environmental information based on multi-region ToF sensors, obtain the raw depth data matrix and target status code; and acquire the current heading angle and current angular velocity of the micro flapping-wing aircraft. The obstacle detection module is used to perform connected component clustering based on the DFS algorithm, according to the original depth data matrix and target state codes, and extract obstacle features to obtain an independent obstacle feature set. The obstacle avoidance decision module is used for hierarchical obstacle avoidance strategies based on spatial partitioning. It maps obstacle avoidance commands to partitions according to the set of independent obstacle features and preset system control parameters to obtain autonomous obstacle avoidance commands. The deadlock verification module is used to obtain the historical obstacle avoidance command queue of the micro flapping-wing aircraft; based on the historical obstacle avoidance command queue, it performs deadlock state verification according to the autonomous obstacle avoidance commands, and performs command smoothing to obtain safe navigation parameters; The attitude control module is used to determine the heading control mode based on the safe navigation parameters; based on the heading control mode, attitude closed-loop control is performed through a dual-mode heading control mechanism according to the safe navigation parameters, the current heading angle and the current angular velocity to obtain the yaw channel control quantity; The execution output module is used to fuse control signals through a polarity mixing matrix based on the yaw channel control quantity and safety navigation parameters to obtain a PWM duty cycle signal; and to drive the micro flapping-wing aircraft to perform autonomous obstacle avoidance flight control based on the PWM duty cycle signal.

[0008] On the other hand, an autonomous obstacle avoidance device for a micro flapping-wing aircraft is provided. The autonomous obstacle avoidance device for a micro flapping-wing aircraft includes: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the methods described above for autonomous obstacle avoidance of a micro flapping-wing aircraft based on ToF perception is implemented.

[0009] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement any of the above-described methods for autonomous obstacle avoidance of micro flapping-wing aircraft based on ToF perception.

[0010] The beneficial effects of the technical solutions provided by the embodiments of the present invention include at least the following: This invention proposes an autonomous obstacle avoidance method for micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. By constructing a complete closed-loop strategy integrating sparse point cloud connected domain clustering, spatial hierarchical obstacle avoidance decision-making, and low-level singularity-free vectorized control, it effectively overcomes the sensing failure problem under high-frequency flapping vibrations while meeting the constraints of extremely low computing power and power consumption on a micro-platform. It also improves the angle abrupt changes and attitude loss of control caused by large-maneuver obstacle avoidance, significantly enhancing the real-time performance, robustness, and flight stability of the aircraft in complex and unknown environments. This provides core technical support for the fully autonomous engineering application of micro biomimetic aircraft. This invention is a hardware-lightweight, low-computing-cost, and highly adaptable autonomous obstacle avoidance method for micro flapping-wing aircraft based on ToF sensing. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of an autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing, provided by an embodiment of the present invention. Figure 2 This is a block diagram of an autonomous obstacle avoidance device for a micro flapping-wing aircraft based on ToF sensing, provided in an embodiment of the present invention. Figure 3 This is a structural schematic diagram of an autonomous obstacle avoidance device for a micro flapping-wing aircraft provided in an embodiment of the present invention. Detailed Implementation

[0013] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0014] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0015] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0016] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0017] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0018] This invention provides a method for autonomous obstacle avoidance of a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. This method can be implemented by an autonomous obstacle avoidance device for the micro flapping-wing aircraft, which can be a terminal or a server. Figure 1 The flowchart shown is for an autonomous obstacle avoidance method for a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. The processing flow of this method may include the following steps: S1. Collect environmental information based on multi-region ToF sensors to obtain the raw depth data matrix and target status code; obtain the current heading angle and current angular velocity of the micro flapping-wing aircraft; In one feasible implementation, the present invention uses a miniaturized multi-region ToF sensor array and a miniature high-frequency inertial measurement unit (IMU) as the sensing input, and a lightweight general-purpose microcontroller as the core calculation unit. Based on the principle of optimizing the center of gravity layout of the flapping wing fuselage, the physical connection and basic power supply adaptation of the main control board, sensors, tail fin micro servos and drive motors are completed to meet the stringent micro-load constraints of flapping wing aircraft.

[0019] S2. Based on the DFS algorithm, connected component clustering is performed according to the original depth data matrix and target state codes, and obstacle features are extracted to obtain an independent obstacle feature set. In one feasible implementation, this invention addresses the problem of visual blurring and failure caused by high-frequency flapping vibrations in micro flapping-wing aircraft. The invention designs a multi-region ToF depth matrix processing mechanism based on Depth First Search (DFS). It abandons complex visual networks with high computational costs, and accurately extracts the boundary contours and centroid features of obstacles through binarization of depth data and clustering of spatially adjacent pixels. This architecture perfectly adapts to the underlying hardware constraints of general-purpose microcontrollers, achieving high real-time reconstruction of edge-side environmental features with extremely low computational overhead.

[0020] Optionally, based on the DFS algorithm, connected component clustering is performed according to the original depth data matrix and target state codes, and obstacle features are extracted to obtain an independent obstacle feature set, including: Based on a preset processing distance threshold, the original depth data matrix is ​​binarized according to the target status code to obtain a binarized feature matrix. Based on the binarized feature matrix, the DFS algorithm is used to cluster connected components to obtain the connected component label feature matrix. Obstacle feature statistics are performed based on the connected component label feature matrix to obtain an independent obstacle feature set.

[0021] In one feasible implementation, the raw depth data matrix and target status codes of a multi-region ToF sensor are obtained. To address the problem of sparse ToF data containing invalid noise, depth-first search is used for clustering and segmentation.

[0022] For each pixel region of the ToF output, a status code verification is performed to remove invalid data, and a processing distance threshold is introduced. If the depth value of a certain pixel region If the state is valid, set it to 1; otherwise, set it to 0, generating a binary feature matrix. .

[0023] Traversing the binary matrix Effective pixels with 8 adjacency relationships (horizontal, vertical, and diagonal) are divided into the same connected component label feature matrix.

[0024] For the first clustered For each obstacle, count the total number of pixels it contains. Extract the minimum depth value within this region. As the reference distance for obstacle avoidance, its pixel centroid coordinates are calculated. The formula for calculating the centroid is as follows (1): , (1); in, , The first one inside the obstacle The row and column index coordinates of each valid pixel.

[0025] The set of independent obstacle features extracted by clustering includes the top, bottom, left, and right extreme boundary coordinates of the obstacle, and the pixel centroid coordinates. Minimum depth value and the total number of effective pixels included .

[0026] S3. A hierarchical obstacle avoidance strategy based on spatial partitioning: Mapping obstacle avoidance commands to partitions based on independent obstacle feature sets and preset system control parameters to obtain autonomous obstacle avoidance commands. In one feasible implementation, in order to solve the decision oscillations that are easily caused by sparse sensors in complex environments, the present invention divides the forward field of view of the aircraft into a core danger zone and an outer warning zone, and linearly maps forward speed suppression and turning commands based on the obstacle intrusion area and distance.

[0027] Optionally, a hierarchical obstacle avoidance strategy based on spatial partitioning maps obstacle avoidance commands to independent obstacle feature sets and preset system control parameters to obtain autonomous obstacle avoidance commands, including: Based on a preset effective obstacle pixel threshold, the set of independent obstacle features is cleaned, and the independent obstacle feature with the smallest depth value is selected as the target obstacle feature with the highest priority threat. Based on spatial partitioning rules, regions are divided according to the characteristics of target obstacles to obtain the obstacle intrusion area; Based on the obstacle intrusion area, and according to the characteristics of the target obstacle and the preset system control parameters, the region mapping model is used to perform hierarchical mapping of instructions to obtain autonomous obstacle avoidance instructions.

[0028] In one feasible implementation, to address the timeliness requirements of obstacle avoidance for ornithopter aircraft in confined spaces, a direct mapping rule from the spatial position of obstacles to flight control commands is established.

[0029] Traverse all obstacle features, remove discrete noise points with fewer than a threshold number of pixels, and select the minimum depth value. The smallest obstacle is the highest priority threat target.

[0030] The multi-area ToF field of view directly in front of the aircraft (set to...) The matrix (row indices 0-7, column indices 0-7) is divided into two specific levels of threat regions; the core danger zone (DRONE_ZONE) is defined as the core matrix block at the center of the field of view (top left row and column coordinates). To the bottom right corner coordinates Composition The outer warning zone (CARE_ZONE) is defined as a secondary threat matrix block (top-left corner coordinates) surrounding the danger zone. To the bottom right corner coordinates Composition area).

[0031] Based on the specific spatial area intruded by the obstacle, the system employs mathematical models with different sensitivities to determine its minimum depth. Convert to forward velocity scaling instruction Combined with the centroid coordinates, the desired steering command is output. .

[0032] System control parameters include obstacle avoidance reaction distance threshold. Severe deceleration distance threshold Emergency braking distance threshold Normal cruise zoom factor Severe deceleration scaling factor Braking coefficient Full rudder expected angle With a moderate expectation angle Combined with the horizontal coordinates of the obstacle material. With the center of the field of view The relationship allows for the extraction of polar symbols for evasive maneuvers. For example, when the obstacle is to the right... hour, Outputs a leftward steering polarity; conversely, outputs a rightward steering polarity. .

[0033] Optionally, based on the obstacle intrusion area, and according to the characteristics of the target obstacle and preset system control parameters, a region mapping model is used to perform hierarchical mapping of commands to obtain autonomous obstacle avoidance commands, including: When an obstacle intrusion area is the core danger zone, a danger zone mapping model is used to perform high-agility command mapping based on the characteristics of the target obstacle and the preset system control parameters to obtain danger zone obstacle avoidance commands. When an obstacle intrudes into the outer warning zone, based on the characteristics of the target obstacle and the preset system control parameters, the warning zone mapping model is used to perform progressive command mapping to obtain the warning zone obstacle avoidance command. When an obstacle intrudes into the safe cruise zone, the system maintains normal cruise commands according to preset system control parameters.

[0034] In one feasible implementation, when a target intrudes into a danger zone, the system adopts a highly agile three-stage deceleration model and a two-stage steering model to respond to an emergency threat directly ahead. The danger zone speed command and danger zone steering command are calculated as follows: (2) and (3): (2); (3); When a target intrudes into the warning zone, the system adopts a two-stage smooth mapping model to balance obstacle avoidance safety and forward penetration efficiency in confined space. The warning zone speed command and warning zone turning command are calculated as follows (4) and (5): (4); (5); If the target is in the blind spot at the edge of the warning zone, the system will maintain the default normal cruise speed command and will not generate a steering evasion command. The forward speed command generated through hierarchical mapping... With steering avoidance command .

[0035] S4. Obtain the historical obstacle avoidance command queue of the micro flapping-wing aircraft; based on the historical obstacle avoidance command queue, perform deadlock state verification according to the autonomous obstacle avoidance commands, and perform command smoothing to obtain safe navigation parameters. In one feasible implementation, the present invention innovatively introduces a historical instruction queue verification mechanism. When it is detected that the system continuously outputs full steering instructions due to facing a wide obstacle, a single escape direction is forcibly locked, which effectively suppresses the decision deadlock problem of "frequent left and right swaying" in traditional distance measurement and obstacle avoidance at the corner.

[0036] Optionally, based on the historical obstacle avoidance command queue, deadlock state verification is performed according to the autonomous obstacle avoidance commands, and command smoothing is executed to obtain safe navigation parameters, including: Based on the autonomous obstacle avoidance commands and the historical obstacle avoidance command queue, a steering command queue to be verified is constructed; statistics are performed on the steering command queue to be verified to obtain the number of full-steering turns; the percentage of full-steering commands is calculated based on the number of full-steering turns and the preset command queue length. Based on a preset deadlock determination ratio threshold, flight deadlock verification is performed according to the percentage of full rudder commands to obtain the deadlock verification result. When the deadlock check result is that no deadlock was triggered, the autonomous obstacle avoidance command is subjected to first-order low-pass smoothing filtering based on the historical obstacle avoidance command queue to obtain safe navigation parameters.

[0037] In one feasible implementation, to address the issue of decision oscillations and control surface step jumps that easily occur in micro flapping-wing aircraft in front of large obstacles, historical queue verification and first-order low-pass filtering are introduced, based on the steering commands of the autonomous obstacle avoidance command. And maintain the historical obstacle avoidance command queue for deadlock detection. Establish a queue with a length of... A sliding history queue to count the most recent The full steering threshold is reached in the next output ( Number of full-steering turns The judgment condition is as follows (6): (6); in, This is an indicator function; it returns 1 if the condition is met, and 0 otherwise. The preset positive floating-point constant (take) This serves as the floating-point error tolerance for determining the full rudder state of the system. It is used to absorb the numerical truncation error generated by the underlying microcontroller during multi-level linear and low-pass filtering calculations, and to prevent the omission of deadlock states due to precision overflow.

[0038] To eliminate high-frequency flutter on the control surface caused by ToF noise, a first-order low-pass filter is performed on the speed and steering commands in the non-lockdown state. This step is as follows (7): (7); in, The smoothed instructions For historical obstacle avoidance instructions, This is the smoothing coefficient.

[0039] Output smooth and deadlock-free safe navigation parameters, namely target forward speed and target turning command.

[0040] Optionally, after obtaining the deadlock verification result, the method further includes: When the deadlock check result is a deadlock triggered, the micro flapping-wing aircraft is forced to enter the escape state and outputs the escape state command sequence at a fixed period.

[0041] In one feasible implementation, when When the set percentage threshold is exceeded, the aircraft is determined to be in a decision deadlock of "frequent left and right swaying". At this time, the normal obstacle avoidance logic is immediately suspended, and the aircraft is forced to enter the escape state. The aircraft outputs negative speed according to the fixed cycle of "pure backward" command to achieve backward movement, and performs a single reverse turn with the "single reverse full rudder" command to break the environmental blind spot.

[0042] S5. Determine the heading control mode based on the safe navigation parameters; based on the heading control mode, perform attitude closed-loop control through a dual-mode heading control mechanism according to the safe navigation parameters, current heading angle and current angular velocity to obtain the yaw channel control quantity; In one feasible implementation, to overcome the gimbal lock-up and full-rudder crash defects caused by traditional Euler angle subtraction when performing obstacle avoidance maneuvers across ±180° boundaries, this invention introduces a low-level mathematical solution architecture based on unit vector operations. By extracting the angle information of the sensor heading and the target heading, and using the cross product and dot product of unit vectors, combined with the arctangent function, the shortest rotation path is accurately calculated. This scheme mathematically eliminates the control singularity caused by abrupt angle changes, providing a smooth and continuous error feedback benchmark for large-angle extreme obstacle avoidance maneuvers.

[0043] Optionally, based on the heading control mode, attitude closed-loop control is performed through a dual-mode heading control mechanism according to safe navigation parameters, current heading angle, and current angular velocity to obtain yaw channel control variables, including: When the heading control mode is heading lock mode, the current heading angle is determined as the target heading angle, and the yaw rate error is calculated; based on the yaw rate error, the outer loop PID controller is used to calculate and obtain the desired yaw rate for straight flight; When the heading control mode is obstacle avoidance maneuver mode, the steering command ratio is mapped according to the safe navigation parameters to obtain the expected yaw rate for obstacle avoidance; based on the expected yaw rate for obstacle avoidance and the current angular velocity, the inner loop PID controller is used to calculate and obtain the obstacle avoidance yaw control adjustment amount.

[0044] In one feasible implementation, a dual-mode control architecture with decoupled "heading lock" and "angular velocity steering" is designed, taking into account the strong aerodynamic coupling and high yaw drift characteristics of micro ornithopters. When no obstacle avoidance command is received, the system uses a position loop to lock the heading to resist spin drift caused by mechanical asymmetry. When an obstacle avoidance maneuver is triggered, the position loop is instantly disconnected, directly mapping the obstacle avoidance steering command from the decision layer to the desired angular velocity value. This mechanism effectively reduces attitude interference between obstacle avoidance maneuvers and straight-line cruise, enhancing the continuity and stability of flight attitude.

[0045] When performing yaw angle closed-loop control, to prevent crossing... Boundary-induced gimbal deadlock, extract target heading angle With current heading angle This is transformed into a unit circle vector. The sine component is calculated using the cross product, the cosine component using the dot product, and the shortest and most continuous yaw angle error is obtained using the arctangent function. The process is calculated as follows: (8), (9), (10): (8); (9); (10); In a yaw channel, if the turning command is zero in straight flight mode, record the current heading as... Yaw angle error Input to the outer loop to calculate the desired yaw rate for direct flight. It uses a position loop PID to lock the heading in order to resist aerodynamic spin drift.

[0046] If in obstacle avoidance mode, the desired yaw rate for obstacle avoidance is directly generated by the autonomous obstacle avoidance command. The final expected angular velocity of each channel. (Based on the current flight status, the system...) or (Corresponding selection in the middle) and the actual angular velocity fed back by the airborne IMU The difference is used to obtain the inner loop error of the angular velocity. The value is input into an independent multi-channel angular velocity inner loop PID controller for calculation, as shown in equation (11): (11); in, The angular velocity error for each channel, These are the inner loop PID parameters for angular velocity, calibrated using the dynamics of a flapping wing aircraft.

[0047] S6. Based on the yaw channel control quantity and safe navigation parameters, control signals are fused through a polarity mixing matrix to obtain a PWM duty cycle signal; based on the PWM duty cycle signal, the micro flapping-wing aircraft is driven to perform autonomous obstacle avoidance flight control.

[0048] In one feasible implementation, the yaw channel control quantity of each PID channel, combined with the forward speed of the safety navigation parameter, is superimposed by a polarity mixing matrix and converted into a PWM duty cycle signal, which is then output to the drive motor and tail servo of the flapping wing aircraft.

[0049] The calculated PWM duty cycle signal is transmitted to the tail servo and motor respectively to perform attitude deflection and flapping frequency adjustment in real physical space. After the physical actions of the actuators change the space state of the aircraft, they are captured and transmitted back by ToF and IMU, forming a physical-level closed loop of "sensing - calculation - execution - feedback".

[0050] In one feasible implementation, this invention constructs a high real-time control loop within a microcontroller, encapsulating DFS clustering preprocessing, regional hierarchical mapping, queue deadlock prevention, and dual-mode PID control into main control interrupt tasks. This ensures strict timing synchronization between sensor data reading, algorithm calculation, and PWM control signal output. The resulting micro flapping-wing flight system is highly compatible with both hardware and software, capable of independently operating autonomous obstacle avoidance strategies without external computing power.

[0051] To further illustrate the actual implementation process of the technical solution of this invention, a micro flapping-wing flying robot is used in a narrow corridor. Taking the autonomous obstacle avoidance scenario of encountering a protruding obstacle on the right front wall during high-speed cruising as an example, the specific parameters are completely substituted into all the calculation formulas of this system for derivation.

[0052] Among them, obstacle avoidance reaction distance Severe deceleration distance Emergency braking distance Normal cruise zoom factor Severe deceleration scaling factor (Full speed command set to 1.0)

[0053] Full steering angle easing the expected turning angle First-order low-pass filter coefficients The sliding queue length is 5, and the full rudder judgment tolerance threshold is 3. The inner loop PD parameter of yaw rate is set to proportional. ,differential Current flight status: The onboard IMU measures the current actual yaw angle. Actual yaw rate .

[0054] ToF sensor output Depth matrix. After binarization and DFS clustering, a single obstacle was identified in the front right corner. This obstacle occupied 4 valid pixels (i.e.,...). Its row and column coordinates in the matrix are respectively Extract the minimum depth value of this region. Substituting these values ​​into the centroid calculation formulas are as follows: (12) and (13): (12); (13); The centroid coordinates of the obstacle pixels are obtained as follows: .

[0055] Since there is only this single valid target in the field of view (and the number of pixels) Targets exceeding the noise reduction threshold are identified as high-priority threat targets. Their minimum depth value is extracted. Redefining the obstacle avoidance reference distance for this control cycle .

[0056] Because of the target ,and ,and ,and If both conditions are met, it is determined that the spatial boundary of the obstacle intersects with the core danger zone, triggering the danger zone mapping model.

[0057] Because the target intruded into the danger zone, and the reference distance... Falling (Right now Within the interval, the system triggers the double-slope splicing formula (14) for the far-distance segment of the danger zone: (14); Substituting specific values, as shown in equation (15): (15); The output target forward velocity scaling command is set to full speed. .

[0058] Because of the center of mass Determine if the obstacle is deviating to the right and extract the avoidance polarity. Substituting into the turning formula (16) for the same interval: (16); Extract the last 5 sliding history turn queue instructions, i.e. Substituting the threshold values ​​into the state machine, full rudder (i.e., or ) number of times Since the deadlock intervention threshold (3 times) has not been exceeded, the system does not trigger escape and continues to execute the obstacle avoidance command.

[0059] Previous cycle smoothing speed command Substituting into the first-order low-pass filter formula (17): (17); The output forward speed command for the safe target is 0.2.

[0060] Extract current heading Target heading Substituting into the unit vector calculation formula, we calculate the cross-multiplication and dot-multiplication components as shown in equations (18) and (19): (18); (19); Substituting into the arctangent shortest path error formula as shown in equation (20): (20); Cut the position ring, The error is directly mapped to the desired yaw rate. . and actual angular velocity The difference is used to obtain the current error. Let the differential error component of the current control cycle be... Substituting into the PID control formula, we get the following equation (21): (twenty one); Based on yaw control adjustment amount and in the safe navigation parameters The speed control signal is converted into a PWM duty cycle signal by a polarity mixing matrix, which drives the vertical tail of the micro flapping wing aircraft to deflect to the left and reduce the flapping frequency, thus achieving smooth avoidance.

[0061] This invention proposes an autonomous obstacle avoidance method for micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. By constructing a complete closed-loop strategy integrating sparse point cloud connected domain clustering, spatial hierarchical obstacle avoidance decision-making, and low-level singularity-free vectorized control, it effectively overcomes the sensing failure problem under high-frequency flapping vibrations while meeting the constraints of extremely low computing power and power consumption on a micro-platform. It also improves the angle abrupt changes and attitude loss of control caused by large-maneuver obstacle avoidance, significantly enhancing the real-time performance, robustness, and flight stability of the aircraft in complex and unknown environments. This provides core technical support for the fully autonomous engineering application of micro biomimetic aircraft. This invention is a hardware-lightweight, low-computing-cost, and highly adaptable autonomous obstacle avoidance method for micro flapping-wing aircraft based on ToF sensing.

[0062] Figure 2 This is a block diagram of an autonomous obstacle avoidance device for a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing, provided in an embodiment of the present invention. This device is used in an autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing. (Refer to...) Figure 2 The device includes an information acquisition module 210, an obstacle detection module 220, an obstacle avoidance decision module 230, a deadlock verification module 240, an attitude control module 250, and an execution output module 260. Among them: Information acquisition module 210 is used to collect environmental information based on multi-region ToF sensors, obtain raw depth data matrix and target status code; and acquire the current heading angle and current angular velocity of the micro flapping-wing aircraft. The obstacle detection module 220 is used to perform connected component clustering based on the original depth data matrix and target state code according to the DFS algorithm, and extract obstacle features to obtain an independent obstacle feature set; The obstacle avoidance decision module 230 is used for a hierarchical obstacle avoidance strategy based on spatial partitioning. It maps partitioned obstacle avoidance commands according to the set of independent obstacle features and preset system control parameters to obtain autonomous obstacle avoidance commands. The deadlock verification module 240 is used to obtain the historical obstacle avoidance command queue of the micro flapping-wing aircraft; based on the historical obstacle avoidance command queue, it performs deadlock state verification according to the autonomous obstacle avoidance command, and performs command smoothing processing to obtain safe navigation parameters; The attitude control module 250 is used to determine the heading control mode based on the safe navigation parameters; based on the heading control mode, attitude closed-loop control is performed through a dual-mode heading control mechanism according to the safe navigation parameters, the current heading angle and the current angular velocity to obtain the yaw channel control quantity; The execution output module 260 is used to fuse control signals through a polarity mixing matrix based on the yaw channel control quantity and safety navigation parameters to obtain a PWM duty cycle signal; and to drive the micro flapping-wing aircraft to perform autonomous obstacle avoidance flight control based on the PWM duty cycle signal.

[0063] Optionally, the obstacle detection module 220 is further used for: Based on a preset processing distance threshold, the original depth data matrix is ​​binarized according to the target status code to obtain a binarized feature matrix. Based on the binarized feature matrix, the DFS algorithm is used to cluster connected components to obtain the connected component label feature matrix. Obstacle feature statistics are performed based on the connected component label feature matrix to obtain an independent obstacle feature set.

[0064] Optionally, the obstacle avoidance decision module 230 is further used for: Based on a preset effective obstacle pixel threshold, the set of independent obstacle features is cleaned, and the independent obstacle feature with the smallest depth value is selected as the target obstacle feature with the highest priority threat. Based on spatial partitioning rules, regions are divided according to the characteristics of target obstacles to obtain the obstacle intrusion area; Based on the obstacle intrusion area, and according to the characteristics of the target obstacle and the preset system control parameters, the region mapping model is used to perform hierarchical mapping of instructions to obtain autonomous obstacle avoidance instructions.

[0065] Optionally, the obstacle avoidance decision module 230 is further used for: When an obstacle intrusion area is the core danger zone, a danger zone mapping model is used to perform high-agility command mapping based on the characteristics of the target obstacle and the preset system control parameters to obtain danger zone obstacle avoidance commands. When an obstacle intrudes into the outer warning zone, based on the characteristics of the target obstacle and the preset system control parameters, the warning zone mapping model is used to perform progressive command mapping to obtain the warning zone obstacle avoidance command. When an obstacle intrudes into the safe cruise zone, the system maintains normal cruise commands according to preset system control parameters.

[0066] Optionally, the deadlock verification module 240 is further used for: Based on the autonomous obstacle avoidance commands and the historical obstacle avoidance command queue, a steering command queue to be verified is constructed; statistics are performed on the steering command queue to be verified to obtain the number of full-steering turns; the percentage of full-steering commands is calculated based on the number of full-steering turns and the preset command queue length. Based on a preset deadlock determination ratio threshold, flight deadlock verification is performed according to the percentage of full rudder commands to obtain the deadlock verification result. When the deadlock check result is that no deadlock was triggered, the autonomous obstacle avoidance command is subjected to first-order low-pass smoothing filtering based on the historical obstacle avoidance command queue to obtain safe navigation parameters.

[0067] Optionally, the deadlock verification module 240 is further used for: When the deadlock check result is a deadlock triggered, the micro flapping-wing aircraft is forced to enter the escape state and outputs the escape state command sequence at a fixed period.

[0068] Optionally, the attitude control module 250 is further used for: When the heading control mode is heading lock mode, the current heading angle is determined as the target heading angle, and the yaw rate error is calculated; based on the yaw rate error, the outer loop PID controller is used to calculate and obtain the desired yaw rate for straight flight; When the heading control mode is obstacle avoidance maneuver mode, the steering command ratio is mapped according to the safe navigation parameters to obtain the expected yaw rate for obstacle avoidance; based on the expected yaw rate for obstacle avoidance and the current angular velocity, the inner loop PID controller is used to calculate and obtain the obstacle avoidance yaw control adjustment amount.

[0069] This invention proposes an autonomous obstacle avoidance method for micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. By constructing a complete closed-loop strategy integrating sparse point cloud connected domain clustering, spatial hierarchical obstacle avoidance decision-making, and low-level singularity-free vectorized control, it effectively overcomes the sensing failure problem under high-frequency flapping vibrations while meeting the constraints of extremely low computing power and power consumption on a micro-platform. It also improves the angle abrupt changes and attitude loss of control caused by large-maneuver obstacle avoidance, significantly enhancing the real-time performance, robustness, and flight stability of the aircraft in complex and unknown environments. This provides core technical support for the fully autonomous engineering application of micro biomimetic aircraft. This invention is a hardware-lightweight, low-computing-cost, and highly adaptable autonomous obstacle avoidance method for micro flapping-wing aircraft based on ToF sensing.

[0070] Figure 3 This is a schematic diagram of the structure of an autonomous obstacle avoidance device for a micro flapping-wing aircraft provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the autonomous obstacle avoidance device for micro flapping-wing aircraft may include the above-mentioned Figure 2 The diagram shows an autonomous obstacle avoidance device for a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing. Optionally, the autonomous obstacle avoidance device 310 for the micro flapping-wing aircraft may include a first processor 2001.

[0071] Optionally, the autonomous obstacle avoidance device 310 for the micro flapping-wing aircraft may also include a memory 2002 and a transceiver 2003.

[0072] The first processor 2001, memory 2002, and transceiver 2003 can be connected via a communication bus.

[0073] The following is combined Figure 3 A detailed introduction to each component of the autonomous obstacle avoidance device 310 for micro flapping-wing aircraft: The first processor 2001 is the control center of the autonomous obstacle avoidance device 310 for the micro flapping-wing aircraft. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0074] Optionally, the first processor 2001 can perform various functions of the micro flapping-wing aircraft autonomous obstacle avoidance device 310 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0075] In a specific implementation, as one example, the first processor 2001 may include one or more CPUs, for example... Figure 3 CPU0 and CPU1 are shown in the diagram.

[0076] In a specific implementation, as one example, the autonomous obstacle avoidance device 310 for micro flapping-wing aircraft may also include multiple processors, such as... Figure 3 The first processor 2001 and the second processor 2004 are shown in the diagram. Each of these processors can be a single-core processor or a multi-core processor. Here, a processor can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0077] The memory 2002 is used to store the software program that executes the present invention, and is controlled by the first processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0078] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently, and may be connected via the interface circuit of the micro flapping-wing aircraft autonomous obstacle avoidance device 310. Figure 3 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0079] The transceiver 2003 is used to communicate with network devices or with terminal devices.

[0080] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 3 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0081] Optionally, the transceiver 2003 can be integrated with the first processor 2001, or it can exist independently and be connected to the interface circuit of the micro flapping-wing aircraft autonomous obstacle avoidance device 310. Figure 3 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0082] It should be noted that, Figure 3 The structure of the micro flapping-wing autonomous obstacle avoidance device 310 shown does not constitute a limitation on the router. Actual micro flapping-wing autonomous obstacle avoidance devices may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0083] Furthermore, the technical effect of the autonomous obstacle avoidance device 310 for micro flapping-wing aircraft can be referred to the technical effect of the ToF-based autonomous obstacle avoidance method for micro flapping-wing aircraft described in the above method embodiments, and will not be repeated here.

[0084] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or it may be any conventional processor, etc.

[0085] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0086] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0087] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0088] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0089] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0090] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0091] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0092] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0093] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0094] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0095] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0096] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for autonomous obstacle avoidance of a micro flapping-wing aircraft based on Time-of-Flight (ToF) sensing, characterized in that, The method includes: Environmental information is collected using a multi-region ToF sensor to obtain the raw depth data matrix and target status code; the current heading angle and current angular velocity of the micro flapping-wing aircraft are also obtained. Based on the DFS algorithm, connected component clustering is performed according to the original depth data matrix and target state codes, and obstacle features are extracted to obtain an independent obstacle feature set. A hierarchical obstacle avoidance strategy based on spatial partitioning maps obstacle avoidance commands to autonomous obstacle avoidance commands based on an independent set of obstacle features and preset system control parameters. Obtain the historical obstacle avoidance command queue of the micro flapping-wing aircraft; based on the historical obstacle avoidance command queue, perform deadlock state verification according to the autonomous obstacle avoidance commands, and perform command smoothing to obtain safe navigation parameters; The heading control mode is determined based on the safe navigation parameters; based on the heading control mode, attitude closed-loop control is performed through a dual-mode heading control mechanism according to the safe navigation parameters, the current heading angle and the current angular velocity to obtain the yaw channel control quantity; Based on the yaw channel control quantity and safe navigation parameters, the control signals are fused through a polarity mixing matrix to obtain the PWM duty cycle signal; based on the PWM duty cycle signal, the micro flapping-wing aircraft is driven to perform autonomous obstacle avoidance flight control.

2. The autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing according to claim 1, characterized in that, The DFS-based algorithm performs connected component clustering based on the original depth data matrix and target state codes, and extracts obstacle features to obtain an independent obstacle feature set, including: Based on a preset processing distance threshold, the original depth data matrix is ​​binarized according to the target status code to obtain a binarized feature matrix. Based on the binarized feature matrix, the DFS algorithm is used to cluster connected components to obtain the connected component label feature matrix. Obstacle feature statistics are performed based on the connected component label feature matrix to obtain an independent obstacle feature set.

3. The autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing according to claim 1, characterized in that, The hierarchical obstacle avoidance strategy based on spatial partitioning maps obstacle avoidance commands to independent obstacle feature sets and preset system control parameters to obtain autonomous obstacle avoidance commands, including: Based on a preset effective obstacle pixel threshold, the set of independent obstacle features is cleaned, and the independent obstacle feature with the smallest depth value is selected as the target obstacle feature with the highest priority threat. Based on spatial partitioning rules, regions are divided according to the characteristics of target obstacles to obtain the obstacle intrusion area; Based on the obstacle intrusion area, and according to the characteristics of the target obstacle and the preset system control parameters, the region mapping model is used to perform hierarchical mapping of instructions to obtain autonomous obstacle avoidance instructions.

4. The autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing according to claim 3, characterized in that, The method, based on the obstacle intrusion area, uses a region mapping model to perform hierarchical mapping of commands according to the characteristics of the target obstacle and preset system control parameters to obtain autonomous obstacle avoidance commands, including: When an obstacle intrusion area is the core danger zone, a danger zone mapping model is used to perform high-agility command mapping based on the characteristics of the target obstacle and the preset system control parameters to obtain danger zone obstacle avoidance commands. When an obstacle intrudes into the outer warning zone, based on the characteristics of the target obstacle and the preset system control parameters, the warning zone mapping model is used to perform progressive command mapping to obtain the warning zone obstacle avoidance command. When an obstacle intrudes into the safe cruise zone, the system maintains normal cruise commands according to preset system control parameters.

5. The autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing according to claim 1, characterized in that, The process of obtaining safe navigation parameters based on the historical obstacle avoidance command queue, performing deadlock state verification according to autonomous obstacle avoidance commands, and executing command smoothing processing includes: Based on the autonomous obstacle avoidance commands and the historical obstacle avoidance command queue, a steering command queue to be verified is constructed; statistics are performed on the steering command queue to be verified to obtain the number of full-steering turns; the percentage of full-steering commands is calculated based on the number of full-steering turns and the preset command queue length. Based on a preset deadlock determination ratio threshold, flight deadlock verification is performed according to the percentage of full rudder commands to obtain the deadlock verification result. When the deadlock check result is that no deadlock was triggered, the autonomous obstacle avoidance command is subjected to first-order low-pass smoothing filtering based on the historical obstacle avoidance command queue to obtain safe navigation parameters.

6. The autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing according to claim 5, characterized in that, After obtaining the deadlock verification result, the method further includes: When the deadlock check result is a deadlock triggered, the micro flapping-wing aircraft is forced to enter the escape state and outputs the escape state command sequence at a fixed period.

7. The autonomous obstacle avoidance method for a micro flapping-wing aircraft based on ToF sensing according to claim 1, characterized in that, The heading control mode, based on safe navigation parameters, current heading angle, and current angular velocity, performs attitude closed-loop control through a dual-mode heading control mechanism to obtain yaw channel control variables, including: When the heading control mode is heading lock mode, the current heading angle is determined as the target heading angle, and the yaw rate error is calculated; based on the yaw rate error, the outer loop PID controller is used to calculate and obtain the desired yaw rate for straight flight; When the heading control mode is obstacle avoidance maneuver mode, the steering command ratio is mapped according to the safe navigation parameters to obtain the expected yaw rate for obstacle avoidance; based on the expected yaw rate for obstacle avoidance and the current angular velocity, the inner loop PID controller is used to calculate and obtain the obstacle avoidance yaw control adjustment amount.

8. A ToF-based autonomous obstacle avoidance device for a micro flapping-wing aircraft, wherein the ToF-based autonomous obstacle avoidance device is used to implement the ToF-based autonomous obstacle avoidance method for a micro flapping-wing aircraft as described in any one of claims 1-7, characterized in that, The device includes: The information acquisition module is used to collect environmental information based on multi-region ToF sensors, obtain the raw depth data matrix and target status code; and acquire the current heading angle and current angular velocity of the micro flapping-wing aircraft. The obstacle detection module is used to perform connected component clustering based on the DFS algorithm, according to the original depth data matrix and target state codes, and extract obstacle features to obtain an independent obstacle feature set. The obstacle avoidance decision module is used for hierarchical obstacle avoidance strategies based on spatial partitioning. It maps obstacle avoidance commands to partitions according to the set of independent obstacle features and preset system control parameters to obtain autonomous obstacle avoidance commands. The deadlock verification module is used to obtain the historical obstacle avoidance command queue of the micro flapping-wing aircraft; based on the historical obstacle avoidance command queue, it performs deadlock state verification according to the autonomous obstacle avoidance commands, and performs command smoothing to obtain safe navigation parameters; The attitude control module is used to determine the heading control mode based on the safe navigation parameters; based on the heading control mode, attitude closed-loop control is performed through a dual-mode heading control mechanism according to the safe navigation parameters, the current heading angle and the current angular velocity to obtain the yaw channel control quantity; The execution output module is used to fuse control signals through a polarity mixing matrix based on the yaw channel control quantity and safety navigation parameters to obtain a PWM duty cycle signal; and to drive the micro flapping-wing aircraft to perform autonomous obstacle avoidance flight control based on the PWM duty cycle signal.

9. An autonomous obstacle avoidance device for a micro flapping-wing aircraft, characterized in that, The autonomous obstacle avoidance device for the micro flapping-wing aircraft includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 7.