Unmanned aerial vehicle obstacle avoidance method, device, equipment, medium and product

By calculating the distance between the drone and the obstacle to identify the target obstacle, and calculating the composite repulsive force to dynamically adjust the flight path, the problem of drone obstacle avoidance methods easily getting trapped in local minima is solved, achieving a safe and stable obstacle avoidance effect.

CN121209563APending Publication Date: 2025-12-26MEIZHOU POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511710123.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

Existing drone obstacle avoidance methods are prone to getting stuck in local minima, leading to obstacle avoidance failure and inability to complete inspection tasks.

Method used

By calculating the distance between the drone and obstacles, identifying target obstacles, and calculating composite repulsive forces, including translational repulsive forces and rotational repulsive forces, the drone dynamically adjusts its flight path to avoid obstacles and maintains the smooth continuity of the global trajectory.

Benefits of technology

It significantly improves the flight safety and mission continuity of UAVs in complex environments, enabling safe and stable flight under potential collision risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121209563A_ABST
    Figure CN121209563A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an unmanned aerial vehicle obstacle avoidance method and device, equipment, a medium and a product. The method comprises the following steps: firstly, calculating the distance between the unmanned aerial vehicle and each obstacle according to the current position of the unmanned aerial vehicle and the position of each obstacle in a preset action range; then, for each obstacle, under the condition that the distance is smaller than or equal to a preset distance threshold value, determining that the obstacle is a target obstacle influencing the flight of the unmanned aerial vehicle; and then, for each target obstacle, according to the distance between the target obstacle and the unmanned aerial vehicle, the current position of the unmanned aerial vehicle and the position of the target obstacle, calculating a composite repulsive force generated by the target obstacle to the unmanned aerial vehicle, calculating a total composite repulsive force corresponding to the current position of the unmanned aerial vehicle, and determining a flight route of the unmanned aerial vehicle according to the total composite repulsive force. Through the method, the unmanned aerial vehicle can sense the potential collision risk in real time in a complex and dynamic electric power inspection environment, so that the flight safety is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of unmanned aerial vehicle (UAV) power line inspection, and in particular to a UAV obstacle avoidance method, device, equipment, medium, and product. Background Technology

[0002] Autonomous obstacle avoidance technology plays a crucial role in unmanned aerial vehicle (UAV) power line inspections. Power line inspections often involve complex environments, including obstacles such as high-voltage towers, power lines, trees, and undulating terrain. Furthermore, flights are frequently conducted at high altitudes, in narrow or uninhabited areas, making real-time human intervention difficult. Through autonomous obstacle avoidance, UAVs can identify potential obstacles and plan safe flight paths in real time, avoiding collision risks and ensuring the safety of equipment and lines. Simultaneously, it enhances the continuity and stability of inspection tasks, enabling all-weather, fully autonomous intelligent inspections, thereby significantly improving the efficiency and safety of power line maintenance.

[0003] In existing technologies, drone obstacle avoidance methods typically employ the traditional artificial potential field method. Specifically, the motion of the drone in the flight environment is abstracted as a motion process in a virtual force field. The target point generates an "attraction" to the drone, while the obstacle generates a "repulsion". Under the combined action of the attraction and repulsion, the drone plans a collision-free path from the starting point to the target point.

[0004] However, existing drone obstacle avoidance methods are prone to getting stuck in local minima, leading to obstacle avoidance failure and inability to complete inspection tasks. Summary of the Invention

[0005] This application provides a method, apparatus, equipment, medium, and product for drone obstacle avoidance, in order to solve the problem that the prior art is prone to getting stuck in local minima, which leads to the failure of obstacle avoidance tasks and the inability to complete inspection tasks.

[0006] In a first aspect, embodiments of this application provide a method for obstacle avoidance by a drone, including:

[0007] Based on the current position of the drone and the positions of each obstacle within the preset effective range, calculate the distance between the drone and each obstacle;

[0008] For each obstacle, if the distance is less than or equal to a preset distance threshold, the obstacle is determined to be a target obstacle affecting the flight of the UAV;

[0009] For each target obstacle, based on the distance between the target obstacle and the drone, the current position of the drone, and the position of the target obstacle, a composite repulsive force generated by the target obstacle on the drone is calculated, wherein the composite repulsive force includes a translational repulsive force component and a rotational repulsive force component;

[0010] Based on each of the composite repulsive forces, the total composite repulsive force corresponding to the current position of the UAV is calculated, and the flight path of the UAV is determined based on the total composite repulsive force.

[0011] In one possible implementation, calculating the combined repulsive force exerted by the target obstacle on the drone based on the distance between the target obstacle and the drone, the current position of the drone, and the position of the target obstacle includes:

[0012] Based on the distance between the target obstacle and the UAV, the repulsive potential energy term generated by the target obstacle is calculated using a preset repulsive potential function;

[0013] The negative gradient of the repulsive potential energy term is calculated to obtain the translational repulsive component, which is used to push the UAV away from the obstacle area along the radial direction of the target obstacle.

[0014] Based on the relative direction between the current position of the UAV and the position of the target obstacle, and the distance between the target obstacle and the UAV, a rotational repulsion component is calculated. This rotational repulsion component is used to provide tangential guiding force in the flight plane of the UAV.

[0015] The translational repulsive force component and the rotational repulsive force component are weighted and synthesized according to a preset weighting coefficient to obtain the composite repulsive force of the target obstacle on the UAV.

[0016] In one possible implementation, the current position of the UAV includes the UAV's planar position vector, heading angle, and azimuth angle relative to the center of gravity of each obstacle; the position of the target obstacle includes the target obstacle's planar position vector.

[0017] The step of calculating the rotational repulsion component based on the relative position of the UAV and the target obstacle, and the distance between the target obstacle and the UAV, includes:

[0018] Based on the heading angle of the UAV and the azimuth angle of the UAV relative to the center of gravity of the target obstacle, calculate the relative direction between the current position of the UAV and the position of the target obstacle;

