Unmanned aerial vehicle automatic analysis obstacle avoidance method

By aligning and scaling the real-time environmental map of the UAV with the historical map, the problem of obstacle avoidance reliability and safety caused by scale drift during long-term autonomous flight of the UAV was solved, and higher reliability and safety of autonomous flight were achieved.

CN121979260APending Publication Date: 2026-05-05SUZHOU HUIXING VISION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU HUIXING VISION TECHNOLOGY CO LTD
Filing Date
2026-01-28
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

During long-term, large-scale autonomous flight missions, the reliability and safety of obstacle avoidance path planning decrease due to scale uncertainty and drift issues in the visually constructed environmental maps, increasing the risk of collisions.

Method used

By constructing a real-time environmental map using airborne vision sensors, the flight mission type is determined, and historical and real-time maps are aligned. The reprojection error of 3D landmarks is analyzed, scale difference parameters are calculated, behavioral trajectory deviations are evaluated, and spatial scale compensation is performed to correct the obstacle avoidance path.

Benefits of technology

It improves the reliability and safety of obstacle avoidance decisions for UAVs during long-term autonomous flight. Through systematic diagnosis and closed-loop correction, it dynamically compensates for scale distortion, thereby enhancing environmental adaptability and safety redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979260A_ABST
    Figure CN121979260A_ABST
Patent Text Reader

Abstract

The invention discloses an unmanned aerial vehicle automatic analysis obstacle avoidance method, particularly relates to the technical field of unmanned aerial vehicle autonomous flight control, and is used for solving the technical problem that when an existing unmanned aerial vehicle depends on a historical map for a long time to carry out autonomous flight, an obstacle avoidance safety boundary is not reliable due to scale drift of a visual map. The method comprises the following steps: judging task dependency, aligning historical and real-time maps, analyzing a re-projection error structure to quantify scale difference, further calculating a mapping deviation of a historical task trajectory, and comprehensively evaluating an influence degree on a current obstacle avoidance planning safety boundary. And finally, spatial scale compensation is carried out on an environment map or a planned path in a self-adaptive manner according to the influence degree, so that the obstacle avoidance decision reliability and safety of the unmanned aerial vehicle in long-term autonomous operation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous flight control technology for unmanned aerial vehicles (UAVs), and more specifically, to a method for automatic obstacle avoidance analysis for UAVs. Background Technology

[0002] In the field of autonomous flight control for unmanned aerial vehicles (UAVs), to achieve automatic obstacle avoidance in complex environments, UAVs can use onboard visual sensors to perceive the environment in real time and construct a 3D map of the surrounding environment based on visual simultaneous localization and mapping (VLS). This allows the UAV to perform autonomous positioning and navigation in unknown or known environments without relying on external positioning signals. For long-term autonomous flight applications that need to repeatedly perform tasks such as inspection and monitoring, relying on the environmental map established by previous flights as prior knowledge for subsequent flights, and making path planning and obstacle avoidance decisions accordingly, is an important way to improve operational efficiency and autonomy.

[0003] However, in long-term, large-scale autonomous flight missions, the visually constructed environmental maps have inherent scale uncertainties and drift problems. This leads to inconsistencies in the global scale benchmark of the environmental map in different flight missions or different stages of the same mission. When UAVs plan obstacle avoidance paths based on such scale-distorted maps, the theoretical safety boundary they plan will have unpredictable deviations from the safety boundary in the real physical environment. This directly damages the long-term reliability and safety of obstacle avoidance decisions, making UAVs face potential collision risks when using historical maps for repeated autonomous operations. This limits their application in scenarios that require high reliability and long-term autonomous operation. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides an automatic obstacle avoidance method for unmanned aerial vehicles to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] An automatic obstacle avoidance method for unmanned aerial vehicles (UAVs) includes the following steps:

[0007] S1. The drone constructs a real-time environmental map using onboard visual sensors;

[0008] S2. Determine whether the current flight mission is a long-term autonomous flight mission that relies on a pre-stored historical environment map.

[0009] S3. When the judgment is yes, align the real-time environment map with the historical environment map, and obtain the scale difference parameter by analyzing the structural characteristics of the reprojection error set generated by the same set of 3D landmarks based on the historical pose of the historical environment map and the real-time pose of the real-time environment map.

[0010] S4. Based on the scale difference parameter, calculate the behavioral trajectory deviation generated after mapping the historical typical task trajectory recorded in the historical environment map to the real-time environment map.

[0011] S5. Combine scale difference parameters with behavioral trajectory deviation to assess the degree of impact on the safety boundary of the current obstacle avoidance path planning;

[0012] S6. Based on the degree of impact, perform spatial scale compensation on the real-time environment map or the obstacle avoidance path generated based on it.

[0013] Furthermore, the drone constructs a real-time environmental map using onboard visual sensors, including:

[0014] A continuous sequence of image frames of the environment is acquired using an airborne vision sensor;

[0015] Visual feature points are extracted and tracked from a continuous sequence of image frames to estimate the pose change information of the UAV itself;

[0016] Based on pose change information and the 3D coordinates of visual feature points, a 3D point cloud representation of a real-time environment map is generated through fusion processing.

[0017] Furthermore, determining whether the current flight mission is a long-term autonomous flight mission that relies on pre-stored historical environment maps includes:

[0018] Obtain the mission planning instructions for the current flight mission and parse the instructions regarding whether to reuse historical environment maps.

[0019] When the instruction information requires reuse, it is further determined whether the current flight mission is a long-term autonomous flight mission that relies on a pre-stored historical environment map, based on the flight path repetition cycle or the total duration of the mission as defined in the mission planning instructions.

[0020] Furthermore, when the determination is yes, the real-time environment map is aligned with the historical environment map, and the scale difference parameters are obtained by analyzing the structural characteristics of the reprojection error set generated by the same set of 3D landmarks based on the historical pose of the historical environment map and the real-time pose of the real-time environment map, respectively. These parameters include:

[0021] Feature matching is performed between the real-time environment map and the historical environment map, and the spatial transformation relationship between the two is calculated to complete map alignment.

[0022] A set of three-dimensional landmarks that are stably observed in both the historical and real-time environmental maps are selected as the same set of three-dimensional landmarks.

[0023] Based on the spatial transformation relationship and the same set of 3D landmarks, the reprojection error is calculated under the historical pose and the real-time pose, forming a set of reprojection errors.

