Unmanned aerial vehicle path planning method and device based on improved artificial potential field method, and medium
By improving the artificial potential field method, using virtual sub-objectives and predicted potential field forces, the problems of local minimum values, unreachable targets and excessive angle angles in the traditional method are solved, and a smoother and more efficient drone path planning is achieved.
Patent Information
- Application Number
- CN202410057034.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2025-05-13
AI Technical Summary
Traditional artificial potential field method is prone to problems such as local minimum values, unreachable targets, and excessive angle angles near obstacles in drone path planning.
The improved artificial potential field method is adopted to adjust the flight path of the drone by establishing virtual sub-targets and introducing evaluation factors, combining the predicted potential field force and virtual sub-target gravity to ensure the smoothness of the path and obstacle avoidance efficiency.
It effectively avoids the problems of local minimum values and unreachable targets, reduces the drone's angle changes near obstacles, and improves the smoothness of the path and obstacle avoidance efficiency.
Smart Images

Figure CN119987386A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle obstacle avoidance, and in particular to a method, device and medium for unmanned aerial vehicle path planning based on an improved artificial potential field method. Background Art
[0002] In recent years, with the rapid development of artificial intelligence, drones have been widely used in civil and military fields. Now the flight environment faced by drones is becoming more and more complex, and the safety issues during flight are getting more and more attention. How to plan a smooth and collision-free obstacle avoidance path from the starting point to the target point is the key to solving the problem of drone safety flight. Commonly used algorithms include artificial potential field method, A* algorithm, genetic algorithm, D* algorithm, particle swarm algorithm, RRT algorithm, neural network algorithm and other methods.
[0003] The artificial potential field method was first proposed by Khatib in 1986 as a real-time obstacle avoidance method. Its basic principle is to define the location environment of the drone with a virtual potential field, and generate virtual repulsive potential field and gravitational potential field through the location information of the drone, obstacles and target points. The virtual potential field generates repulsive and gravitational forces to control the movement of the drone, so that the drone can avoid obstacles and fly to the target point. The artificial potential field method has the advantages of high real-time performance, simple algorithm formula, small calculation volume, and relatively smooth planned path, and is widely used.
[0004] However, the traditional artificial potential field method only updates the next position based on the distance between the drone and the obstacle and the target point. This calculation method is prone to problems such as local minima, unreachable targets, and excessive turning angles near obstacles. Summary of the invention
[0005] The present invention proposes a UAV path planning method, device and medium based on an improved artificial potential field method, which solves the problems in the prior art that the traditional artificial potential field method only updates the next step position according to the distance between the UAV and the obstacle and the target point, and is prone to local minima, unreachable targets and excessive turning angles near obstacles.
[0006] The technical solution of the present invention is achieved in this way:
[0007] According to one aspect of the present invention, a method for UAV path planning based on an improved artificial potential field method is provided, comprising the following steps:
[0008] S1, establish the map environment model, initialize the parameters of the prediction artificial potential field method, the initial position of the drone, the obstacle position and the target point position;
[0009] S2, connect the current position of the UAV with the position of the target point to generate an ideal path, and the target point generates gravity to pull the UAV to fly;
[0010] S3, determine whether the drone enters the predicted potential field of the obstacle, if so, jump to step S4, otherwise return to step S2;
[0011] S4, generating the optimal virtual sub-target and predicted potential field force for the obstacle ahead, canceling the gravity of the target point, and the gravity generated by the optimal virtual sub-target and the predicted potential field force jointly pull the UAV to fly;
[0012] S5, determine whether the drone has entered the influence range of the obstacle, if so, jump to step S6, otherwise return to step S4;
[0013] S6, cancel the predicted potential field force, and only the gravity generated by the optimal virtual sub-target pulls the drone to fly to the virtual sub-target;
[0014] S7, determining whether the drone has reached the position of the optimal virtual sub-target, if so, restoring the gravity of the target point, canceling the optimal virtual sub-target and its gravity, and jumping to step S8; otherwise, returning to step S6;
[0015] S8, determine whether the drone has reached the target point, if so, end the program, otherwise return to step S2.
[0016] As a preferred solution of the present invention, before step S3, it is determined whether there is an obstacle in front of the UAV that affects the flight path. If so, jump to step S3; otherwise, jump to step S8.
[0017] Furthermore, in step S2, the gravitational force generated by the target point is:
[0018] F att (goal) = k att ρ(P u , P goal )
[0019] Among them, k att is the gravitational potential field gain coefficient, P u is the position of the UAV, P goal is the target point position, ρ(P u , P goal ) is the Euclidean distance between the UAV and the target point.
[0020] Furthermore, in step S4, the method for generating the optimal virtual sub-goal is:
[0021] Let the line connecting the current position of the drone and the center of the obstacle be the straight line L1, draw a perpendicular line L2 to the straight line L1 at the center of the obstacle, draw a circle with the center of the obstacle as the origin and the safety distance as the radius, and get the two intersection points P of the perpendicular line L2 and the circle dummy_goal_1 and P dummy_goal_2 As a virtual sub-target point;
[0022] Introduce virtual sub-goal point evaluation factors to select the best virtual sub-goals;
[0023] The evaluation factor calculation formula is:
[0024]
[0025] Where n is the number of obstacles ahead; L dummy_goal is the line connecting the virtual sub-goal and the target point, (P obs_i , L dummy_goal ) is the distance from the obstacle to the straight line L dummy_goal The distance, d obs_effect is the impact distance of the obstacle, and J_fa is the evaluation factor constant. By calculating the evaluation factor of the virtual sub-target, we can get the impact of the obstacle behind the virtual sub-target on the planned path. The smaller the evaluation factor J is, the greater the impact of the obstacle on the line connecting the virtual sub-target and the target point L. dummy_goal The fewer the obstacle avoidance actions, the optimal virtual sub-goal is obtained; the two virtual sub-goal points are respectively substituted into the above evaluation factor calculation formula for calculation, and the virtual sub-goal with a smaller evaluation factor value is selected as the optimal virtual sub-goal.
[0026] Furthermore, in step S4, the predicted potential field force includes a speed prediction force and an angle prediction force. The direction of the speed prediction force is the direction of the obstacle toward the UAV. The speed prediction force will reduce the speed of the UAV approaching the obstacle, so that the UAV avoids the obstacle at a lower speed, and its flight track tends to be flatter; the direction of the angle prediction force is the direction of the virtual sub-target toward the obstacle. The angle prediction force enables the UAV to adjust the angle before reaching the obstacle, avoiding abrupt changes in the angle of the UAV due to sudden changes in force, thereby improving the smoothness of the UAV's obstacle avoidance.
[0027] The calculation formula of speed prediction ability is:
[0028]
[0029] Among them, k pre d is the velocity prediction coefficient of the predicted potential field, θ aver is the average of the tangent angles between the drone and the obstacle, δ is the current flight angle of the drone, and θ x is the boundary angle of the drone escaping from the obstacle. According to the formula, the closer the current angle of the drone is to the center of the obstacle, the greater the collision probability of the drone, and the greater the value of the speed prediction force, which causes the drone speed to drop. The speed prediction force is used to reduce the speed of the drone and thus perform low-speed obstacle avoidance.
[0030] The calculation formula of the angle prediction force is:
[0031]
[0032] Among them, k pred_ang is the angular prediction coefficient of the predicted potential field, P u is the position of the UAV, P dummy is the position of the optimal virtual sub-goal, d(P u ,P dummy ) is the distance between the UAV and the virtual sub-target, d safe For a safe distance.
[0033] Furthermore, in step S4, the gravitational force generated by the optimal virtual sub-goal is:
[0034]
[0035] Among them, ρ(P s , P goal ) is the Euclidean distance between the initial position of the UAV and the target point, ρ(P cur_uav , P goal ) is the Euclidean distance between the current position of the drone and the target point, k eff_att is the gravity coefficient of the virtual sub-target.
[0036] Furthermore, in step S6, the influence exerted on the UAV within the influence range of the obstacle is:
[0037] F att (dummy) = k dummy_att ρ(P u , P dummy )
[0038] Among them, k dummy_att is the influence coefficient of the optimal virtual sub-goal, ρ(P u , P dumony ) is the distance between the UAV and the optimal virtual sub-target.
[0039] The path navigation of UAV based on the traditional artificial potential field method has the problem of sudden changes in track angle, which does not meet the track requirements of UAV in practice. The turning angle of the UAV at the next moment may exceed the rotational inertia limit of the UAV dynamics after being calculated by the algorithm. In order to prevent sudden angle changes during the flight of the UAV at each moment, the turning angle of the UAV must be limited. In the present invention, an angle constraint is introduced to limit the turning angle of the UAV during the flight of the UAV. The angle constraint of the UAV can reduce the jitter and sudden turning angle of the UAV, so that the path is close to smooth. The specific method is as follows:
[0040] Calculate the actual turning angle change of the drone as:
[0041] Δθ compute =θ t+1 -θ t
[0042] Among them, θ t+1 is the steering angle of the drone at the next moment, θ t is the angle of the drone at the current moment, then the actual turning angle of the drone at the next moment is:
[0043]
[0044] Δθ ideal It is the maximum ideal turning angle of the drone.
[0045] According to another aspect of the present invention, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned planning method when executing the computer program.
[0046] According to another aspect of the present invention, there is provided a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned planning method are implemented.
[0047] Beneficial Effects
[0048] Compared with the prior art, the beneficial effects of the present invention are:
[0049] (1) The present invention adopts a virtual sub-target establishment method and adds evaluation factors to set evaluations for virtual sub-target points, fully considers the position information of obstacles in the path, and selects virtual sub-target points with the best evaluation factors; this enables the drone to avoid the local minimum area early and perform the least obstacle avoidance actions, thus reducing unnecessary time consumption and resource waste;
[0050] (2) In order to solve the problem of sudden angle changes caused by sudden force when a UAV encounters an obstacle, the present invention combines the influence of the predicted potential field with the virtual sub-target to tow the UAV to the virtual sub-target. The speed and angle of the UAV are adjusted in advance through the predicted potential field, making the flight path and angle of the UAV smoother. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 It is a flow chart of the UAV path planning method based on the improved artificial potential field method of the present invention;
[0053] Figure 2 A schematic diagram of setting a virtual sub-target in an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of predicting potential field force in an embodiment of the present invention;
[0055] Figure 4 Schematic diagram of the influence range and predicted potential field range around an obstacle in an embodiment of the present invention;
[0056] Figure 5 A comparison diagram of the planning paths of the improved artificial potential field method and the traditional artificial potential field method in the embodiment of the present invention;
[0057] Figure 6 A comparison diagram of the heading angles of the paths planned by the improved artificial potential field method and the traditional artificial potential field method in an embodiment of the present invention;
[0058] Figure 7 A schematic diagram of a planning path for obstacle avoidance in a complex area using an improved artificial potential field method according to an embodiment of the present invention;
[0059] Figure 8 Schematic diagram of the heading angle of the improved artificial potential field method for obstacle avoidance in complex areas in an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] Reference Figure 1 As shown, this embodiment provides a UAV path planning method based on an improved artificial potential field method, comprising the following steps:
[0062] Step S1, establish a map environment model, initialize the parameters of the artificial potential field prediction method, the initial position of the drone, the obstacle position and the target point position, specifically including:
[0063] Set the initial position of the drone X0 = (-1, -1), the target point position Xg = (12, 12), and the safe distance d between the drone and the obstacle safe = 1.3 times the obstacle radius; the predicted distance d of the drone to the obstacle pre = 4 times the obstacle radius; angle limit value Δθ ideal =5°, predicted potential field coefficient k pred , k pred_ang, set the value of the evaluation factor constant J_fa; initialize the gravitational field parameters, repulsive field parameters and number of iterations of the prediction artificial potential field method.
[0064] Step S2, connect the current position of the drone with the position of the target point to generate an ideal path, and the gravity generated by the target point pulls the drone to fly. The gravity generated by the target point is:
[0065] F att (goal) = k att ρ(P u , P goal )
[0066] Among them, katt is the gravitational potential field gain coefficient, P u is the position of the UAV, P goal is the target point position, ρ(P u , P goal ) is the Euclidean distance between the UAV and the target point.
[0067] Determine whether there is an obstacle in front of the drone that affects the flight path. If so, jump to step S3; otherwise, jump to step S8.
[0068] Step S3, determine whether the drone has entered the predicted potential field of the obstacle (if the distance between the drone and the obstacle is less than 4 times the radius of the obstacle, it indicates that the drone has entered the predicted potential field of the obstacle). If it has entered, jump to step S4, otherwise return to step S2;
[0069] Step S4, generating an optimal virtual sub-target and predicted potential field force for the obstacle ahead, canceling the gravitational force of the target point, and using the gravitational force generated by the optimal virtual sub-target and the predicted potential field force to pull the drone to fly;
[0070] In the specific implementation process, the method of generating the optimal virtual sub-goal is:
[0071] like Figure 2 As shown, the line connecting the current position of the drone and the center of the obstacle is called straight line L1, and a perpendicular line L2 is drawn to the straight line L1 at the center of the obstacle. A circle is drawn with the center of the obstacle as the origin and the safety distance as the radius, and the two intersection points P of the perpendicular line L2 and the circle are obtained. dummy_goal_1 and P dummy_goal_1 As a virtual sub-target point;
[0072] Introduce virtual sub-goal point evaluation factors to select the best virtual sub-goals;
[0073] The evaluation factor calculation formula is:
[0074]
[0075] Where n is the number of obstacles ahead; Ldummy_goal Connect the virtual sub-target and the target point; (P obs_i , L dummy_goal ) is the distance from the obstacle to the straight line L dummy_goal Distance; d obs_effect is the impact distance of the obstacle; J_fa is the evaluation factor constant, and in this embodiment, the evaluation factor constant is taken as 0.5; by calculating the evaluation factor of the virtual sub-target, the impact of the obstacle behind the virtual sub-target position on the planned path can be obtained. The smaller the evaluation factor J, the greater the impact of the obstacle on the line connecting the virtual sub-target and the target point L. dummy_goal The fewer the obstacle avoidance actions, the optimal virtual sub-goal is obtained; the two virtual sub-goal points are respectively substituted into the above evaluation factor calculation formula for calculation, and the virtual sub-goal with a smaller evaluation factor value is selected as the optimal virtual sub-goal.
[0076] In the specific implementation process, Figure 3 As shown, the predicted potential field force includes speed prediction force and angle prediction force. The direction of the speed prediction force is the direction of the obstacle toward the UAV. The speed prediction force will reduce the speed of the UAV approaching the obstacle, so that the UAV avoids the obstacle at a lower speed, and its flight track tends to be flatter; the direction of the angle prediction force is the direction of the virtual sub-target toward the obstacle. The angle prediction force enables the UAV to adjust the angle before reaching the obstacle, avoiding abrupt changes in the angle of the UAV due to sudden changes in force, thereby improving the smoothness of the UAV's obstacle avoidance.
[0077] The calculation formula of speed prediction ability is:
[0078]
[0079]
[0080]
[0081] Among them, k pred is the velocity prediction coefficient for the predicted potential field. In this embodiment, the velocity prediction coefficient is 1.57; θ aver is the average of the tangent angles θ1 and θ2 between the drone and the obstacle, δ is the current flight angle of the drone, and θ x is the angle at which the drone escapes from the obstacle boundary. According to the formula, the size of the speed prediction force is determined by the angle between the drone and the obstacle. The closer the current angle of the drone is to the center of the obstacle, the greater the probability of the drone's collision, and the greater the value of the speed prediction force, causing the drone's speed to drop. The speed prediction force is used to reduce the drone's speed and thus perform low-speed obstacle avoidance.
[0082] The calculation formula of the angle prediction force is:
[0083]
[0084] Among them, k pred_ang is the angle prediction coefficient of the predicted potential field. In this embodiment, the angle prediction coefficient is 1.57; u is the position of the UAV, P dummy is the position of the optimal virtual sub-goal, d(P u , P dummy ) is the distance between the UAV and the virtual sub-target, d safe For a safe distance.
[0085] The angle calculation formula of the angle prediction force is as follows:
[0086]
[0087] Among them, θ dummy is the angle of the virtual sub-target.
[0088] In the specific implementation process, the gravitational force generated by the optimal virtual sub-goal is:
[0089]
[0090] Among them, ρ(P s , P goal ) is the Euclidean distance between the initial position of the UAV and the target point, ρ(P cur_uav , P goal ) is the Euclidean distance between the current position of the drone and the target point, k eff_att is the gravity coefficient of the virtual sub-target. In this embodiment, the gravity coefficient of the virtual sub-target is 30.
[0091] After the optimal virtual sub-target is selected, the obstacle prediction potential field starts to generate prediction force to intervene in the flight path of the drone, calculate the current flight angle δ of the drone, calculate the angles θ1 and θ2 between the current position of the drone and the two tangents of the obstacle, and calculate the angle θ between the drone and the obstacle. aver , calculate the distance ρ(P u , P obs ), determine the tangent angle between the drone and the obstacle and the current angle of the drone, and determine the boundary angle θ for the drone to escape from the obstacle X , and then use the combined force of the speed prediction force, angle prediction force of the predicted potential field and the gravity generated by the virtual sub-target to pull the drone to the virtual sub-target.
[0092] From the above formula, the resultant force of the gravitational force and the predicted potential field force generated by the optimal virtual sub-target is:
[0093] F all =F att (dummy_goal)+Fpre_v +F pre_ang .
[0094] Step S5, determine whether the drone has entered the influence range of the obstacle (if the distance between the drone and the obstacle is less than 1.4 times the radius of the obstacle, it indicates that the drone has entered the influence range of the obstacle). If it has entered, jump to step S6, otherwise return to step S4; the predicted potential field range and influence range of the obstacle are as follows Figure 4 shown.
[0095] Step S6, canceling the predicted potential field force, and only using the gravity generated by the optimal virtual sub-target to pull the drone to fly to the virtual sub-target;
[0096] The influence field function within the influence range of the obstacle is:
[0097]
[0098] Among them, k dummy_att is the virtual sub-goal influence coefficient, ρ(P u , P dummy ) is the distance between the UAV and the optimal virtual sub-target;
[0099] When the drone enters the influence range of the obstacle, the prediction potential field fails, and the distance between the drone and the obstacle, the distance between the drone and the virtual sub-target, and the angle between the drone and the obstacle are calculated. The gravitational force on the drone from the virtual sub-target point is calculated and multiplied by the angle between the drone and the obstacle to obtain the force on the drone on the X and Y axes;
[0100] Then the influence of the UAV within the influence range of the obstacle is:
[0101] F att (aummy) = k dummy_att ρ(P u , P dummy )
[0102] F att_X (aummy)=F att (dummy)*θ dummy_x
[0103] F att_Y (dummy)=F att (dummy)*θ dummy_y
[0104]
[0105]
[0106] Among them, F att(dummy) is the influence of the UAV within the influence range of the obstacle; k dummy_att is the influence coefficient of the optimal virtual sub-goal, which is 1.8 in this embodiment; θ dummy_x and θ dummy_y F att (dummy) Angle decomposed in the X and Y directions; and is the distance between the UAV and the obstacle in the X and Y directions; ρ(P u , P obs ) is the Euclidean distance between the drone and the obstacle; F att_X (dummy) and F att_Y (dummy) is F att (dummy) decomposes the influence in the X and Y directions.
[0107] Step S7, determining whether the drone has reached the position of the optimal virtual sub-target, if so, restoring the gravity of the target point, canceling the optimal virtual sub-target and its gravity, and jumping to step S8; otherwise, returning to step S6;
[0108] Step S8, determine whether the drone has reached the target point, if so, end the program, otherwise return to step S2.
[0109] The path navigation of UAV based on the traditional artificial potential field method has the problem of sudden changes in track angle, which does not meet the track requirements of UAV in practice. The turning angle of the UAV at the next moment may exceed the rotational inertia limit of the UAV dynamics after being calculated by the algorithm. In order to prevent sudden angle changes during the flight of the UAV at each moment, the turning angle of the UAV must be limited. In the present invention, an angle constraint is introduced to limit the turning angle of the UAV during the flight of the UAV. The angle constraint of the UAV can reduce the jitter and sudden turning angle of the UAV, so that the path is close to smooth. The specific method is as follows:
[0110] Calculate the actual turning angle change of the drone as:
[0111] Δθ compute =θ t+1 -θ t
[0112] Among them, θ t+1 is the steering angle of the drone at the next moment, θ i is the angle of the drone at the current moment, then the actual turning angle of the drone at the next moment is:
[0113]
[0114] Δθ ideal It is the maximum ideal turning angle of the drone.
[0115] The present invention sets a prediction potential field, adjusts the heading angle of the UAV in advance through the prediction force and the gravity of the virtual sub-target; avoids the UAV from falling into the local minimum by introducing the virtual sub-target evaluation factor; guides the UAV to fly from the obstacle influence range to the virtual sub-target by increasing the virtual sub-target influence potential field; and adds angle restrictions during the flight of the UAV to reduce the turning cost of the UAV.
[0116] The comparison of the path planning based on the improved artificial potential field method (PIAPF) and the traditional artificial potential field method (IAPF) is shown in the figure Figure 5 As shown, from Figure 5 It can be seen from the figure that the path planned by the improved prediction artificial potential field method of the present invention is smoother and there is no minimum value.
[0117] The comparison of the heading angles of the paths planned by the improved artificial potential field method (PIAPF) and the traditional artificial potential field method (IAPF) is shown in the figure below. Figure 6 As shown, from Figure 6 It can be seen that the path planned by the improved predicted artificial potential field method of the present invention does not have a large track angle mutation, and the angle constraint can make the path of the UAV during flight smoother.
[0118] Figure 7 The figure shows the path planned when the improved artificial potential field prediction method of the present invention is applied to a complex obstacle environment. Figure 8 The schematic diagram of the change of the heading angle of the UAV on the path when the improved artificial potential field prediction method of the present invention is applied to a complex obstacle environment is shown. Figure 7 , 8 It can be seen from the figure that in a complex obstacle environment, the improved prediction artificial potential field method of the present invention can also plan a smoother path, the heading angle changes less, and there is no problem of sudden change in navigation direction.
[0119] This embodiment further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned planning method when executing the computer program.
[0120] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned planning method are implemented.
[0121] accomplish Figure 1The computer program of the method shown can be stored on one or more computer readable media. The computer readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0122] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0123] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0124] In summary, the present invention can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that general data processing devices such as microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0125] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the present invention is not inherently related to any specific computer, virtual device or electronic device, and various general devices can also implement the present invention. The above description is only a specific 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 in the protection scope of the present invention.
Claims
1. A UAV path planning method based on an improved artificial potential field method, characterized in that: The following steps are involved: S1, establish the map environment model, initialize the parameters of the prediction artificial potential field method, the initial position of the drone, the obstacle position and the target point position; S2, connect the current position of the UAV with the position of the target point to generate an ideal path, and the target point generates gravity to pull the UAV to fly; S3, determine whether the drone enters the predicted potential field of the obstacle, if so, jump to step S4, otherwise return to step S2; S4, generating the optimal virtual sub-target and predicted potential field force for the obstacle ahead, canceling the gravity of the target point, and the gravity generated by the optimal virtual sub-target and the predicted potential field force jointly pull the UAV to fly; S5, determine whether the drone has entered the influence range of the obstacle, if so, jump to step S6, otherwise return to step S4; S6, cancel the predicted potential field force, and only the gravity generated by the optimal virtual sub-target pulls the drone to fly to the virtual sub-target; S7, determining whether the drone has reached the position of the optimal virtual sub-target, if so, restoring the gravity of the target point, canceling the optimal virtual sub-target and its gravity, and jumping to step S8; otherwise, returning to step S6; S8, determine whether the drone has reached the target point, if so, end the program, otherwise return to step S2.
2. A UAV path planning method based on improved artificial potential field method as claimed in claim 1, characterized in that: Before step S3, determine whether there is an obstacle in front of the drone that affects the flight path. If so, jump to step S3; otherwise, jump to step S8.
3. The UAV path planning method based on the improved artificial potential field method as claimed in claim 1, characterized in that: In step S2, the gravitational force generated by the target point is: F att (goal)=k att ρ(P u ,P goal ) Among them, k att is the gravitational potential field gain coefficient, P u is the position of the UAV, P goal is the target point position, ρ(P u , P goal ) is the Euclidean distance between the UAV and the target point.
4. The UAV path planning method based on the improved artificial potential field method as claimed in claim 1, characterized in that: In step S4, the method for generating the optimal virtual sub-goal is: Let the line connecting the current position of the drone and the center of the obstacle be the straight line L1, draw a perpendicular line L2 to the straight line L1 at the center of the obstacle, draw a circle with the center of the obstacle as the origin and the safety distance as the radius, and get the two intersection points P of the perpendicular line L2 and the circle dummy_goal_1 and P dummy_goal_2 As a virtual sub-target point; Introduce virtual sub-goal point evaluation factors to select the best virtual sub-goals; The evaluation factor calculation formula is: Where n is the number of obstacles ahead; L dummy_goal is the line connecting the virtual sub-goal and the target point, (P obs_i , L dummy_goal ) is the distance from the obstacle to the straight line L dummy_goal The distance, d obs_effect is the impact distance of the obstacle, J_fa is the evaluation factor constant; Substitute the two virtual sub-target points into the above evaluation factor calculation formula for calculation, and select the virtual sub-target with the smaller evaluation factor value as the optimal virtual sub-target.
5. The UAV path planning method based on the improved artificial potential field method as claimed in claim 1, characterized in that: In step S4, the predicted potential field force includes a speed prediction force and an angle prediction force, the direction of the speed prediction force is the direction of the obstacle toward the drone, and the direction of the angle prediction force is the direction of the virtual sub-target toward the obstacle; The calculation formula of speed prediction ability is: Among them, k pred is the velocity prediction coefficient for the predicted potential field, θ aver is the average of the tangent angles between the drone and the obstacle, δ is the current flight angle of the drone, and θ X The angle at which the drone escapes from obstacles; The calculation formula of the angle prediction force is: Among them, k pred_ang is the angular prediction coefficient of the predicted potential field, P u is the position of the UAV, P dummy is the position of the optimal virtual sub-goal, d(P u , P dummy ) is the distance between the UAV and the virtual sub-target, d safe For a safe distance.
6. A method for unmanned aerial vehicle path planning based on improved artificial potential field method as claimed in claim 1, characterized in that: In step S4, the gravitational force generated by the optimal virtual sub-goal is: Among them, ρ(P s , P goal ) is the Euclidean distance between the initial position of the UAV and the target point, ρ(P cur_uav , P goal ) is the Euclidean distance between the current position of the drone and the target point, k eff_att is the gravity coefficient of the virtual sub-target.
7. The UAV path planning method based on the improved artificial potential field method as claimed in claim 1, characterized in that: In step S6, the influence of the obstacle on the drone is: F att (dummy)=k dummy_att ρ(P u ,P dummy ) Among them, k dummy_att is the influence coefficient of the optimal virtual sub-goal, ρ(P u , P dummy ) is the distance between the UAV and the optimal virtual sub-target.
8. The UAV path planning method based on the improved artificial potential field method as claimed in claim 1, characterized in that: During the flight of the drone, angle constraints are introduced to limit the turning angle of the drone. The specific methods are as follows: Calculate the actual turning angle change of the drone as: Dth compute =θ t+1 -θ t Among them, θ t+1 is the steering angle of the drone at the next moment, θ t is the angle of the drone at the current moment, then the actual turning angle of the drone at the next moment is: Δθ ideal It is the maximum ideal turning angle of the drone.
9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.