[0019] A rotation matrix is ​​constructed based on the relative directions, and the rotational repulsion component is calculated based on the rotation matrix, the planar position vector of the UAV, the planar position vector of the target obstacle, and the distance between the target obstacle and the UAV.

[0020] In one possible implementation, the current position of the drone also includes the position of the drone's center of mass, and the position of the obstacle also includes the position of the obstacle's center of mass;

[0021] The step of calculating the distance between the drone and each obstacle based on the drone's current position and the positions of obstacles within a preset effective range includes:

[0022] The Euclidean distance between the UAV and each obstacle is calculated based on the centroid position of the UAV and the centroid positions of each obstacle within the preset range of action.

[0023] In one possible implementation, the step of calculating the total composite repulsion force corresponding to the current position of the UAV based on each of the composite repulsion forces, and determining the flight path of the UAV based on the total composite repulsion force, includes:

[0024] The total composite repulsive force corresponding to the current position of the UAV is obtained by vector superposition of each composite repulsive force.

[0025] When the total composite repulsive force is greater than or equal to a preset repulsive force threshold, the flight path of the UAV at the next moment is determined based on the total composite repulsive force and the model predictive control algorithm.

[0026] In one possible implementation, the method further includes:

[0027] When the total composite repulsive force is less than a preset repulsive force threshold, the drone is controlled to fly along an initial trajectory. The initial trajectory is a time-parameterized global smooth reference trajectory generated based on the Minimum Snap algorithm, according to the flight intention path and the drone's dynamic constraints.

[0028] Secondly, embodiments of this application provide an obstacle avoidance device for unmanned aerial vehicles, comprising:

[0029] The first calculation module is used to calculate the distance between the drone and each obstacle based on the current position of the drone and the positions of each obstacle within the preset range of action.

[0030] The first determining module is used to determine, for each obstacle, if the distance is less than or equal to a preset distance threshold, that the obstacle is a target obstacle affecting the flight of the UAV;

[0031] The second calculation module is used to calculate, for each target obstacle, the composite repulsive force exerted by the target obstacle on the drone based on the distance between the target obstacle and the drone, the current position of the drone and the position of the target obstacle, wherein the composite repulsive force includes a translational repulsive force component and a rotational repulsive force component.

[0032] The second determining module calculates the total composite repulsion force corresponding to the current position of the UAV based on each composite repulsion force, and determines the flight path of the UAV based on the total composite repulsion force.

[0033] In one possible implementation, the second computing module is specifically used for:

[0034] Based on the distance between the target obstacle and the UAV, the repulsive potential energy term generated by the target obstacle is calculated using a preset repulsive potential function;

[0035] The negative gradient of the repulsive potential energy term is calculated to obtain the translational repulsive component, which is used to push the UAV away from the obstacle area along the radial direction of the target obstacle.

[0036] Based on the relative direction between the current position of the UAV and the position of the target obstacle, and the distance between the target obstacle and the UAV, a rotational repulsion component is calculated. This rotational repulsion component is used to provide tangential guiding force in the flight plane of the UAV.

[0037] The translational repulsive force component and the rotational repulsive force component are weighted and synthesized according to a preset weighting coefficient to obtain the composite repulsive force of the target obstacle on the UAV.

[0038] In one possible implementation, the current position of the UAV includes the UAV's planar position vector, heading angle, and azimuth angle relative to the center of gravity of each obstacle; the position of the target obstacle includes the target obstacle's planar position vector.

[0039] The second calculation module is specifically used for:

[0040] Based on the heading angle of the UAV and the azimuth angle of the UAV relative to the center of gravity of the target obstacle, calculate the relative direction between the current position of the UAV and the position of the target obstacle;

[0041] A rotation matrix is ​​constructed based on the relative directions, and the rotational repulsion component is calculated based on the rotation matrix, the planar position vector of the UAV, the planar position vector of the target obstacle, and the distance between the target obstacle and the UAV.

[0042] In one possible implementation, the current position of the drone also includes the position of the drone's center of mass, and the position of the obstacle also includes the position of the obstacle's center of mass;

[0043] The first calculation module is specifically used for:

[0044] The Euclidean distance between the UAV and each obstacle is calculated based on the centroid position of the UAV and the centroid positions of each obstacle within the preset range of action.

[0045] In one possible implementation, the second determining module is specifically used for:

[0046] The total composite repulsive force corresponding to the current position of the UAV is obtained by vector superposition of each composite repulsive force.

[0047] When the total composite repulsive force is greater than or equal to a preset repulsive force threshold, the flight path of the UAV at the next moment is determined based on the total composite repulsive force and the model predictive control algorithm.

[0048] In one possible implementation, the drone obstacle avoidance device further includes a control module for:

[0049] When the total composite repulsive force is less than a preset repulsive force threshold, the drone is controlled to fly along an initial trajectory. The initial trajectory is a time-parameterized global smooth reference trajectory generated based on the Minimum Snap algorithm, according to the flight intention path and the drone's dynamic constraints.

[0050] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0051] The memory stores computer-executed instructions;