[0024] The statistical distribution characteristics of the reprojection error set are extracted as structural features;

[0025] The scale difference parameter is calculated based on the structural characteristics.

[0026] Furthermore, extracting the statistical distribution characteristics of the reprojection error set as structural features includes: calculating the covariance matrix of the reprojection error set; performing eigenvalue decomposition on the covariance matrix to obtain its eigenvalues ​​and eigenvectors; and using the distribution and ratio relationships of the main eigenvalues ​​as structural features.

[0027] Furthermore, based on the scale difference parameter, the behavioral trajectory deviation generated after mapping the historical typical task trajectories recorded in the historical environment map to the real-time environment map is calculated, including:

[0028] Read the path point sequence of typical historical mission trajectories from the historical environment map;

[0029] The spatial scale transformation of the path point sequence is performed using the scale difference parameter to generate a mapped trajectory that is mapped to the real-time environment map coordinate system;

[0030] Compare the positions of the mapped trajectory with those of typical historical task trajectories at corresponding path points, and calculate the position offset;

[0031] Based on the positional offset of all corresponding path points, the behavioral trajectory deviation is statistically obtained.

[0032] Furthermore, reading typical historical mission trajectories from historical environment maps includes: selecting the complete trajectory of a mission with the highest obstacle avoidance success rate and flight trajectory smoothness better than a preset threshold from among multiple historical flight missions recorded in the historical environment map, as the typical historical mission trajectory.

[0033] Furthermore, by combining scale difference parameters and behavioral trajectory deviations, the impact on the current obstacle avoidance path planning safety boundary is assessed, including:

[0034] The scale difference parameter is compared with the preset scale difference threshold to determine the quantification value of the contraction or expansion of the geometric safety boundary caused by scale distortion.

[0035] At the same time, the deviation of the behavior trajectory is compared with the preset trajectory tolerance threshold to determine the path deviation risk level at the task execution level.

[0036] By combining the changes in the geometric safety boundary with the path deviation risk level, and based on predefined risk mapping rules, the degree of impact on the safety boundary of the current obstacle avoidance path planning is determined.

[0037] Furthermore, based on the degree of impact, spatial scale compensation is performed on the real-time environment map or the obstacle avoidance path generated based on it, including:

[0038] Determine the corresponding spatial scale compensation factor based on the degree of impact;

[0039] Determine whether the impact exceeds a preset threshold. If not, apply the spatial scale compensation factor to the coordinates of the obstacle avoidance path generated based on the real-time environment map to correct the path scale.

[0040] If the scale exceeds the limit, then the spatial scale compensation factor will be applied to all 3D point cloud coordinates of the real-time environment map to complete map reconstruction.

[0041] Furthermore, determining the corresponding spatial scale compensation factor based on the degree of influence includes: establishing a lookup table or preset function relationship model with scale difference parameters and behavioral trajectory deviation as inputs and compensation factor as output; substituting the currently obtained scale difference parameters and behavioral trajectory deviations into the table, or calculating to obtain the spatial scale compensation factor.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] 1. By systematically diagnosing and correcting the visual map scale drift problem, the reliability and safety of UAVs making obstacle avoidance decisions based on historical maps during long-term autonomous flight are effectively improved. First, by analyzing the reprojection error structure characteristics of cross-map 3D landmarks, the scale difference parameters between historical and real-time maps can be accurately quantified. This transforms the scale drift, which is difficult to observe directly, into a clear and analyzable mathematical representation, solving the problem of the lack of effective detection methods for such systematic errors in traditional methods.

[0044] 2. By associating abstract scale parameters with specific flight mission trajectory deviations and establishing a hierarchical risk assessment and decision-making mechanism, the system achieves intelligent assessment of the impact of obstacle avoidance safety boundaries. Based on the assessment results, it adaptively selects to perform global map reconstruction or local path correction, enabling the system to dynamically compensate for the negative impact of scale distortion with optimal resource consumption. This fundamentally enhances the environmental adaptability and safety redundancy of UAVs in repetitive long-term autonomous operation missions. Attached Figure Description

[0045] Figure 1 This is a flowchart of an automatic obstacle avoidance analysis method for unmanned aerial vehicles (UAVs) according to the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0047] Example: Figure 1 The present invention provides an automatic obstacle avoidance method for unmanned aerial vehicles (UAVs), which includes the following steps:

[0048] S1. The drone constructs a real-time environmental map using onboard visual sensors;

[0049] S2. Determine whether the current flight mission is a long-term autonomous flight mission that relies on a pre-stored historical environment map.

[0050] S3. When the judgment is yes, align the real-time environment map with the historical environment map, and obtain the scale difference parameter by analyzing the structural characteristics of the reprojection error set generated by the same set of 3D landmarks based on the historical pose of the historical environment map and the real-time pose of the real-time environment map.

[0051] S4. Based on the scale difference parameter, calculate the behavioral trajectory deviation generated after mapping the historical typical task trajectory recorded in the historical environment map to the real-time environment map.

[0052] S5. Combine scale difference parameters with behavioral trajectory deviation to assess the degree of impact on the safety boundary of the current obstacle avoidance path planning;

[0053] S6. Based on the degree of impact, perform spatial scale compensation on the real-time environment map or the obstacle avoidance path generated based on it.

[0054] S1. The drone constructs a real-time environmental map using onboard visual sensors, specifically as follows:

[0055] The UAV is equipped with at least one global shutter CMOS camera as its onboard visual sensor. This camera continuously captures environmental images in front of the UAV at a fixed acquisition frequency, such as 30 frames per second, thus obtaining a temporally continuous sequence of image frames. The acquisition frequency is set considering the UAV's maximum flight speed and scene depth to ensure sufficient overlap between consecutive frames for subsequent processing. The camera undergoes intrinsic parameter calibration during installation, obtaining calibration data including focal length, principal point coordinates, and lens distortion parameters. This data will be used for subsequent image correction and geometric calculations. During acquisition, the camera automatically adjusts exposure parameters according to ambient lighting conditions to ensure appropriate brightness and contrast in the images, providing a quality foundation for feature extraction.

