Unmanned vehicle path planning method based on artificial potential field method
Technical Field
The invention relates to the technical field of intelligent automobiles, in particular to an unmanned vehicle path planning method based on an artificial potential field method.
Background
The path planning is a core technology in the field of unmanned vehicle research, and means that an unmanned vehicle plans a collision-free path from a starting point to a target point according to running environment information detected by various sensors, so that the optimization of the path is realized. The path planning mainly comprises two steps: firstly, an environment map containing obstacle areas and free areas is established, and secondly, a proper path searching algorithm is selected from the environment map, and feasible paths are quickly searched in real time. The path planning result plays a navigation role in vehicle driving. It guides the vehicle to travel from the current position to the target position. At present, a plurality of path planning algorithms are applied in unmanned driving, such as a genetic algorithm, a particle swarm algorithm, an A-star algorithm, an RRT algorithm, an artificial potential field algorithm and the like. The artificial potential field method has the advantages of small calculated amount, smooth planned path, convenience in real-time control and the like, and is widely applied to robot navigation and collision avoidance.
The artificial potential field method was proposed by Khatib in 1986. The basic idea is that a virtual potential field force exists in a driving road of an automobile, a target point generates attraction force on a host vehicle, an obstacle generates repulsion force on the host vehicle, and the host vehicle moves from a high potential field to a low potential field under the control of the resultant force of the attraction force and the repulsion force and finally reaches a target position.
However, the conventional artificial potential field method still has disadvantages that when the magnitude of repulsive force and attractive force borne by the vehicle is equal and the direction of the repulsive force and the attractive force are opposite in the advancing process, the resultant force borne by the vehicle in the artificial potential field is zero, and the vehicle falls into a local optimal solution, so that the vehicle cannot reach a target point. When an obstacle exists near the target point, as the unmanned vehicle continuously approaches the target point, the repulsive force of the obstacle to the vehicle is far greater than the attractive force of the target point to the vehicle, so that the vehicle wanders near the target point, and the problem that the target cannot reach occurs.
Therefore, the traditional artificial potential field method has the problems that the traditional artificial potential field method is easy to fall into local minimum points and targets, and in order to solve the problems, corresponding improvement research is carried out on the traditional artificial potential field method by domestic and foreign scholars: one is that the method of adding the distance between the automobile and the target point in the repulsion field function of the artificial potential field method makes the repulsion and the attraction zero at the same time only when the automobile reaches the target point, and the improved artificial potential field method can plan a safe obstacle avoidance path for the automobile in a static environment; secondly, a middle target point selected on one side of the obstacle is used for replacing a real target point to guide the robot, so that the robot gets rid of local minimum points; thirdly, the defect that a local optimal solution is easily formed by a traditional artificial potential field method is made up by respectively introducing an RRT algorithm; establishing a virtual local target point and establishing an improved path planning model respectively by introducing a repulsion coefficient, an adjustment factor and a road boundary repulsion field model so as to effectively realize the collision avoidance local path of the intelligent vehicle; fifthly, by optimizing the attraction force field and the repulsion force field and providing a potential field filling strategy, the mobile robot can find a better and collision-free target path. However, the above improvements still have the problem of not being normally reached.
Disclosure of Invention
the invention aims to provide a method for planning a path of an unmanned vehicle based on an artificial potential field method, aiming at solving the problems that the unmanned vehicle is easy to fall into a local minimum point and a target is inaccessible.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows: an unmanned vehicle path planning method based on an artificial potential field method comprises the following steps:
1) The method comprises the steps of constructing a two-dimensional space model for the unmanned vehicle to run, positioning coordinates of a starting point, an obstacle and a target point of the unmanned vehicle in the two-dimensional space model, determining the number n of the obstacles, and determining the running step length l of the unmanned vehicle;
2) establishing a virtual potential field formed by superposing a repulsive force field generated by the obstacle on the unmanned vehicle and a gravitational field generated by the target point on the vehicle, wherein acting force generated by the virtual potential field on the unmanned vehicle guides the unmanned vehicle to move towards the target;
3) enabling the unmanned vehicle to run for a unit step length l, judging whether the unmanned vehicle falls into a local minimum point, if so, calling a step 4), and if not, performing a step 5);
4) changing the component of the repulsive force on the X axis and then returning to the step 2) to start again;
5) Judging whether the unmanned vehicle travels to the influence distance near the target point to cause the unreachable target, if so, calling the step 6), and if not, carrying out the step 7);
6) introducing a safety distance rho in a repulsive force potential field functionsand the distance rho between the unmanned vehicle and the target pointtThen returning to the step (2) to restart;
7) And (4) judging whether the unmanned vehicle reaches the target point, if so, stopping path planning and drawing a path, and if not, returning to the step (2) to restart.
As a modified mode, in step 4), the coefficient of variation added by the repulsive force on the X axis is k, and the component of the repulsive force on the X axis is:
,,Frep(X) is the resultant force of the originally applied repulsive force, rho (X, X)o) Is the distance between the controlled object and the obstacle, poIs the maximum impact distance of the obstacle;
The variable coefficient of the repulsion force added on the Y axis is delta, and the component of the repulsion force field on the Y axis is as follows:
As a refinement, in step 6),
the repulsive force potential field function is:
where X ═ (X, y) is the current position coordinates of the unmanned vehicle, Xo=(xo,yo) Is the obstacle coordinate, ρ (X, X)o) Is the distance between the controlled object and the obstacle, pois the maximum influence distance of the obstacle, psfor a safe distance, ρtThe distance between the unmanned vehicle and a target point is determined, gamma is a repulsion gain coefficient corresponding to the safe distance, and beta is the repulsion gain coefficient when the safe distance is not considered to be added.
Wherein, Frep1And Frep3From the obstacle to the unmanned vehicle, Frep2And Frep4Is directed from the unmanned vehicle to a target point,
When rho (X, X)o)≤ρswhen the temperature of the water is higher than the set temperature,
when rho (X, X)o)≤ρoAnd ρ (X, X)o)>ρsWhen the temperature of the water is higher than the set temperature,
as a modified mode, in step 2), the gravitational field function is;
Wherein α is a gravity gain coefficient, and the gravity function is:
as an improvement, the two-dimensional space model is an environment map including an obstacle area and a free area.
As an improvement, the coordinates of the target point are Xt=(xt,yt) Distance ρ between the controlled object and the target pointtIs composed of
due to the adoption of the technical scheme, the invention has the following beneficial effects:
1. the method is mainly improved aiming at the defects of the traditional manual potential field method, when the unmanned vehicle falls into the local minimum value point in the driving process, the direction of repulsion force is changed by adding a variable coefficient to the component of the repulsion force function, so that the direction of resultant force is changed, the unmanned vehicle jumps out of the local minimum value point, and the unmanned vehicle continues to move towards a target point.
2. when the target can not be reached due to the fact that the unmanned vehicle runs to the influence distance range of the obstacle nearby the target point, a new repulsion function is provided by adding the distance between the unmanned vehicle and the target point, and safety in the running process of the unmanned vehicle is guaranteed by adding the safety distance.
3. According to the method and the device, the distance factor between the target point and the vehicle is introduced into the repulsion function, and the safety distance is added in the influence range of the obstacle, so that the repulsion received when the vehicle runs to the safety distance of the obstacle is larger than the repulsion before the safety distance is not added, and the safety of the vehicle in the running process is guaranteed.
Since the variable coefficient added by the repulsive force on the X axis in step 4) is k, the component of the repulsive force on the X axis is:
The variable coefficient of the repulsion force added on the Y axis is delta, and the component of the repulsion force field on the Y axis is as follows:
When the resultant force is zero, a local minimum value point is easy to appear, and the vehicle can move back and forth, so that the components of the repulsive force on the X axis and the Y axis are respectively improved, the resultant force is larger than zero to avoid the situations, and the vehicle can smoothly reach the target position.
In step 6), the repulsive potential field function is as follows:
Where X ═ (X, y) is the current position coordinates of the unmanned vehicle, Xo=(xo,yo) Is the obstacle coordinate, ρ (X, X)o) Is the distance between the controlled object and the obstacle, poIs the maximum influence distance of the obstacle, psfor a safe distance, ρtThe distance between the unmanned vehicle and a target point is determined, gamma is a repulsion gain coefficient corresponding to a safe distance, beta is a repulsion gain coefficient when the safe distance is not considered to be added, when the vehicle runs to the influence range of an obstacle nearby the target point, the repulsion is possibly greater than the attraction, so that the vehicle wanders nearby the target point, and no repulsion existsThe method stops the motion. Therefore, a distance factor between the target point and the vehicle is introduced into the repulsion function, and the safety distance is added in the influence range of the obstacle, so that the repulsion received when the vehicle runs to the safety distance of the obstacle is larger than the repulsion before the safety distance is not added, and the safety of the vehicle in the running process is guaranteed.
Drawings
FIG. 1 is a perspective view of an improved repulsive force field strength;
FIG. 2 is a perspective view of improved repulsive force field strength;
FIG. 3 is a side view of improved repulsive force field strength;
FIG. 4 is a side view of the improved repulsive force field strength;
FIG. 5 is a plan view of the total potential field strength before modification;
FIG. 6 is a plan view of the total potential field strength after refinement;
FIG. 7 is a side view of total potential field strength before improvement;
FIG. 8 is a side view of the total potential field strength after modification;
FIG. 9 is a state diagram of the vehicle falling into a local minimum point;
FIG. 10 is a diagram of a vehicle in a target unreachable state;
FIG. 11 is a diagram of a vehicle trip-out local minimum point path;
FIG. 12 is a path diagram of a vehicle target reachable;
Fig. 13 is a diagram comparing the target reachable paths of the conventional method and the improved method.
Detailed Description
The invention discloses an unmanned vehicle path planning method based on an artificial potential field method, which comprises the following steps of:
1) Constructing a two-dimensional space model for the unmanned vehicle to run, wherein the two-dimensional space model is an environment map comprising obstacle areas and free areas, determining the number n of obstacles, and positioning coordinates of a starting point, the obstacles and a target point of the unmanned vehicle in the two-dimensional space model, wherein the coordinate of the target point is Xt=(xt,yt) The controlled object (i.e. the unmanned vehicle) arrives at the targetDistance rho between punctuationtcomprises the following steps:And determining the running step length l of the unmanned vehicle.
2) establishing a virtual potential field formed by superposing a repulsive force field generated by the obstacle to the unmanned vehicle and a gravitational field generated by the target point to the vehicle, wherein the gravitational field function is as follows;Alpha is a gravity gain coefficient, and the gravity function is as follows:The forces generated by the virtual potential field on the unmanned vehicle direct the unmanned vehicle to travel toward the target.
3) And (3) the unmanned vehicle runs for a unit step length l, then whether the unmanned vehicle falls into a local minimum value point is judged, if yes, the step 4) is called, and if not, the step 5) is carried out.
4) And returning to the step 2) to restart after changing the component of the repulsive force on the X axis, wherein the specific change formula is as follows:
The coefficient of variation of the added repulsion force on the X axis is k, and the component of the repulsion force on the X axis is:
,,Frep(X) is the resultant force of the originally applied repulsive force, rho (X, X)o) Is the distance between the controlled object and the obstacle, pois the maximum impact distance of the obstacle;
The coefficient of variation of the added repulsion force on the Y axis is delta, and the component of the repulsion force field on the Y axis is as follows:
when the resultant force is zero, a local minimum value point is easy to appear, and the vehicle can move back and forth, so that the components of the repulsive force on the X axis and the Y axis are improved, the resultant force is larger than zero to avoid the situations, and the vehicle can smoothly reach the target position.
5) judging whether the unmanned vehicle travels to the influence distance near the target point to cause the unreachable target, if so, calling the step 6), and if not, carrying out the step 7);
6) Introducing a safety distance rho in a repulsive force potential field functionsAnd the distance rho between the unmanned vehicle and the target pointtthe resulting repulsive force potential field function is:
Where X ═ (X, y) is the current position coordinates of the unmanned vehicle, Xo=(xo,yo) Is the obstacle coordinate, ρ (X, X)o) Is the distance between the controlled object and the obstacle, poIs the maximum influence distance of the obstacle, psFor a safe distance, ρtAnd (2) returning to the step (2) to restart (when the vehicle runs to the influence range of the obstacle nearby the target point, the repulsive force is possibly greater than the attractive force, so that the vehicle wanders nearby the target point and cannot stop moving).
7) and (4) judging whether the unmanned vehicle reaches the target point, if so, stopping path planning and drawing a path, and if not, returning to the step (2) to restart.
wherein, in the step 6): the repulsion function is:
wherein, Frep1And Frep3From the obstacle to the unmanned vehicle, Frep2and Frep4Is directed from the unmanned vehicle to a target point,
When rho (X, X)o)≤ρsWhen the temperature of the water is higher than the set temperature,
when rho (X, X)o)≤ρoAnd ρ (X, X)o)>ρswhen the temperature of the water is higher than the set temperature,
fig. 1 and 2 are perspective views of repulsive potential energy intensity before and after a safety distance is added, respectively, fig. 3 and 4 are side views of repulsive potential energy intensity before and after the safety distance is added, it can be seen from the side views that a driving space of the unmanned vehicle is a horizontal axis of the side views, position coordinates of an obstacle are (1.5, 1), (5, 6), (9, 5,5), respectively, position coordinates of a target point are (10,10), and a vertical axis represents repulsive potential energy value. It can be seen that the improved repulsive potential energy value is increased in the vicinity of the obstacle, thereby improving the safety of the vehicle running.
fig. 5 and 6 are plan views of total potential energy before and after the addition of the safety distance, respectively, when the horizontal axis is the Y-axis, and it can also be seen that the repulsive potential energy value after the improvement is increased in the vicinity of the obstacle.
Fig. 7 and 8 are side views of total potential energy before and after increasing the safety distance, respectively, and it can be seen that the potential energy of the target point before and after improvement is zero, the potential energy near the obstacle has a sudden change, and when the unmanned vehicle reaches the vicinity of the target point, the potential energy value is reduced, thereby also avoiding the situation that the potential energy when the unmanned vehicle reaches the target point is not zero.
In order to verify the effect of the unmanned vehicle path planning method based on the artificial potential field method, the design experiment carries out simulation analysis on the unmanned vehicle path planning method, and the experimental steps of improving the artificial potential field algorithm are as follows:
(1) Constructing the running space of the unmanned vehicle, determining the positions of the starting point and the target point of the unmanned vehicle, the gain coefficients alpha and beta of the attraction and the repulsion, the number n of the obstacles and the influence distance rho of the obstaclesosafe distance ρsAnd the running step length l of the unmanned vehicle.
(2) And establishing a virtual potential field and respectively calculating the sizes of the attractive force and the repulsive force.
(3) And calculating the magnitude of the resultant force.
(4) And (5) judging whether the unmanned vehicle falls into a local minimum value point or not after moving to the next position, if so, calling the step (5), and otherwise, carrying out the step (6).
(5) and (3) returning to the step (2) to restart after changing the component of the repulsive force on the X axis.
(6) and (4) whether the unmanned vehicle travels to the influence distance near the target point to cause the target to be unreachable, if so, calling the step (7), and otherwise, performing the step (8).
(7) And (3) adding the safe distance and the distance between the unmanned vehicle and the target point into the repulsion function, and returning to the step (2) to restart.
(8) And (3) whether the unmanned vehicle reaches the target point, if so, stopping path planning and drawing a path, and otherwise, returning to the step (2) to restart.
And respectively carrying out simulation experiments on the artificial potential field methods before and after the improvement on a Matlab simulation platform according to the experimental steps. The method comprises the steps of selecting a gravitational gain coefficient of 15, a repulsive gain coefficient of 4, an obstacle influence distance of 2.5, a safety distance of 1, a driving step length of the unmanned vehicle of 0.2, the maximum iteration number of 600, coordinates of a starting point position of the unmanned vehicle of (0,0), coordinates of a target point position of (10,10), and selecting an optimal value according to repeated experiments.
Firstly, only the traditional artificial potential field method is used for simulation. When the unmanned vehicle, the obstacle and the target point are on the same straight line, the attraction force applied to the unmanned vehicle while approaching the target point is gradually reduced, the repulsion force applied to the unmanned vehicle is gradually increased, the unmanned vehicle cannot avoid the obstacle due to the balanced stress at a certain point, falls into a local minimum point, and cannot reach the target point, as shown in fig. 9. When the obstacle exists at the target point and the unmanned vehicle travels within the influence distance of the obstacle, the repulsive force of the unmanned vehicle is greater than the attractive force, so that the unmanned vehicle cannot reach the target point, as shown in fig. 10.
the results of simulations using the modified artificial potential field method are shown in fig. 11 and 12. Fig. 11 is an improvement of components of repulsive force in X and Y axes in the case where the unmanned vehicle sinks into the local minimum point in fig. 9, so that the unmanned vehicle jumps out of the local minimum point and continues to travel toward the target point. Fig. 12 is a modification of fig. 10 in which an adjustment factor and a safety distance are added to the repulsive force of the unmanned vehicle in the case where the unmanned vehicle is present with the target unreachable, so that the unmanned vehicle is balanced in force when reaching the target point.
from the simulation result, the improved algorithm can well solve the problem that the trolley falls into the local minimum point and the target is inaccessible, guide the trolley to travel to the target point, and compare the traditional distance factor improving method in the figure 13 with the target accessible path formed by the distance factor improving and safety distance increasing method, so that the effectiveness of the improved artificial potential field method is verified.
The application introduces the basic principle of the traditional artificial potential field method, analyzes the reasons that the traditional artificial potential field method falls into the local minimum point and the target unreachable condition in the path planning, improves the safety performance of the unmanned vehicle while solving the problem of the target unreachable by introducing the safety distance and the adjusting factor, and enables the unmanned vehicle to jump out of the local minimum point by increasing the variable coefficient on the repulsive force component. And finally, the effectiveness of the improved algorithm is verified in a Matlab simulation environment.