[0052] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0053] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0054] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0055] This application provides a method, apparatus, device, medium, and product for drone obstacle avoidance. Based on the drone's current position and the positions of all obstacles within the effective range detectable by its sensors, the distance between the drone and each obstacle is calculated, quantifying the potential threat of each obstacle to flight safety. Subsequently, for each obstacle, the calculated distance is compared with a preset distance threshold. When the distance is less than or equal to the threshold, it is identified as a target obstacle, excluding distant obstacles with minimal impact on flight, reducing unnecessary obstacle avoidance calculations, and improving system response efficiency. Next, for each target obstacle, a composite repulsive force is calculated based on the relative relationship between the drone's current position and the obstacle's position. This composite repulsive force consists of translational and rotational repulsive forces. The translational repulsive force pushes the drone radially to avoid collision, while the rotational repulsive force guides the drone's obstacle-avoidance maneuvers in the horizontal plane, overcoming the shortcomings of traditional artificial potential field methods that may get trapped in local minima. The composite repulsive forces of all target obstacles are vector-superimposed to form a total composite repulsive force. This total composite repulsive force reflects the overall threat level of obstacles in the current environment and provides a quantitative basis for trajectory decision-making. Finally, the UAV dynamically adjusts its flight path based on the direction and magnitude of the total composite repulsive force, achieving smooth and continuous flight that avoids obstacles while maintaining the original global trajectory as much as possible. This enables the UAV to perceive potential collision risks in real time in complex and dynamic power inspection environments and generate safe, stable, and physically executable obstacle avoidance trajectories, thereby significantly improving flight safety and mission continuity. Attached Figure Description

[0056] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0057] Figure 1 A flowchart illustrating the drone obstacle avoidance method provided in this application embodiment. Figure 1 ;

[0058] Figure 2 A flowchart illustrating the drone obstacle avoidance method provided in this application embodiment. Figure 2 ;

[0059] Figure 3 A schematic diagram of the composite repulsive force generated by the target obstacle provided in the embodiments of this application;

[0060] Figure 4 A schematic diagram illustrating the relative relationship between the UAV's heading and the obstacle's orientation, provided for an embodiment of this application;

[0061] Figure 5 This is a schematic diagram of the structure of the drone obstacle avoidance device provided in the embodiments of this application;

[0062] Figure 6This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0063] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0064] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0065] Autonomous obstacle avoidance technology plays a crucial role in unmanned aerial vehicle (UAV) power line inspections. Power line inspections often involve complex environments, including obstacles such as high-voltage towers, power lines, trees, and undulating terrain. Furthermore, flights are frequently conducted at high altitudes, in narrow or uninhabited areas, making real-time human intervention difficult. Through autonomous obstacle avoidance, UAVs can identify potential obstacles and plan safe flight paths in real time, avoiding collision risks and ensuring the safety of equipment and lines. Simultaneously, it enhances the continuity and stability of inspection tasks, enabling all-weather, fully autonomous intelligent inspections, thereby significantly improving the efficiency and safety of power line maintenance.

[0066] In existing technologies, drone obstacle avoidance methods typically employ the traditional artificial potential field method. Specifically, the motion of the drone in the flight environment is abstracted as a motion process in a virtual force field. The target point generates an "attraction" to the drone, while the obstacle generates a "repulsion". Under the combined action of the attraction and repulsion, the drone plans a collision-free path from the starting point to the target point.

[0067] However, in complex environments such as narrow passages or U-shaped traps, the existing drone obstacle avoidance methods can easily cause the drone to reach a balance between the gravitational and repulsive forces, trapping it in a local minimum and preventing it from continuing to move towards the target point, ultimately leading to the failure of the obstacle avoidance mission. Secondly, when the drone approaches the target point but there are obstacles nearby, the drone often repeatedly acts between the gravitational force of the target point and the repulsive force of the obstacle, resulting in path oscillations near the target point and making it unable to stably reach the destination.

[0068] Based on this, this application proposes a drone obstacle avoidance method. Addressing the problems of existing drone obstacle avoidance methods easily getting stuck in local minima and unable to continue moving forward in complex environments such as narrow passages or U-shaped traps, and experiencing path oscillations near the target point, making it difficult to stably reach the destination, the inventors conducted an in-depth analysis based on the principle of force field balance. They recognized that the root cause of these problems lies in the fact that traditional artificial potential field methods simultaneously introduce attractive and repulsive forces. When the two forces acting on the drone cancel each other out, the system loses its forward driving force. Therefore, the inventors devised a method to dynamically correct the flight path by calculating the composite repulsive force locally in real time while maintaining global trajectory guidance. Specifically, this method first calculates the distance between the drone's current position and the positions of obstacles within a preset effective range; when the distance to an obstacle is less than or equal to a set threshold, it is identified as a target obstacle affecting flight safety. Subsequently, based on the relative position and distance between the target obstacle and the drone, a composite repulsive force consisting of translational and rotational repulsive forces is calculated. The translational repulsive force is used to push away the obstacle radially, while the rotational repulsive force guides the drone to fly around the obstacle in the horizontal plane, thus avoiding falling into a balance trap. Next, the composite repulsive forces of all target obstacles are vector-superimposed to obtain the total composite repulsive force at the drone's current position, and the drone's flight path is corrected in real time based on the direction and magnitude of this resultant force. In this way, the drone can automatically escape the constraints of local minima in complex environments and maintain a stable forward trend. Even with obstacles near the target point, it can achieve smooth path convergence and precise landing, significantly improving the stability of the obstacle avoidance process and the mission completion rate, and achieving highly robust autonomous flight in complex scenarios.

[0069] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0070] Before introducing the embodiments of this application, it is necessary to describe the operating environment of this application. In this embodiment, the operating environment is set as a three-dimensional physical space. The core application scenario is to handle situations where prior map information is incomplete, outdated, or missing, and it is specifically designed for UAVs equipped with large field-of-view (FOV) three-dimensional environmental perception sensors (such as LiDAR). In this scenario, when the UAV performs a mission, its initial reference trajectory is generated based on existing data. Therefore, during actual flight, it is highly likely to encounter obstacles that are unknown beforehand and are only considered static in this embodiment.

[0071] Based on the aforementioned operating environment, the mission objectives are set as a hierarchical structure with clear priorities: the primary mission objective is to ensure absolute flight safety and ultimately successfully reach the designated endpoint. Building upon this, the secondary mission objective is to, while ensuring safety, stay as close as possible to and follow the initial reference trajectory generated by the global path planning module. This means that when authorized to detect unknown obstacles, the mission can proactively deviate from the initial reference trajectory to execute necessary evasive maneuvers, thereby ensuring the achievement of the primary mission objective.