[0056] After obtaining a continuous sequence of image frames, a visual feature point extraction and tracking process is performed on each newly acquired image frame. Specifically, the ORB feature extraction algorithm is used to detect stable corner points from the image as visual feature points. This process first constructs an image pyramid to overcome scale variations. Then, a FAST corner detector is used on each layer of the pyramid to find candidate corner point locations. These candidate corner points are sorted and filtered by calculating their Harris corner response values, retaining strong corner points with response values ​​greater than a preset feature point intensity threshold. This threshold is a value set based on image resolution and experience, used to filter out unstable weak corner points. Next, a BRIEF descriptor is calculated for each retained corner point. This descriptor is a binary string used to characterize the grayscale distribution pattern in the corner point's neighborhood, thus uniquely identifying the feature point. For the first image frame in the sequence, all extracted visual feature points and their descriptors are initialized as the current tracking set. For each subsequent new image frame, new visual feature points and their descriptors are extracted similarly. Then, feature point matching is performed by comparing the Hamming distance between the new frame's feature point descriptors and the previous frame's feature point descriptors, achieving cross-frame tracking. To eliminate false matches, the Random Sampling Consensus (RANSAC) algorithm is used to filter matching point pairs, retaining only interior point matching pairs that conform to the geometric constraints of the fundamental matrix. Based on the pixel coordinate changes of these successfully tracked visual feature point pairs in the two frames of images, and combined with the camera's intrinsic parameter calibration data, visual odometry is used to calculate the relative pose change information of the UAV between the two acquisition times. This calculation typically involves epipolar geometry or direct methods, and the output is a six-degree-of-freedom pose transformation including a three-dimensional translation vector and a three-dimensional rotation matrix.

[0057] Based on the pose change information estimated between consecutive frames, the 3D spatial coordinates of the tracked visual feature points are further recovered, and a 3D point cloud representation of the real-time environment map is gradually constructed through fusion processing. Specifically, for visual feature points successfully tracked for more than a certain number of frames, such as five consecutive frames, their 3D coordinates in the local pose coordinate system are calculated using a multi-view triangulation method. The triangulation process requires the image pixel coordinates of the same feature point observed in at least two different poses, as well as the corresponding camera pose matrix. As the UAV moves continuously and acquires new frames and pose estimates, new visual feature points are continuously triangulated and added to the map, while the 3D coordinates of existing map points are continuously optimized using a bundling adjustment technique. Bundling adjustment is a global optimization method that aims to minimize the sum of squares of the reprojection errors of all map points in each frame, while simultaneously optimizing all camera pose parameters and the 3D coordinates of map points. In practice, to balance computational efficiency and map accuracy, a sliding window bundling adjustment is adopted, that is, only a certain number of recent keyframes, such as the last 20 keyframes, and the map points observed therein are optimized. Ultimately, the set of 3D coordinates of all optimized visual feature points constitutes the 3D point cloud representation of the real-time environment map. This point cloud data is typically stored in the onboard computer memory of the UAV in list form. Each point contains its X, Y, and Z coordinate values ​​in a selected world coordinate system and can be associated with the image color information from its initial observation. This 3D point cloud representation forms the geometric data foundation for the real-time environment map used in subsequent steps for alignment and analysis with historical environment maps. The entire construction process is incremental and online, ensuring that the map can expand and update in real time as the UAV explores.

[0058] S2. Determine whether the current flight mission is a long-term autonomous flight mission that relies on a pre-stored historical environment map. The specific implementation is as follows:

[0059] Before executing any flight mission, a UAV must first obtain the mission planning instruction for the current flight mission. This mission planning instruction is typically generated by the ground control station based on operational requirements and transmitted to the UAV via a data link, or pre-stored by the operator in a designated non-volatile memory of the UAV's onboard computer. The mission planning instruction is a structured data file or data stream, formatted according to a predefined protocol, containing multiple fields to fully describe a flight mission. These fields include, but are not limited to, a unique mission identifier, a series of sequentially arranged flight path point coordinates and attitude requirements, a preset flight speed, and specific flag bits or instruction codes indicating whether the current mission reuses an existing map. After obtaining the mission planning instruction for the current flight mission, the UAV's onboard mission management unit reads and parses the instruction. The parsing process involves decoding the instruction data stream according to the aforementioned predefined protocol format, extracting the values ​​or states of each field. Specifically, the parsing of the indication information regarding whether to reuse historical environment maps involves directly reading the corresponding specific flag bit or instruction code field from the instruction. For example, this field can be a Boolean variable. When its value is true or a specific code, it indicates that the current task requires the reuse of a pre-stored historical environment map; when its value is false or another code, it indicates that navigation will be based entirely on real-time perception, without relying on the historical map. The pre-stored historical environment map here refers to the environment map data file that was constructed and processed and saved during the UAV's previous mission. Its storage format is compatible with the real-time environment map to facilitate subsequent retrieval and alignment.

[0060] When the parsed instructions explicitly require the reuse of historical environment maps, the next step is to assess whether the mission is a long-term autonomous flight mission. This assessment also relies on further analysis of the acquired mission planning instructions. In addition to indicating whether to reuse the map, the mission planning instructions define the mission's timing or duration attributes. Specifically, the instructions may include definitions of the flight path repetition cycle or directly define the total mission duration. The flight path repetition cycle refers to the interval or frequency at which the mission requires the UAV to fly along the same planned path repeatedly. For example, the instructions might use a cycle field to indicate that this inspection mission needs to be executed at fixed time intervals, such as executing the exact same flight route every 6 hours. The total mission duration refers to the total time span from the start of the mission to its planned end. For example, a surveillance mission might require the UAV to operate continuously in the air for 8 hours.

[0061] Determining whether a mission is a long-term autonomous flight mission requires comparing the parsed time parameters with a preset long-term mission threshold. This threshold is a pre-defined time baseline value used to distinguish between short-term, one-off missions and persistent missions that require repeated reliance on the same map over a long period. This threshold is not arbitrary but based on a comprehensive consideration of the UAV system's reliability, environmental change rate, and map validity. For example, a mission might be considered a long-term mission if its repetition cycle is less than 24 hours or its total duration exceeds 4 hours. These 24-hour and 4-hour values ​​are example values; the actual threshold can be adjusted based on the specific application scenario. For instance, in stable indoor environments with longer map validity, the threshold might be set to a repetition cycle of less than 48 hours; in variable outdoor environments, the threshold might be set to a repetition cycle of less than 12 hours. The logic behind this setting is that when a mission requires repeated use of the same map within a short period or when a single mission lasts a long time, the risk of significant map scale drift during the mission increases, thus requiring subsequent scale difference analysis and compensation mechanisms. If the mission planning instruction includes both the repetitive execution cycle and the total mission duration, more complex judgment logic can be set. For example, either condition must be met to classify it as a long-term mission, or both conditions must be met simultaneously. Ultimately, if the comparison between the time parameter in the mission planning instruction and the long-term mission judgment threshold determines that the current mission meets the characteristics of a long-term autonomous flight mission, and the instruction to reuse the historical map has already been parsed, then a comprehensive judgment is drawn: the current flight mission is a long-term autonomous flight mission relying on a pre-stored historical environment map. This conclusion will be output as a Boolean logic flag or state variable to trigger the execution of subsequent step S3. The entire judgment process is based entirely on the parsing and logical comparison of explicit mission planning instructions, without requiring complex perception or reasoning during mission execution, ensuring the real-time nature and determinism of the judgment.