[0072] Figure 1 A flowchart illustrating the drone obstacle avoidance method provided in this application embodiment. Figure 1 ;like Figure 1 As shown, the method includes:

[0073] S101. Calculate the distance between the drone and each obstacle based on the drone's current position and the positions of obstacles within the preset effective range.

[0074] The drone's current position includes the drone's center of mass, and the obstacle's position includes the obstacle's center of mass.

[0075] It should be noted that the centroid position of the obstacle is determined by density clustering of the real-time point cloud data of obstacles within a preset range collected by the UAV's sensors. Specifically, a density-based spatial clustering of applications with noise (DBSCAN) algorithm is used to identify and segment the spatial density distribution of the point cloud data into multiple independent point cloud clusters, thereby effectively distinguishing different obstacles. Subsequently, the average value of the three-dimensional coordinates of each point cloud cluster is calculated to obtain the three-dimensional centroid position of the corresponding obstacle.

[0076] In one feasible approach, the Euclidean distance between the UAV and each obstacle is calculated based on the centroid position of the UAV and the centroid positions of each obstacle within a preset effective range.

[0077] It should also be noted that the drone in this application is preferably a quadcopter drone. To facilitate subsequent path planning and control algorithm design, the physical entity of the drone is abstracted into a precise mathematical model, namely:

[0078]

[0079] in, Represents the spatial position of the UAV in a three-dimensional Cartesian coordinate system, while the scalar... This indicates the direction in which the nose of the aircraft is facing, i.e., around a vertical direction. Yaw angle of the axis.

[0080] The dynamic performance of this model is defined by a set of physical constraints, which constitute the physical boundaries that all subsequent planning and control algorithms must adhere to. These parameters include its maximum permissible translational linear velocity and maximum permissible translational linear acceleration, and define its rotational capabilities, including the maximum permissible yaw rate and maximum permissible yaw acceleration. These constraints ensure that any flight trajectory ultimately generated in this application is physically safe and stable for the UAV to execute.

[0081] Complementing the aircraft model is its onboard 3D environment perception sensor model. This sensor model defines the boundaries of the UAV's perception capabilities, with key parameters including the maximum effective detection range, as well as the horizontal and vertical field of view. This model ensures that subsequent local obstacle avoidance algorithms make decisions within a realistic, but not omniscient, perception range. Furthermore, the model's definition possesses good universality, making it compatible with various sensors capable of generating 3D point clouds, such as depth cameras with finite field of view or LiDAR with specific vertical scanning ranges, thereby enhancing the applicability of this technical solution.

[0082] It should be understood that the drone is abstracted as a centroid point, and the obstacle is also represented by its centroid position. The distance between the two is calculated using three-dimensional spatial coordinate information. This method simplifies the impact of complex-shaped obstacles on the calculation, while retaining key information for collision risk assessment, providing a basis for determining whether avoidance is necessary.

[0083] In the specific implementation, the current centroid coordinates of the UAV are first collected. And the centroid coordinates of all obstacles within the preset effective range. Then, for each obstacle, use the Euclidean distance formula:

[0084]

[0085] Where d is the Euclidean distance between the drone and the obstacle.

[0086] Understandably, the distance calculations described above allow for the accurate quantification of the potential threat posed by each obstacle to the UAV, providing a precise basis for the local obstacle avoidance module to identify target obstacles. This method is characterized by high computational efficiency and strong scalability, enabling it to adapt to changes in the number of obstacles in dynamic environments while ensuring real-time performance, thus ensuring that the UAV can quickly make obstacle avoidance decisions in complex power line inspection environments.

[0087] S102. For each obstacle, if the distance is less than or equal to a preset distance threshold, the obstacle is determined to be a target obstacle affecting the flight of the drone.

[0088] It should be understood that treating obstacles at a distance less than or equal to a preset threshold as target obstacles allows limited computing resources to be focused on objects that have a real impact on flight safety, avoiding meaningless obstacle avoidance calculations, improving response efficiency, and ensuring the safety of drones in complex environments.

[0089] For example, when a drone approaches a tree, if the distance is calculated to be 2 meters using the method in embodiment S101, and the preset threshold is 3 meters, then the tree is identified as a target obstacle and used for subsequent local obstacle avoidance calculations.

[0090] Understandably, the above method can filter out obstacles that may pose a threat to the movement of the drone in real time during flight, thereby achieving the effect of focused obstacle avoidance. Compared with calculating all environmental objects, this method reduces the amount of calculation, improves the obstacle avoidance response speed, and avoids unnecessary trajectory deviations or oscillations caused by interference from irrelevant obstacles.

[0091] S103. For each target obstacle, calculate the combined repulsive force exerted by the target obstacle on the drone based on the distance between the target obstacle and the drone, the current position of the drone, and the position of the target obstacle.

[0092] The composite repulsive force includes a translational repulsive force component and a rotational repulsive force component; the translational repulsive force component is used to push the UAV away from the obstacle area along the radial direction of the target obstacle; the rotational repulsive force component is used to provide tangential guidance force in the UAV's flight plane.

[0093] It should be noted that the detailed process for calculating the combined repulsive force exerted by the target obstacle on the UAV is described in this application. Figure 2 The embodiments are described in detail, and the embodiments of this application will not be repeated here.

[0094] S104. Calculate the total composite repulsion force corresponding to the current position of the UAV based on each composite repulsion force, and determine the flight path of the UAV based on the total composite repulsion force.

[0095] In one feasible approach, each composite repulsive force is vector-superimposed to obtain the total composite repulsive force corresponding to the current position of the UAV; when the total composite repulsive force is greater than or equal to a preset repulsive force threshold, the flight path of the UAV at the next moment is determined based on the total composite repulsive force and the model predictive control algorithm.