[0062] S3. When the determination is yes, align the real-time environment map with the historical environment map, and obtain the scale difference parameter by analyzing the structural characteristics of the reprojection error set generated by the same set of 3D landmarks based on the historical pose of the historical environment map and the real-time pose of the real-time environment map. The specific implementation is as follows:

[0063] A map alignment operation is performed, taking a real-time environment map and a historical environment map as input. The real-time environment map is the 3D point cloud representation constructed in step S1, while the historical environment map is similar 3D point cloud data pre-stored in the UAV's memory, constructed and saved by a previous task. The alignment process is achieved through feature matching, specifically by extracting discriminative local geometric feature descriptors from the 3D point clouds of both the real-time and historical environment maps. These descriptors are feature vectors constructed based on point cloud normals, curvature, or point density statistics. Subsequently, the correspondence between points in the real-time and historical environment maps is established by calculating the similarity of feature descriptors between different point clouds, such as calculating the Euclidean distance or cosine similarity between feature vectors. Based on these preliminary corresponding point pairs, a fine-tuning is performed using an iterative nearest-point algorithm or its variant. This algorithm iteratively calculates the optimal spatial transformation relationship between the two sets of point clouds. This spatial transformation relationship is typically represented as a 4x4 homogeneous transformation matrix, containing 3D rotation and 3D translation components, with the objective of minimizing the average distance between matched point pairs. The iteration stops when the average distance is less than a preset map alignment accuracy threshold, for example, when the average distance is less than 0.05 meters. The final homogeneous transformation matrix obtained at this point represents the spatial transformation relationship between the two maps, completing map alignment. The map alignment accuracy threshold is set based on the ranging accuracy of the visual sensor used and the application requirements of the map. For example, for high-precision operation scenarios, the threshold can be set to 0.02 meters, and for general navigation scenarios, the threshold can be set to 0.1 meters. This spatial transformation relationship will be used to transform all point cloud coordinates in the historical environment map to the coordinate system of the real-time environment map, placing both in the same coordinate reference system, laying the foundation for subsequent cross-map analysis.

[0064] After map alignment, 3D landmarks need to be selected for analyzing scale differences. These 3D landmarks are not arbitrary points, but points that must be stably observed in both the historical and real-time environmental maps. The specific selection method is as follows: traverse all 3D points in the historical environmental map and use the spatial transformation relationship obtained in the previous step to transform their coordinates to the coordinate system of the real-time environmental map. Next, in the real-time environmental map, find the nearest neighbor for each transformed historical map point. If the 3D Euclidean distance between a historical map point and its nearest neighbor in the real-time map is less than a preset landmark association distance threshold, for example, less than 0.1 meters, and the nearest neighbor itself is a high-confidence point in the real-time map, for example, its observation count exceeds a preset observation validity threshold, such as 5 times, then the points are considered a pair of matching points, which are the same physical landmarks existing simultaneously in both maps. The landmark association distance threshold is related to map alignment accuracy and point cloud density, and is typically set to 2 to 5 times the map alignment accuracy threshold. For example, if the map alignment accuracy threshold is 0.05 meters, the landmark association distance threshold can be set to 0.1 to 0.25 meters. The observation validity threshold is set to ensure that the selected landmarks are stable features confirmed through multiple observations, rather than noise points. This threshold is usually set based on the number of keyframes in a single mapping task, for example, between 3 and 10 observations. From all such matching point pairs, points that were also observed multiple times during historical map construction and have low location estimation variance are further selected; these points constitute the same group of 3D landmarks. To ensure the representativeness and robustness of the analysis, the number of points in the same group of 3D landmarks must be greater than a preset minimum effective landmark number threshold, for example, at least 50 points. The minimum effective landmark number threshold is set to ensure the reliability of subsequent statistical analysis; its value is usually determined based on experience or the required statistical significance, and can range from 30 to 100 points. If the number of selected landmarks is less than the minimum effective landmark count threshold, then more matching points can be obtained by appropriately relaxing the landmark association distance threshold, for example, by increasing it by 20%, or by re-aligning the local map in specific overlapping areas.

[0065] After obtaining the same set of 3D landmarks, the reprojection error under historical pose and real-time pose is calculated separately. Historical pose refers to the camera pose of the UAV at each keyframe when observing these landmarks during the construction of the historical environment map. This pose data is compared with the historical environment map. Figure 1The same storage. Real-time pose refers to the camera pose of the UAV at the keyframe moment when it observes the corresponding landmark in the real-time environment map during the current task. These poses are obtained synchronously when constructing the real-time map in step S1. For each 3D landmark, based on its 3D coordinates and the camera pose of a certain keyframe in which it is observed, its theoretical projected pixel coordinates on the corresponding keyframe image plane are calculated using the camera projection model. The camera projection model includes camera intrinsic parameters and lens distortion parameters. Then, the pixel coordinates of the landmark that are actually detected and tracked in the keyframe image are obtained. The two-dimensional vector difference between the theoretical projected pixel coordinates and the actual observed pixel coordinates is the single reprojection error of the landmark in that keyframe. For each point in the same set of 3D landmarks, it may involve being observed in multiple historical keyframes and multiple real-time keyframes. Therefore, it is necessary to calculate its reprojection error set in all relevant historical keyframes and its reprojection error set in all relevant real-time keyframes. Each error in these two sets is a two-dimensional vector. For unified analysis, the two components of each two-dimensional error vector are usually considered together, for example, by calculating the magnitude of the vector, or by pooling the X and Y components of all error vectors to form two sets of one-dimensional error components.