[0096] It should also be noted that when the total composite repulsive force is less than the preset repulsive force threshold, the drone is controlled to fly along the initial trajectory.

[0097] The initial trajectory is a time-parameterized, globally smooth reference trajectory generated based on the Minimum Snap algorithm, according to the flight intention path and UAV dynamic constraints.

[0098] In the specific implementation process, the combined repulsive force of the obstacle on the current position of the drone is first calculated. Then, all the combined repulsive forces are vector-superimposed to obtain the total combined repulsive force.

[0099]

[0100] in, Let be the combined repulsive force of the i-th obstacle on the drone's current position q. The total composite repulsive force.

[0101] It should be understood that when the total composite repulsive force is greater than or equal to a preset repulsive force threshold, it indicates that the drone is at risk of collision. Therefore, an additional offset acceleration term (i.e., jerk) is calculated based on the total composite repulsive force, and this is input into the Model Predictive Control (MPC) algorithm in the trajectory tracking module. The predictive model is then used to calculate the drone's optimal reference state (including position, velocity, and acceleration) for the next moment, generating a flight path corrected for obstacle avoidance. For example, when the drone approaches a group of obstacles, the total repulsive force is directed to the upper right. The MPC will output a control sequence with tangential offset, allowing the drone to avoid the obstacle group.

[0102] Specifically, the formula for calculating jerk using the total composite repulsive force is:

[0103]

[0104] in, To accelerate, Acceleration under the reference trajectory, The combined repulsive force affects the gain. The total composite repulsive force.

[0105] When the total combined repulsive force is less than the preset repulsive force threshold, it indicates that the drone currently poses no collision risk and no trajectory correction is required. At this time, the system directly controls the drone to fly along the reference trajectory, ensuring smooth flight and optimized energy consumption, while avoiding unnecessary trajectory deviations caused by frequent obstacle avoidance maneuvers.

[0106] In another possible implementation, when the UAV faces collision risk and its obstacle avoidance-corrected flight path, generated by the model predictive control algorithm, moves away from all target obstacles, if the total composite repulsive force drops below a preset repulsive force threshold, the UAV is deemed to have completed obstacle avoidance, and its output is paused, resuming its reference trajectory. It should also be noted that the core of the MPC algorithm in this embodiment lies in its "foresight": it uses an internal UAV dynamics model to predict the UAV's trajectory over a short time period within each control cycle, and through numerical optimization, calculates in real-time a sequence of control commands that optimally guides the UAV to the target state.

[0107] A constant acceleration linear model is preferred. This model uses the UAV's jerk as the control input u and defines the UAV's state x as a vector containing its position, velocity, and acceleration. The discrete-time state-space expression of this model is:

[0108]

[0109] Matrices A and B are state transition matrices derived from constant acceleration kinematics.

[0110] In each control cycle, the MPC module solves an online optimization problem of the following form:

[0111]

[0112] In this optimization problem, the objective function aims to minimize the tracking error between the predicted trajectory and the reference target. The square of the second norm, and the control input. The square of the second norm, where This is a scalar weight used to balance tracking accuracy and control smoothness. The constraints include the aforementioned UAV dynamics model, hard constraints on the control input, and soft constraints on the UAV state (such as maximum speed and maximum acceleration). The soft constraints are introduced by a slack variable. To achieve this, and with its The norm form imposes a larger penalty weight on the objective function. This soft constraint approach allows for minute, instantaneous violations of state constraints in extreme cases, thereby enhancing the robustness of solving optimization problems and avoiding unsolvable situations caused by strict hard constraints.

[0113] The result of this optimization problem is the optimal control input sequence within the next n steps. The first element of this sequence (i.e., the optimal jerk command at the current moment) is applied to the prediction model to calculate the optimal reference state (including position, velocity, and acceleration) at the next moment. This optimal reference state is then transformed into a smooth and dynamically feasible control reference point that the UAV's underlying controller can execute, and sent to the UAV's underlying controller at a high frequency. Conversely, if the UAV currently faces no collision risk, the corresponding flight state (including position, velocity, and acceleration) in the reference trajectory is transformed into a smooth and dynamically feasible control reference point that the UAV's underlying controller can execute, and sent to the UAV's underlying controller at a high frequency. This approach ensures rapid response and seamless, safe trajectory tracking under various operating conditions.

[0114] This application provides an obstacle avoidance method for unmanned aerial vehicles (UAVs). Based on the current position of the UAV and the positions of all obstacles within the effective range detectable by its sensors, the method calculates the distance between the UAV and each obstacle, quantifying the potential threat of each obstacle to flight safety. Then, for each obstacle, the calculated distance is compared with a preset distance threshold. When the distance is less than or equal to the threshold, it is identified as a target obstacle, excluding distant obstacles with minimal impact on flight, reducing unnecessary obstacle avoidance calculations, and improving system response efficiency. Next, for each target obstacle, a composite repulsive force is calculated based on the relative relationship between the UAV's current position and the obstacle's position. This composite repulsive force consists of translational and rotational repulsive forces. The translational repulsive force pushes the UAV radially to avoid collision, while the rotational repulsive force guides the UAV to maneuver around the obstacle in the horizontal plane, thus overcoming the defect of traditional artificial potential field methods that may get trapped in local minima. The composite repulsive forces of all target obstacles are vector-superimposed to form a total composite repulsive force. This total composite repulsive force reflects the comprehensive threat level of obstacles in the current environment and provides a quantitative basis for trajectory decision-making. Finally, the UAV dynamically adjusts its flight path based on the direction and magnitude of the total composite repulsive force, achieving smooth and continuous flight that avoids obstacles while maintaining the original global trajectory as much as possible. This enables the UAV to perceive potential collision risks in real time in complex and dynamic power inspection environments and generate safe, stable, and physically executable obstacle avoidance trajectories, thereby significantly improving flight safety and mission continuity.