[0066] The statistical distribution characteristics of the reprojection error set are extracted as structural features. This involves calculating the covariance matrix of the reprojection error set and performing eigenvalue decomposition on the covariance matrix. Specifically, a reprojection error set under a real-time environmental map is used as an example. Assuming N reprojection error samples are collected, each a two-dimensional vector, the mean vector of these N sample vectors is calculated first. Then, the covariance matrix of the samples is calculated using a formula. This matrix is ​​a 2x2 symmetric matrix, where the diagonal elements are the variances of the error X and Y components, and the off-diagonal elements are their covariances, representing the distribution and correlation of the errors in the two dimensions. Calculating the covariance matrix involves subtracting the mean vector from each error sample vector, performing an outer product operation with itself and its transpose, summing the results for all samples, and dividing by N minus 1. After obtaining the covariance matrix, eigenvalue decomposition is performed, i.e., solving for the eigenvalues ​​and eigenvectors that satisfy specific mathematical relationships. Eigenvalue decomposition is a standard operation in linear algebra, achievable through numerical methods such as the Jacobi iteration method. Its output consists of two eigenvalues ​​and their corresponding eigenvectors. The eigenvalues ​​characterize the dispersion of the error distribution along the direction of the eigenvector. Using the distribution and ratio of the main eigenvalues ​​as structural features involves analyzing the magnitude relationship between these two eigenvalues. For example, let the larger eigenvalue be denoted as λ1 and the smaller as λ2. Calculate their ratio λ1 / λ2, and the proportion of λ1 to the total λ1+λ2. If the two maps are at the same scale, the reprojection error is mainly caused by random noise, and the expected error distribution is nearly isotropic, meaning the ratio of λ1 to λ2 is close to 1. If there are significant scale differences, this systematic error will cause the error distribution to exhibit a specific directionality, making λ1 significantly larger than λ2, and their ratio significantly greater than 1. For the reprojection error set under historical environment maps, the same calculation process is performed to obtain another set of eigenvalues ​​and ratios.

[0067] The scale difference parameter is calculated based on structural characteristics. The scale difference parameter is a scalar value used to quantify the degree of scale inconsistency between two maps. One implementation is based on the results of the aforementioned eigenvalue analysis. Let λ1real be the largest eigenvalue of the real-time map error covariance matrix, and λ1hist be the largest eigenvalue of the historical map error covariance matrix. Since scale differences cause changes in the error distribution, thus affecting the eigenvalues, the scale difference parameter S can be estimated by comparing the relative relationship between these two values, for example, by calculating S = sqrt(λ1real / λ1hist), where sqrt represents the square root operation. The principle is that scale errors amplify the components of reprojection errors in specific directions, thus causing predictable changes in the largest eigenvalue of the corresponding covariance matrix.

[0068] Another more robust approach is to utilize both eigenvalues ​​simultaneously. For example, the scale difference parameter can be defined as: S = (λ1real / λ2real) / (λ1hist / λ2hist), which is the ratio of the anisotropy of the two map error distributions. After calculating the scale difference parameter S, if S is close to 1, it indicates a small scale difference; if S is significantly greater than 1 or less than 1, it indicates significant scale scaling. This scale difference parameter will serve as a key input for subsequent steps.

[0069] S4. Based on the scale difference parameter, calculate the behavioral trajectory deviation generated after mapping the historical typical task trajectories recorded in the historical environment map to the real-time environment map. The specific implementation is as follows:

[0070] First, the path point sequences of typical historical mission trajectories need to be retrieved from the historical environment map. The historical environment map, as a comprehensive data file, not only stores a 3D point cloud map but also associates complete trajectory logs of several successfully executed flight missions within that map. Each flight mission trajectory log contains a chronologically ordered sequence of path points. Each path point is a data structure recording its 3D position coordinates in the global or local map coordinate system, the UAV's preset attitude upon reaching that point, and the associated flight control commands. The selection of typical historical mission trajectories follows clear criteria, aiming to find a trajectory that has proven safe, reliable, and of high quality in past executions as a reference benchmark. The specific selection process involves retrieving the historical environment map file, parsing all recorded historical flight mission trajectories, and analyzing the obstacle avoidance success rate and flight trajectory smoothness of each trajectory. The obstacle avoidance success rate refers to the percentage of times the UAV successfully identified and avoided all dynamic or static obstacles during the execution of a historical trajectory out of the total number of obstacle avoidance attempts. This data can be obtained statistically from the mission execution logs. Flight trajectory smoothness is a quantitative indicator used to measure the curvature and abruptness of a trajectory. It can be obtained by calculating the rate of change of turning angle between adjacent path points on the trajectory or the average of the trajectory curvature. When selecting a trajectory, a minimum obstacle avoidance success rate threshold is set, such as a requirement of at least 98%, and a maximum flight trajectory smoothness threshold is set, such as a requirement that the average curvature does not exceed 0.1 radians per meter. Among all historical trajectories that meet these two thresholds, the trajectory with the highest obstacle avoidance success rate is selected. If multiple trajectories have the same obstacle avoidance success rate, the trajectory with the best flight trajectory smoothness is selected. The complete path point sequence of this trajectory is then determined as the typical historical mission trajectory used in this calculation. If no trajectory can simultaneously meet both thresholds, one of the thresholds can be relaxed as appropriate, for example, the obstacle avoidance success rate requirement can be lowered to 95%, or other available trajectories in the historical map can be re-evaluated.

[0071] After obtaining the pathpoint sequence of historical typical mission trajectories, a spatial scale transformation is needed to generate a mapped trajectory to the real-time environment map coordinate system using a scale difference parameter. The scale difference parameter, calculated in step S3, is a scalar value representing the scaling ratio between the historical and real-time environment maps. For example, a scale difference parameter of 1.05 indicates that the real-time environment map is geometrically scaled up by 5% compared to the historical environment map. The transformation process is performed on the three-dimensional position coordinates of each pathpoint in the historical typical mission trajectory pathpoint sequence. For the coordinates of a pathpoint, the transformation formula is to multiply the X, Y, and Z coordinates of the point by the scale difference parameter, respectively, to obtain the new coordinates of the point in a hypothetical space consistent with the scale of the real-time environment map. After completing the coordinate transformation of all pathpoints in the sequence, a new pathpoint sequence is obtained. This new sequence is the mapped trajectory of the historical typical mission trajectory in the real-time environment map coordinate system after scale correction. It is worth noting that this transformation only changes the geometric scale of the trajectory; the relative order, attitude information, and control commands between pathpoints remain unchanged.

[0072] The positional offset is calculated by comparing the mapped trajectory with the original historical typical mission trajectory at corresponding path points. Since the mapped trajectory is directly obtained from the historical trajectory through scale transformation, the two have the exact same number and order of path points, thus establishing a one-to-one correspondence. For the i-th path point, let the 3D coordinates of this point in the historical typical mission trajectory be and the 3D coordinates of the corresponding point in the scale-transformed mapped trajectory be . The positional offset is the 3D Euclidean distance between these two corresponding points, calculated by taking the magnitude of the difference between the two coordinate vectors. Specifically, the formula for calculating the positional offset is to take the square root of the sum of the squares of the differences of the three coordinate components. For each point in the path point sequence, the corresponding positional offset is calculated using this method, resulting in a set of positional offsets of equal length to the path point sequence, which includes the absolute spatial position deviation at each path point due to scale differences.

[0073] Based on the positional offsets of all corresponding path points, the behavioral trajectory deviation is statistically calculated. Behavioral trajectory deviation is a comprehensive statistic used to quantify the spatial impact of scale differences on the entire task trajectory as a whole, rather than focusing solely on the offset of a single point. Statistical analysis is performed on the resulting set of positional offsets. One approach is to calculate the average of this set, i.e., the average positional offset, which reflects the average magnitude of the overall trajectory deviation. Another approach is to calculate the standard deviation of this set, which reflects the dispersion of the offsets at each point on the trajectory, i.e., the consistency of the offset. Alternatively, the maximum value in the set can be calculated, i.e., the maximum positional offset, which reflects the degree of trajectory deviation in the worst-case scenario. The behavioral trajectory deviation can be calculated using a single statistic, such as directly using the average positional offset as the output value. It can also be a composite index, such as defining a value obtained by weighted summation of the average offset and the maximum offset, where the weight of the average offset is set to 0.7 and the weight of the maximum offset is set to 0.3. The weighting is based on the assumption that the average offset better represents the overall impact, but the maximum offset must also be considered. The weights can be adjusted based on different focuses on flight safety. If more emphasis is placed on overall path consistency, the weight of the average deviation is increased; if more emphasis is placed on extreme risk points, the weight of the maximum deviation is increased. The final calculated behavioral trajectory deviation value, as a key quantitative output, will be passed to subsequent steps to assess its impact on the safety boundary.

[0074] S5. Combining scale difference parameters and behavioral trajectory deviations, assess the degree of impact on the current obstacle avoidance path planning safety boundary. Specifically, this is implemented as follows:

[0075] The input parameters for step S5 include the scale difference parameter calculated in step S3 and the behavior trajectory deviation calculated in step S4. The evaluation process first analyzes the problem from two levels: geometric scale and task execution path, and then makes a comprehensive judgment. The first analysis compares the scale difference parameter with a preset scale difference threshold to determine the quantitative value of the contraction or expansion of the geometric safety boundary caused by scale distortion. In the current obstacle avoidance path planning, the UAV maintains a minimum safe distance between itself and obstacles, which constitutes the geometric safety boundary. The scale difference parameter is a dimensionless scalar. If its value is not equal to 1, it means that there is a scale scaling between the real-time environment map and the historical environment map, which will directly cause the actual geometric size of the path planned based on the historical map to change proportionally in the real world. The preset scale difference threshold is used to define the significance of the scale difference. It is usually set to a numerical range close to 1 but with a slight deviation. For example, the lower threshold for the significance of scale difference is set to 0.98, and the upper threshold is set to 1.02. Its setting is based on the typical scale drift error range of the visual SLAM system in a stable environment, and is obtained through extensive experimental calibration. The scale difference parameter is compared with these thresholds. Specifically, the absolute value of the scale difference parameter minus 1 is used to obtain an absolute scale deviation value. This absolute scale deviation value is then compared with a preset allowable threshold, which can be set to, for example, 0.05. If the absolute scale deviation value is less than or equal to this allowable threshold, the scale difference is considered insignificant, and the change in the geometric safety boundary is determined to be zero. If the absolute scale deviation value is greater than this allowable threshold, it indicates significant scale scaling, and the change in the geometric safety boundary needs to be calculated. The change in the geometric safety boundary is a unitary physical quantity, calculated by multiplying the original geometric safety boundary distance set by the UAV by the difference between the scale difference parameter and 1. If the scale difference parameter is greater than 1, the change is positive, indicating that the safety boundary has been geometrically expanded; if the scale difference parameter is less than 1, the change is negative, indicating that the safety boundary has been geometrically contracted. This change is the quantified impact value from a geometric perspective.

[0076] Simultaneously, the second analysis compares the behavioral trajectory deviation with a preset trajectory tolerance threshold to determine the path deviation risk level at the task execution level. The behavioral trajectory deviation is a statistic output from step S4, such as an average positional offset in meters. The preset trajectory tolerance threshold is used to determine whether the deviation is within the acceptable task execution tolerance range. The trajectory tolerance threshold is not a single value, but typically a tiered set of thresholds used to classify different risk levels. For example, a first trajectory tolerance threshold, such as 0.1 meters, and a second trajectory tolerance threshold, such as 0.2 meters, can be set, where the second trajectory tolerance threshold is greater than the first. These thresholds are set based on the UAV's navigation accuracy, the width constraint of the task path, and the safe redundancy space in the environment. The comparison logic is as follows: the value of the behavioral trajectory deviation is compared sequentially with the first and second trajectory tolerance thresholds. If the behavioral trajectory deviation is less than or equal to the first trajectory tolerance threshold, the path deviation risk level is determined to be low risk. If the behavioral trajectory deviation is greater than the first trajectory tolerance threshold but less than or equal to the second trajectory tolerance threshold, the path deviation risk level is determined to be medium risk. If the deviation of the behavioral trajectory exceeds the second trajectory tolerance threshold, the path deviation risk level is determined to be high-risk. Through this hierarchical comparison, continuous behavioral trajectory deviation values ​​are mapped to a discrete path deviation risk level with clear semantics.