[0115] Figure 2 A flowchart illustrating the drone obstacle avoidance method provided in this application embodiment. Figure 2 ,like Figure 2 As shown, in this embodiment... Figure 1 Based on the examples, the process of calculating the combined repulsive force generated by the target obstacle on the UAV is described in detail. The method includes:

[0116] S201. Based on the distance between the target obstacle and the UAV, calculate the repulsive potential energy term generated by the target obstacle using a preset repulsive potential function.

[0117] The core of the repulsive potential function is that the closer the distance, the greater the potential energy, thus ensuring that the drone can generate sufficient evasive driving force when it is close to the obstacle, while being almost unaffected when it is far away from the obstacle.

[0118] It should be understood that the threat posed by an obstacle to a drone is quantified as a scalar potential energy using a repulsive potential function. By calculating the potential energy value, a mathematical basis can be provided for subsequent force calculations, enabling the drone's obstacle avoidance to be continuous and predictable.

[0119] Specifically, the first step is to acquire the core material of each target obstacle. Current location of the drone Distance between Then, according to the preset repulsive potential function... Calculate the potential energy term:

[0120]

[0121] in, The repulsive force gain coefficient, For target obstacle material heart The distance between the drone and its current position q This is the maximum distance threshold at which the repulsive force takes effect. For example, when the drone is 1.5 meters away from the obstacle, and the threshold... When the distance is 3 meters, the potential energy will be calculated as a non-zero value to generate the corresponding composite repulsive force.

[0122] Understandably, the repulsive potential energy term calculated through this step can be directly used to generate the UAV's repulsive vector, enabling real-time correction of the flight path. This method ensures that the UAV can automatically adjust its obstacle avoidance force according to the distance to obstacles, achieving continuous and smooth obstacle avoidance behavior.

[0123] S202. Solve the negative gradient of the repulsive potential energy term to obtain the translational repulsive component.

[0124] It should be understood that this embodiment converts repulsive potential energy into an actual force acting on the UAV, thereby achieving dynamic correction of the flight path. The translational repulsive component pushes the UAV directly away from the obstacle radially, and its calculation method is to obtain the negative gradient of the aforementioned repulsive potential function, i.e.:

[0125]

[0126] in, This is the gain of the translational repulsive force. For example, when the drone is 1.2 meters away from the obstacle and the threshold is 2 meters, the negative gradient calculation will generate a force vector that moves radially away from the obstacle, which is used to correct the drone's position in real time.

[0127] It should be understood that by solving for the negative gradient, the generated translational repulsive force ensures that the UAV always moves along the optimal obstacle avoidance direction, achieving the function of "automatically moving away from obstacles". This method is computationally efficient and continuous, enabling the UAV to respond quickly to changes in obstacles in complex environments while maintaining trajectory smoothness, avoiding excessive deviation from the original reference path, and improving flight safety and stability.

[0128] S203. Calculate the rotational repulsion component based on the relative direction between the current position of the UAV and the position of the target obstacle, and the distance between the target obstacle and the UAV.

[0129] The current position of the UAV includes its planar position vector, heading angle, and azimuth angle relative to the center of gravity of each obstacle; the position of the target obstacle includes its planar position vector.

[0130] It should be noted that translational repulsion alone can cause the UAV to fall into an indecisive oscillating state when facing an obstacle. To overcome this deficiency, this application introduces a rotational repulsion component, which provides a tangential thrust in the horizontal plane of the UAV to guide it in orbital maneuvers.

[0131] In one feasible approach, the relative direction between the current position of the UAV and the position of the target obstacle is first calculated based on the heading angle of the UAV and the azimuth angle of the UAV relative to the center of gravity of the target obstacle; then, a rotation matrix is ​​constructed based on the relative direction, and the rotation repulsion component is calculated based on the rotation matrix, the planar position vector of the UAV, the planar position vector of the target obstacle, and the distance between the target obstacle and the UAV.

[0132] It should be understood that by introducing a rotational repulsive force component, the drone can perform tangential orbiting motion around the obstacle, avoiding the oscillations or stagnation that might occur with simple translational repulsive force. By analyzing the relative direction between the drone's current position and the target obstacle, a tangential thrust can be generated on the horizontal plane, enabling the drone to move along a reasonable obstacle avoidance path, thus ensuring continuous and non-stagnant obstacle avoidance actions.

[0133] In the specific implementation, the first step is to obtain the UAV's planar position vector r and heading angle. And the planar position vector of each target obstacle and the azimuth angle from the UAV to the obstacle. The difference between the two is calculated:

[0134]

[0135] in, This represents the current heading angle of the drone on its global trajectory. The azimuth angle from the drone to the center of the obstacle. The rotation matrix will be determined. The specific form is:

[0136]

[0137] in, It is a symbolic function.

[0138] Finally, the rotational repulsion component is calculated based on the rotation matrix, the planar position vectors of the UAV and obstacles, and the distance:

[0139]

[0140] in, For the gain of rotational repulsion, and These are drones and obstacles. Position vector on the plane.

[0141] Understandably, by introducing rotational repulsion, this embodiment can effectively prevent the UAV from experiencing local minima or oscillations when facing obstacles. This method ensures the feasibility and continuity of the obstacle avoidance path, enabling the UAV to bypass obstacles along a reasonable curved path in complex environments, improving flight safety and obstacle avoidance stability. Simultaneously, it works in conjunction with the translational repulsion component to achieve smooth and natural obstacle avoidance behavior.

[0142] S204. The translational repulsion component and the rotational repulsion component are weighted and synthesized according to a preset weighting coefficient to obtain the composite repulsion force of the target obstacle on the UAV.

[0143] It should be understood that a weighted combination of the translational repulsive force component and the rotational repulsive force component forms a composite repulsive force on the drone. Furthermore, by adjusting the ratio of the two components through weighting coefficients, a balance and flexible control of obstacle avoidance behavior can be achieved, ensuring that the drone can both quickly move away from obstacles and smoothly navigate around them in different environments.