[0077] Based on a predefined risk mapping rule, the final impact on the safety boundary of the current obstacle avoidance path planning is determined by considering both the change in the geometric safety boundary and the path deviation risk level. The predefined risk mapping rule is a logical judgment rule that defines the mapping relationship from the two inputs—geometric change and path deviation risk level—to the output—final impact level. The final impact level is usually represented by a grading index, such as four levels: no impact, slight impact, moderate impact, and severe impact. The establishment of the risk mapping rule needs to consider the coupling effect between geometric safety changes and path deviation risk. One specific logic for implementing this rule is: first, determine the sign and magnitude of the change in the geometric safety boundary. If the change in the geometric safety boundary is zero, then regardless of the path deviation risk level, the final impact level is determined to be no impact because there is no distortion at the geometric scale. If the change in the geometric safety boundary is negative, i.e., the safety boundary shrinks, and its absolute value is greater than a preset safety boundary shrinkage sensitivity threshold, such as 0.02 meters, and the path deviation risk level is medium or high risk, then the final impact level is determined to be severe impact. If the absolute value of the safety boundary contraction is greater than the sensitivity threshold, but the path deviation risk level is low, it can be judged as a moderate impact. If the change in the geometric safety boundary is positive, i.e., the safety boundary expands, this is generally considered beneficial. Therefore, unless the path deviation risk level reaches a high risk level, the final impact can be judged as a slight impact or no impact. Specifically, it can be stipulated that when the safety boundary expands and the change exceeds a preset minimum beneficial change, and the path deviation risk level is high, it is judged as a slight impact; in other expansion cases, it is judged as no impact. The setting of parameters such as the safety boundary contraction sensitivity threshold and the minimum beneficial change needs to be determined through simulation and field testing, taking into account the dynamic performance and control accuracy of the UAV. After the entire evaluation process is completed, the output final impact level will serve as a key decision-making basis, directly used to trigger the spatial scale compensation operations of different strategies in step S6.

[0078] S6. Based on the degree of impact, perform spatial scale compensation on the real-time environment map or the obstacle avoidance path generated based on it, specifically as follows:

[0079] The core decision input for step S6 is the degree of influence on the safety boundary of the current obstacle avoidance path planning determined in step S5. This degree of influence is a discrete grading index, which may include four levels: no influence, slight influence, moderate influence, and severe influence. First, the corresponding spatial scale compensation factor needs to be determined based on this degree of influence. The spatial scale compensation factor is a dimensionless scalar value used to scale and correct geometric coordinates. One specific method for determining the spatial scale compensation factor is to create and query a predefined lookup table. This lookup table uses the degree of influence level as the index key, and each key corresponds to a pre-set spatial scale compensation factor value. For example, the lookup table can be pre-set as follows: when the degree of influence is no, the corresponding spatial scale compensation factor is 1.0; when the degree of influence is slight, the corresponding spatial scale compensation factor is 1.01; when the degree of influence is moderate, the corresponding spatial scale compensation factor is 1.02; and when the degree of influence is severe, the corresponding spatial scale compensation factor is 1.05. The specific values ​​of these factors were obtained through prior experimental calibration. The calibration principle was to find the optimal scaling ratio that could correct reprojection errors or trajectory deviations to within the allowable range under different levels of simulation scale error. Another more refined method is to establish a pre-defined functional relationship model with scale difference parameters and behavioral trajectory deviations as inputs and spatial scale compensation factors as outputs. The scale difference parameters are derived from step S3, and the behavioral trajectory deviations are derived from step S4. This functional relationship model can be a simple linear combination, for example, defining the spatial scale compensation factor as 1 plus the scale difference parameter minus 1 multiplied by a weight coefficient A, plus the behavioral trajectory deviation multiplied by another weight coefficient B. The weight coefficients A and B are set based on the relative importance of geometric scale error and trajectory execution error to the final compensation requirement, and need to be determined through regression analysis of a large amount of historical data. For example, if the analysis finds that geometric scale error is the dominant factor, then weight coefficient A can be set to 0.8, and weight coefficient B can be set to 0.2. By substituting the specific values ​​of the scale difference parameters and behavioral trajectory deviations obtained in real-time calculation for the current task into this functional relationship model, the corresponding spatial scale compensation factor can be calculated through arithmetic operations.

[0080] After determining the spatial scale compensation factor, a compensation strategy decision needs to be made based on the degree of impact. This involves determining whether to reconstruct the entire real-time environment map or only partially correct the currently planned obstacle avoidance path. This decision is made by comparing the degree of impact with a preset compensation strategy selection threshold. The compensation strategy selection threshold is a preset level of impact, such as a moderate impact. The logic behind this threshold is that when the impact is low, the scale inconsistency problem is not yet severe, and local path correction with less computation is more efficient. When the impact exceeds a certain level, it indicates that scale drift is significant, and correcting only a single path may not be sufficient to provide a reliable basis for all subsequent navigation decisions. Therefore, a thorough correction of the real-time environment map itself, which serves as a common reference, is necessary. Specifically, if the impact level determined in step S5 does not exceed the preset compensation strategy selection threshold (e.g., a slight impact with a moderate threshold), then the path scale correction strategy is executed. If the impact level determined in step S5 is equal to or exceeds the preset compensation strategy selection threshold (e.g., a moderate or severe impact), then the map reconstruction strategy is executed.

[0081] If the path scale correction strategy is selected, the operation target is the obstacle avoidance path generated based on the real-time environment map to be executed. This obstacle avoidance path consists of a series of path points, each containing its three-dimensional coordinates in the coordinate system of the real-time environment map. The specific method for path scale correction is to apply the spatial scale compensation factor determined in the previous step to the three-dimensional coordinates of each path point on this path. For each point in the path point sequence, its X, Y, and Z coordinates are multiplied by the spatial scale compensation factor to obtain the corrected new coordinates. After all path points have undergone this coordinate scaling calculation in sequence, a new obstacle avoidance path with spatial scale correction is obtained. The geometric scale of this new path matches the current scale of the real-time environment map, but its shape and relative positional relationships remain consistent with the original planned path. The UAV will directly use this corrected path as its execution trajectory, while the data of the real-time environment map itself remains unchanged.

[0082] If a map reconstruction strategy is chosen, the operation targets the coordinates of all 3D point clouds in the real-time environment map. The real-time environment map is constructed in step S1; essentially, it's a point cloud collection containing a large number of 3D points, each with its X, Y, and Z coordinates. The specific method for map reconstruction is to iterate through each 3D point in the real-time environment map point cloud and multiply its X, Y, and Z coordinates by a spatial scale compensation factor. This is a batch coordinate transformation process. After scaling the coordinates of all points, the entire real-time environment map is geometrically rescaled to a new benchmark that is more consistent with the physical world scale. This process is map reconstruction. After reconstruction, any subsequent path planning based on this map will naturally be at the correct scale, eliminating the need for additional adjustments to individual paths. The entire step S6, from decision-making to execution, follows a clear and closed-loop logic. It adaptively selects the most appropriate compensation granularity and target based on the severity and urgency of the impact, ensuring a balance between the effectiveness of compensation and system efficiency.

[0083] All calculations involved in the embodiments are dimensionless numerical calculations, and the preset parameters and thresholds in the calculations are set by those skilled in the art according to the actual situation.

[0084] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0085] Those skilled in the art will recognize that the modules 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 inventive 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 implementation should not be considered beyond the scope of this application.

[0086] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0087] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, 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 apparatuses or modules may be electrical, mechanical, or other forms.

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

[0089] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An automatic obstacle avoidance method for unmanned aerial vehicles (UAVs), characterized in that, Includes the following steps: S1. The drone constructs a real-time environmental map using onboard visual sensors; S2. Determine whether the current flight mission is a long-term autonomous flight mission that relies on a pre-stored historical environment map. S3. When the judgment is yes, align the real-time environment map with the historical environment map, and obtain the scale difference parameter by analyzing the structural characteristics of the reprojection error set generated by the same set of 3D landmarks based on the historical pose of the historical environment map and the real-time pose of the real-time environment map. S4. Based on the scale difference parameter, calculate the behavioral trajectory deviation generated after mapping the historical typical task trajectory recorded in the historical environment map to the real-time environment map. S5. Combine scale difference parameters with behavioral trajectory deviation to assess the degree of impact on the safety boundary of the current obstacle avoidance path planning; S6. Based on the degree of impact, perform spatial scale compensation on the real-time environment map or the obstacle avoidance path generated based on it.

2. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 1, characterized in that, Drones construct real-time environmental maps using onboard visual sensors, including: A continuous sequence of image frames of the environment is acquired using an airborne vision sensor; Visual feature points are extracted and tracked from a continuous sequence of image frames to estimate the pose change information of the UAV itself; Based on pose change information and the 3D coordinates of visual feature points, a 3D point cloud representation of a real-time environment map is generated through fusion processing.

3. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 1, characterized in that, Determining whether the current flight mission is a long-term autonomous flight mission that relies on pre-stored historical environment maps includes: Obtain the mission planning instructions for the current flight mission and parse the instructions regarding whether to reuse historical environment maps. When the instruction information requires reuse, it is further determined whether the current flight mission is a long-term autonomous flight mission that relies on a pre-stored historical environment map, based on the flight path repetition cycle or the total duration of the mission as defined in the mission planning instructions.

4. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 1, characterized in that, When the determination is yes, the real-time environment map is aligned with the historical environment map, and the scale difference parameters are obtained by analyzing the structural characteristics of the reprojection error set generated by the same set of 3D landmarks based on the historical pose of the historical environment map and the real-time pose of the real-time environment map, respectively. These parameters include: Feature matching is performed between the real-time environment map and the historical environment map, and the spatial transformation relationship between the two is calculated to complete map alignment. A set of three-dimensional landmarks that are stably observed in both the historical and real-time environmental maps are selected as the same set of three-dimensional landmarks. Based on the spatial transformation relationship and the same set of 3D landmarks, the reprojection error is calculated under the historical pose and the real-time pose, forming a set of reprojection errors. The statistical distribution characteristics of the reprojection error set are extracted as structural features; The scale difference parameter is calculated based on the structural characteristics.

5. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 4, characterized in that, Extracting the statistical distribution characteristics of the reprojection error set as structural features includes: calculating the covariance matrix of the reprojection error set; performing eigenvalue decomposition on the covariance matrix to obtain its eigenvalues ​​and eigenvectors; and using the distribution and ratio relationships of the main eigenvalues ​​as structural features.

6. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 1, characterized in that, Based on the scale difference parameter, the behavioral trajectory deviation generated after mapping the historical typical task trajectories recorded in the historical environment map to the real-time environment map is calculated, including: Read the path point sequence of typical historical mission trajectories from the historical environment map; The spatial scale transformation of the path point sequence is performed using the scale difference parameter to generate a mapped trajectory that is mapped to the real-time environment map coordinate system; Compare the positions of the mapped trajectory with those of typical historical task trajectories at corresponding path points, and calculate the position offset; Based on the positional offset of all corresponding path points, the behavioral trajectory deviation is statistically obtained.

7. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 6, characterized in that, Reading typical historical mission trajectories from historical environment maps includes: selecting the complete trajectory of the mission with the highest obstacle avoidance success rate and flight trajectory smoothness better than a preset threshold from multiple historical flight missions recorded in the historical environment map, and using it as the typical historical mission trajectory.

8. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 1, characterized in that, By combining scale difference parameters and behavioral trajectory deviations, the impact on the safety boundary of the current obstacle avoidance path planning is assessed, including: The scale difference parameter is compared with the preset scale difference threshold to determine the quantification value of the contraction or expansion of the geometric safety boundary caused by scale distortion. At the same time, the deviation of the behavior trajectory is compared with the preset trajectory tolerance threshold to determine the path deviation risk level at the task execution level. By combining the changes in the geometric safety boundary with the path deviation risk level, and based on predefined risk mapping rules, the degree of impact on the safety boundary of the current obstacle avoidance path planning is determined.

9. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 1, characterized in that, Depending on the degree of impact, spatial scale compensation is performed on the real-time environment map or the obstacle avoidance path generated based on it, including: Determine the corresponding spatial scale compensation factor based on the degree of impact; Determine whether the impact exceeds a preset threshold. If not, apply the spatial scale compensation factor to the coordinates of the obstacle avoidance path generated based on the real-time environment map to correct the path scale. If the scale exceeds the limit, then the spatial scale compensation factor will be applied to all 3D point cloud coordinates of the real-time environment map to complete map reconstruction.

10. The automatic obstacle avoidance method for unmanned aerial vehicles according to claim 9, characterized in that, Determining the corresponding spatial scale compensation factor based on the degree of influence includes: establishing a lookup table or preset function relationship model with scale difference parameters and behavioral trajectory deviation as inputs and compensation factor as output; substituting the currently obtained scale difference parameters and behavioral trajectory deviations into the table, or calculating to obtain the spatial scale compensation factor.