[0144] Specifically, the calculation process for the composite repulsive force is as follows:

[0145]

[0146] in, For example, in environments with dense obstacles, it can be set to... To enhance radial action away from obstacles while maintaining flexibility in circumduction; adjustable in open environments. This increases tangential obstacle avoidance behavior, making the drone's flight smoother.

[0147] Understandably, through weighted synthesis, the generated composite repulsive force can simultaneously ensure both safety and flight smoothness: the UAV will not oscillate or stall when approaching an obstacle, but will instead smoothly circumvent it tangentially while moving radially away. This method enhances the flexibility and adaptability of local obstacle avoidance, enabling the UAV to continuously and naturally adjust its course in complex environments, achieving efficient and safe obstacle avoidance behavior, while ensuring seamless integration with the global trajectory.

[0148] Figure 3 A schematic diagram of the composite repulsive force generated by the target obstacle provided in the embodiments of this application; as shown Figure 3As shown in the diagram, the black circles represent obstacles, and the arrows surrounding the obstacles illustrate the repulsive force exerted by the obstacles on the drone. The light gray arrow to the left of the black arrow represents the rotational force component of the obstacle's force on the drone, i.e., the rotational repulsive force component. This component is oriented along the tangent of the obstacle's surface and guides the drone around the obstacle. The dark gray arrow to the right of the black arrow represents the direct repulsive force component of the obstacle's force on the drone, i.e., the horizontal repulsive force component. This component points radially away from the obstacle's center and propels the drone out of the obstacle's influence area. The black arrow represents the combined repulsive force of both components, reflecting the actual force direction experienced by the drone under the influence of the obstacle. The dashed arrow in the upper right corner of the diagram indicates the drone's motion tendency under the combined force, i.e., rotating counterclockwise around the obstacle, thus achieving a smooth obstacle avoidance flight path.

[0149] Figure 4 This is a schematic diagram illustrating the relative relationship between the UAV's heading and the obstacle's orientation, provided in an embodiment of this application; as shown. Figure 4 As shown, This is the current heading angle of the UAV on its global trajectory, which is the angle of the UAV's flight direction relative to the reference coordinate system (such as the north or the positive X-axis). The azimuth angle from the drone to the center of the obstacle is the angle of the line connecting the drone and the obstacle relative to the reference coordinate system. This is expressed as the relative angle difference between the drone and the obstacle. This reflects the positional relationship of the obstacle relative to the current flight direction of the drone. A schematic diagram of the combined repulsive force generated by the target obstacle has been provided. Figure 3 The embodiments in this application will not be described in detail here.

[0150] This diagram illustrates the spatial relationship between a drone and surrounding obstacles during flight. It allows determination of the relative angles between the drone and obstacles, enabling the calculation of the direction and magnitude of the combined repulsive force exerted by the obstacle on the drone. When the obstacle is directly in front of the drone, the combined repulsive force primarily acts radially, propelling the drone away from the obstacle. When the obstacle is to the side-front of the drone, the combined repulsive force includes both horizontal and rotational components, allowing the drone to smoothly navigate around the obstacle's edge. Using this geometric model, the drone can calculate the total combined repulsive force in real time during flight and dynamically adjust its flight attitude and path based on the direction of force composition, achieving autonomous obstacle perception and avoidance in complex environments.

[0151] Figure 5 This is a schematic diagram of the structure of the drone obstacle avoidance device provided in the embodiments of this application; as shown Figure 5 As shown, the device includes:

[0152] The first calculation module 501 is used to calculate the distance between the drone and each obstacle based on the current position of the drone and the positions of each obstacle within the preset range of action.

[0153] The first determining module 502 is used to determine, for each obstacle, if the distance is less than or equal to a preset distance threshold, that the obstacle is a target obstacle affecting the flight of the drone;

[0154] The second calculation module 503 is used to calculate the composite repulsive force generated by the target obstacle on the drone for each target obstacle, based on the distance between the target obstacle and the drone, the current position of the drone and the position of the target obstacle. The composite repulsive force includes a translational repulsive force component and a rotational repulsive force component.

[0155] The second determining module 504 calculates the total composite repulsion force corresponding to the current position of the UAV based on each composite repulsion force, and determines the flight path of the UAV based on the total composite repulsion force.

[0156] In one possible implementation, the second computing module 503 is specifically used for:

[0157] Based on the distance between the target obstacle and the drone, the repulsive potential energy term generated by the target obstacle is calculated using a preset repulsive potential function;

[0158] The negative gradient of the repulsive potential energy term is solved to obtain the translational repulsive component, which is used to push the UAV away from the obstacle area along the radial direction of the target obstacle.

[0159] Based on the relative orientation between the current position of the UAV and the position of the target obstacle, as well as the distance between the target obstacle and the UAV, the rotational repulsion component is calculated. The rotational repulsion component is used to provide tangential guiding force in the flight plane of the UAV.

[0160] The translational repulsive force component and the rotational repulsive force component are weighted and synthesized according to preset weighting coefficients to obtain the composite repulsive force of the target obstacle on the UAV.

[0161] In one possible implementation, the current position of the UAV includes the UAV's planar position vector, heading angle, and azimuth angle relative to the center of gravity of each obstacle; the position of the target obstacle includes the planar position vector of the target obstacle.

[0162] The second calculation module 503 is specifically used for:

[0163] Calculate the relative direction between the drone's current position and the target obstacle's position based on the drone's heading angle and the drone's azimuth angle relative to the center of gravity of the target obstacle;

[0164] A rotation matrix is ​​constructed based on the relative directions. The rotation repulsion component is calculated based on the rotation matrix, the UAV's planar position vector, the target obstacle's planar position vector, and the distance between the target obstacle and the UAV.

[0165] In one possible implementation, the current position of the drone also includes the position of the drone's center of mass, and the position of the obstacle also includes the position of the obstacle's center of mass;

[0166] The first calculation module 501 is specifically used for:

[0167] Calculate the Euclidean distance between the drone and each obstacle based on the drone's center of mass position and the center of mass positions of each obstacle within the preset range of action.

[0168] In one possible implementation, the second determining module 504 is specifically used for:

[0169] By vector superimposing each composite repulsive force, the total composite repulsive force corresponding to the current position of the UAV is obtained;

[0170] When the total composite repulsive force is greater than or equal to the preset repulsive force threshold, the flight path of the UAV at the next moment is determined based on the total composite repulsive force and the model predictive control algorithm.

[0171] In one possible implementation, the drone obstacle avoidance device further includes a control module for:

[0172] When the total composite repulsive force is less than the preset repulsive force threshold, the drone is controlled to fly along the initial trajectory. The initial trajectory is a time-parameterized global smooth reference trajectory generated based on the Minimum Snap algorithm, according to the flight intention path and the drone's dynamic constraints.

[0173] The drone obstacle avoidance device provided in this application embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0174] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604.

[0175] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to perform the above-described method.

[0176] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0177] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0178] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0179] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0180] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0181] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0182] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0183] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0184] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units 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 indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0185] 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.

[0186] 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.

[0187] If a function is implemented as a software functional unit and sold or used as an independent product, it 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 of 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.

[0188] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0189] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for obstacle avoidance by unmanned aerial vehicles (UAVs), characterized in that, include: Based on the current position of the drone and the positions of each obstacle within the preset effective range, calculate the distance between the drone and each obstacle; For each obstacle, if the distance is less than or equal to a preset distance threshold, the obstacle is determined to be a target obstacle affecting the flight of the UAV; For each target obstacle, based on the distance between the target obstacle and the drone, the current position of the drone, and the position of the target obstacle, a composite repulsive force generated by the target obstacle on the drone is calculated, wherein the composite repulsive force includes a translational repulsive force component and a rotational repulsive force component; Based on each of the composite repulsive forces, the total composite repulsive force corresponding to the current position of the UAV is calculated, and the flight path of the UAV is determined based on the total composite repulsive force.

2. The method according to claim 1, characterized in that, The step of calculating the combined repulsive force exerted by the target obstacle on the drone based on the distance between the target obstacle and the drone, the current position of the drone, and the position of the target obstacle includes: Based on the distance between the target obstacle and the UAV, the repulsive potential energy term generated by the target obstacle is calculated using a preset repulsive potential function; The negative gradient of the repulsive potential energy term is calculated to obtain the translational repulsive component, which is used to push the UAV away from the obstacle area along the radial direction of the target obstacle. Based on the relative direction between the current position of the UAV and the position of the target obstacle, and the distance between the target obstacle and the UAV, a rotational repulsion component is calculated. This rotational repulsion component is used to provide tangential guiding force in the flight plane of the UAV. The translational repulsive force component and the rotational repulsive force component are weighted and synthesized according to a preset weighting coefficient to obtain the composite repulsive force of the target obstacle on the UAV.

3. The method according to claim 2, characterized in that, The current position of the UAV includes the UAV's planar position vector, heading angle, and azimuth angle relative to the center of gravity of each obstacle; the position of the target obstacle includes the target obstacle's planar position vector. The step of calculating the rotational repulsion component based on the relative position of the UAV and the target obstacle, and the distance between the target obstacle and the UAV, includes: Based on the heading angle of the UAV and the azimuth angle of the UAV relative to the center of gravity of the target obstacle, calculate the relative direction between the current position of the UAV and the position of the target obstacle; A rotation matrix is ​​constructed based on the relative directions, and the rotational repulsion component is calculated based on the rotation matrix, the planar position vector of the UAV, the planar position vector of the target obstacle, and the distance between the target obstacle and the UAV.

4. The method according to claim 1, characterized in that, The current position of the drone also includes the position of the drone's center of mass, and the position of the obstacle also includes the position of the obstacle's center of mass. The step of calculating the distance between the drone and each obstacle based on the drone's current position and the positions of obstacles within a preset effective range includes: The Euclidean distance between the UAV and each obstacle is calculated based on the centroid position of the UAV and the centroid positions of each obstacle within the preset range of action.

5. The method according to any one of claims 1-4, characterized in that, The step of calculating the total composite repulsion force corresponding to the current position of the UAV based on each of the composite repulsion forces, and determining the flight path of the UAV based on the total composite repulsion force, includes: The total composite repulsive force corresponding to the current position of the UAV is obtained by vector superposition of each composite repulsive force. When the total composite repulsive force is greater than or equal to a preset repulsive force threshold, the flight path of the UAV at the next moment is determined based on the total composite repulsive force and the model predictive control algorithm.

6. The method according to claim 5, characterized in that, The method further includes: When the total composite repulsive force is less than a preset repulsive force threshold, the drone is controlled to fly along an initial trajectory. The initial trajectory is a time-parameterized global smooth reference trajectory generated based on the Minimum Snap algorithm, according to the flight intention path and the drone's dynamic constraints.

7. An obstacle avoidance device for unmanned aerial vehicles (UAVs), characterized in that, include: The first calculation module is used to calculate the distance between the drone and each obstacle based on the current position of the drone and the positions of each obstacle within the preset range of action. The first determining module is used to determine, for each obstacle, if the distance is less than or equal to a preset distance threshold, that the obstacle is a target obstacle affecting the flight of the UAV; The second calculation module is used to calculate, for each target obstacle, the composite repulsive force exerted by the target obstacle on the drone based on the distance between the target obstacle and the drone, the current position of the drone and the position of the target obstacle, wherein the composite repulsive force includes a translational repulsive force component and a rotational repulsive force component. The second determining module calculates the total composite repulsion force corresponding to the current position of the UAV based on each composite repulsion force, and determines the flight path of the UAV based on the total composite repulsion force.

8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.