Global path planning method and device based on A star algorithm, and storage medium

By introducing the environmental obstacle rate T into the A-star algorithm, the weight of the cost evaluation function is dynamically adjusted to optimize the path planning process, solve the local optimal problem of the traditional A-star algorithm in complex environments, and achieve a more efficient and accurate path. planning.

CN118730143AInactive Publication Date: 2024-10-01HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410705117.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional A-star algorithm is prone to falling into local optima in complex environments, causing the efficiency and accuracy of path planning results to be affected.

Method used

The environmental obstacle rate T is introduced to dynamically adjust the weight of the cost evaluation function. Through the search process of the new heuristic function and dynamic weight adjustment optimization algorithm, the efficiency and accuracy of path planning are improved.

Benefits of technology

It effectively prevents the algorithm from falling into local optimality, shortens the path planning time, improves the continuity and efficiency of the path, reduces the turning points, and significantly improves the quality of path planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118730143A_ABST
    Figure CN118730143A_ABST
Patent Text Reader

Abstract

The invention discloses a global path planning method and device based on an A star algorithm, and a storage medium, a heuristic function is optimized, an environment obstacle rate T is introduced, the weight of the heuristic function h (n) in different environments is changed, when the proportion of obstacles in the working environment is small, the search range of the algorithm needs to be narrowed, the path-finding efficiency needs to be improved, and the path-finding efficiency needs to be improved. At the moment, increasing the weight of the heuristic function h (n); when the proportion of obstacles in the working environment is large, the weight of h (n) needs to be reduced to avoid the situation that the algorithm falls into local optimum, the improved heuristic function has higher flexibility, the search efficiency is effectively improved, and the energy consumption is reduced. And secondly, through algorithms such as judgment and removal of collinear points, reduction of turning points and the like, the path length can be effectively shortened, and the driving consumption is reduced. Therefore, according to the design, through the new heuristic function design and the dynamic weight adjustment strategy, the search process of the algorithm is optimized, and the efficiency and accuracy of path planning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of full path planning, and in particular relates to a global path planning method and device, and a storage medium based on an A-star algorithm. Background Art

[0002] Path planning is an important issue in the field of artificial intelligence, involving many practical applications, such as autonomous driving, robot navigation, etc. As a classic path planning algorithm, the A-star algorithm has high efficiency and accuracy and is widely used in practical applications. However, the traditional A-star algorithm is prone to fall into local optimality in complex environments, affecting the quality of path planning results. Therefore, this paper aims to propose an improved A-star algorithm based on optimization, which optimizes the algorithm's search process and improves the efficiency and accuracy of path planning by introducing new heuristic functions, dynamic weight adjustment and other methods. Summary of the invention

[0003] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a global path planning method and device based on the A-star algorithm, and a storage medium.

[0004] The present invention adopts the following technical solution: a global path planning method based on the A-star algorithm, comprising the following steps:

[0005] Step 1: Data initialization, setting obstacle area and starting point position (x a ,y a )、End point position(x b ,y b ) and the number of grids N; introduce the environmental obstacle rate T and create the cost evaluation function f(n);

[0006] Step 2: Set the starting point S a (x a ,y a ) and its surrounding eight adjacent point positions S a(i) Record it in the pending check list opcnList;

[0007] Step 3: Based on the current list to be checked, openList, use the cost evaluation function f(n) to obtain the minimum node S k ;

[0008] Step 4: Determine the minimum node S k Is it the end position: If not, go to step 5; if so, go to step 6;

[0009] Step 5: Find the eight neighboring nodes S of the minimum node Sk k(i) , for the eight neighborhood nodes S k(i)Filter and update to the list to be checked openList, repeat steps 3 to 4 based on the updated list to be checked openList until the minimum node S k+l Execute step 6 for the end position, where k ≥ 1, l ≥ 0;

[0010] Step 6: Remove redundant minimum nodes to optimize line breakpoints.

[0011] In a further embodiment, the cost evaluation function f(n) is created as follows: The environmental obstacle rate T is expressed by the following formula:

[0012]

[0013] Define g(n) as the actual cost from the starting point to node n; h(n) as the estimated cost from node n to the end point. When the value of T is lower than the threshold, the weight of h(n) is increased. On the contrary, when the value of T is higher than the threshold, the search range is increased to improve the search efficiency and the weight of h(n) is reduced.

[0014] Correspondingly, the formula of the cost evaluation function f(n) is as follows:

[0015] f(n)=g(n)+(1-lgT)h(n), where T is the environmental obstacle rate.

[0016] In a further embodiment, the cost evaluation values ​​of the point positions in the current to-be-checked list openList are arranged in ascending order, and the point position with the minimum cost evaluation value is defined as the minimum node S k ;

[0017] The step three also includes: k Transfer from the pending list openList to the checked list closeList.

[0018] In a further embodiment, the minimum node S in step 4 k The method for determining whether it is the end position is as follows:

[0019] Get the minimum node S k The corresponding point position coordinates (x k ,y k ), if (x k ,y k )=(x b ,y b ), then it is judged as the end position, otherwise it is not the end position.

[0020] In a further embodiment, in step 5, the eight neighborhood nodes S k(i)The specific process of screening and updating to the openList to be checked is as follows:

[0021] Based on the current list to be checked openList and the checked list closeList, the eight neighboring nodes S k(i) The nodes that fall into the checked list closeList are ignored, and the other nodes are added to the to-be-checked list openList to obtain the updated check list openList.

[0022] In a further embodiment, the operation process of step six is ​​as follows:

[0023] When there are multiple nodes on the same straight line, determine the starting point S(x s ,y s ) and the end point Z(x z ,y z ); corresponding to the starting point S(x s ,y s ) and the end point Z(x z ,y z ) Each node S in the connecting area k (x k ,y k ) perform the following steps respectively:

[0024] The line segment SS is calculated using the following formula: k and line segment ZS k The slope of:

[0025]

[0026] Among them, line segment SS k is the starting point S(x s ,y s ) and node S k (x k ,y k ), line segment ZS k is the end point Z(x z ,y z ) and node S k (x k ,y k )

[0027] If SS k =ZS k , then it means that node S k (x k ,y k ) and the starting point S(x s ,y s )、End point Z(x z ,yz ) are three points on a line, then delete node S k (x k ,y k );

[0028] The same straight line is defined as the line connecting the starting point to the end point and the starting point to each bending point.

[0029] In a further embodiment, the node S is deleted. k (x k ,y k ) Two adjacent nodes S k-1 (x k-1 ,y k-1 ), S k+1 (x k+1 ,y k+1 ) are connected. If there is an obstacle in the connection, make node S k-1 (x k-1 ,y k-1 ) and the next node S k+2 (x k+2 ,y k+2 ), and so on, shortening the path and reducing turning points without touching obstacles.

[0030] A device comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the global path planning method based on the A-star algorithm as described above.

[0031] A storage medium stores a computer program, wherein the computer program is configured to execute the global path planning method based on the A-star algorithm as described above when running.

[0032] Beneficial effects of the present invention: The present invention is based on the traditional A-star algorithm and introduces the environmental obstacle rate T to dynamically adjust the weight of the algorithm according to the real-time information in the search process to adapt to the search needs in different situations.

[0033] The traditional A-star algorithm has many turning points when planning a path, which leads to discontinuous and long paths. Therefore, the path is optimized. The turning points are straightened, that is, the path is first planned according to the traditional A-star algorithm, and then the starting point and the end point are connected to make the line shortest and without turning points. If there is an obstacle in the connection, the next node is connected, and so on. In the case of not touching obstacles, the path length is greatly reduced and there are fewer turning points. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1This is a flow chart of the global path planning method based on the A-star algorithm of Example 1.

[0035] FIG2( a ) is a diagram showing the application results of the existing global path planning method.

[0036] FIG2( b ) is the application result of the global path planning method of Example 1 Figure 1 .

[0037] FIG2( c ) is a second application result diagram of the global path planning method of Example 1. ... DETAILED DESCRIPTION

[0038] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings. The following drawings are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0039] Example 1

[0040] like Figure 1 As shown, this embodiment discloses a global path planning method based on the A-star algorithm, comprising the following steps:

[0041] Step 1: Data initialization, setting obstacle area and starting point position (x a ,y a )、End point position(x b ,y b ) and the number of grids N; introduce the environmental obstacle rate T and create the cost evaluation function f(n);

[0042] Step 2: Set the starting point S a (x a ,y a ) and its surrounding eight adjacent point positions S a(i) Record it in the openList to be checked; for example, the starting position S a (x a ,y a The eight adjacent points of ) are: a(1) , S a(2) , S a(3) , S a(4) , S a(5) , S a(6) , S a(7) and S a(8) ; That is, the value of i is 1 to 8.

[0043] Step 3: Based on the current list to be checked, openList, use the cost evaluation function f(n) to obtain the minimum node S k ;

[0044] Step 4: Determine the minimum node S kIs it the end position: If not, go to step 5; if so, go to step 6;

[0045] Step 5: Find the minimum node S k The eight neighborhood nodes S k(i) , for the eight neighborhood nodes S k(i) Filter and update to the list to be checked openList, repeat steps 3 to 4 based on the updated list to be checked openList until the minimum node S k+l Execute step 6 for the end point, where k≥1 and l≥0. For example, if k=1, it means that the first obtained minimum node S1 is the end point, then there is no need to further execute step 5, and l=0 at this time. Otherwise, it needs to be repeated. If k=2, it means that the first obtained minimum node S1 is not the end point, and it is necessary to obtain the minimum node S2 based on the minimum node S1 for the second time, and the corresponding eight neighboring nodes S of the minimum node S1 1(i) , respectively denoted as S 1(1) , S 1(2) , S 1(3) , S 1(4) , S 1(5) , S 1(6) , S 1(7) and S 1(8) If the minimum node S2 is determined to be the middle end point, there is no need to further execute step 5. At this time, l=1, so l is the number of repetitions.

[0046] Step 6: Remove redundant minimum nodes to optimize line breakpoints.

[0047] The cost evaluation function formula of the traditional A-star algorithm for the eight-neighborhood is as follows:

[0048] f(n)=g(n)+h(n)

[0049]

[0050] However, when the number of obstacles in the map increases, the robot will have more paths to move and more choices of paths, which will easily cause the algorithm to fall into a local optimum. Therefore, it is necessary to optimize the heuristic function of the A-star algorithm to improve the search efficiency of the algorithm. From Figure 2 (a), Figure 2 (b) and Figure 2 (c), it can be seen that the path selection of this embodiment shortens the time from the existing 31.5132 seconds to 5.1342 seconds and 6.3193 seconds, and the efficiency is significantly improved.

[0051] Therefore, this embodiment introduces the environmental obstacle rate T to change the weight of the heuristic function in different environments. h(n) is the calculation formula of the Euclidean distance, and the environmental obstacle rate T and h(n) act together on the evaluation function f(n).

[0052] The specific performance is as follows: The creation process of the cost evaluation function f(n) in step 1 is as follows: The environmental obstacle rate T is expressed by the following formula:

[0053]

[0054] Define g(n) as the actual cost from the starting point to node n; h(n) as the estimated cost from node n to the end point. When the value of T is lower than the threshold, the weight of h(n) is increased. On the contrary, when the value of T is higher than the threshold, the search range is increased to improve the search efficiency and the weight of h(n) is reduced.

[0055] Correspondingly, the formula of the cost evaluation function f(n) is as follows:

[0056] f(n)=g(n)+(1-lg T)h(n).

[0057] in, Among them, (x n ,y n ) is the point position of node n, (x s ,y s ) is the starting point in the list to be checked openList, (x g ,y g ) is the end point in the list openList to be checked.

[0058] When the proportion of obstacles in the environment is low, the search range can be reduced to improve the search efficiency, and the proportion of h(n) can be increased. When there are many obstacles in the environment, the proportion of h(n) can be reduced to prevent the algorithm from falling into the local optimal situation.

[0059] Furthermore, the cost evaluation values ​​of the point positions in the current list to be checked, openList, are arranged in order from small to large, and the point position with the minimum cost evaluation value is defined as the minimum node S k .

[0060] The step three also includes: k Transfer from the pending list openList to the checked list closeList.

[0061] By adopting the above scheme, the data in the to-be-checked list openList is optimized to prevent the amount of data in the to-be-checked list openList from increasing continuously during the operation of the traditional A-star algorithm. By discarding some nodes, the data in the to-be-checked list openList is kept at a certain amount, which can effectively improve the operation efficiency of the algorithm.

[0062] In a further embodiment, the minimum node S in step 4k The method for determining whether it is the end position is as follows:

[0063] Get the minimum node S k The corresponding point position coordinates (x k ,y k ), if (x k ,y k )=(x b ,y b ), then it is judged as the end position, otherwise it is not the end position.

[0064] Considering the existence of obstacles, there will be a detour path when moving from the current node to the next node, so the nodes in the open table need to be recalculated and sorted. k(i) The specific process of screening and updating to the openList to be checked is as follows:

[0065] Based on the current list to be checked openList and the checked list closeList, the eight neighboring nodes S k(i) The nodes that fall into the checked list closeList are ignored, and the other nodes are added to the list to be checked openList to obtain the updated check list openList. In other words, find the minimum node S k The eight neighborhood nodes S k(i) , determine whether it is in the list to be checked openList and the list of checked closeList. If it is not in the two lists, check the eight neighboring nodes S k(i) Perform cost evaluation and record the obtained evaluation function f(n) into the list to be checked openList; if S k(i) In the openList to be checked, the data in the table is sorted; if the eight neighboring nodes S k(i) If the node is in the checked list closeList, the node is ignored.

[0066] The traditional A-star algorithm has many turning points when planning a path, which leads to discontinuous and long paths. Therefore, the path is optimized. The turning points are straightened, that is, the path is first planned according to the traditional A-star algorithm, and then the starting point and the end point are connected to make the line shortest and without turning points. If there is an obstacle in the connection, the next node is connected, and so on. In the case of not touching obstacles, the path length is greatly reduced and there are fewer turning points.

[0067] Specifically, when there are multiple nodes on the same straight line, the same straight line is defined as the line connecting the starting point to the end point and the starting point to each bending point.

[0068] Determine the starting point S(xs ,y s ) and the end point Z(x z ,y z ); corresponding to the starting point S(x s ,y s ) and the end point Z(x z ,y z ) Each node S in the connecting area k (x k ,y k ) perform the following steps respectively:

[0069] The line segment SS is calculated using the following formula: k and line segment ZS k The slope of:

[0070]

[0071] Among them, line segment SS k is the starting point S(x s ,y s ) and node S k (x k ,y k ), line segment ZS k is the end point Z(x z ,y z ) and node S k (x k ,y k )

[0072] If SS k =ZS k , then it means that node S k (x k ,y k ) and the starting point S(x s ,y s )、end point Z(x z ,y z ) are three points on a line, then delete node S k (x k ,y k ).

[0073] Will delete node S k (x k ,y k ) Two adjacent nodes S k-1 (x k-1 ,y k-1 ), S k+1 (x k+1 ,y k+1 ) are connected. If there is an obstacle in the connection, make node S k-1 (xk-1 ,y k-1 ) and the next node S k+2 (x k+2 ,y k+2 ), and so on, shortening the path and reducing turning points without touching obstacles.

[0074] Example 2

[0075] In order to implement the global path planning method based on the A-star algorithm described in Example 1, this embodiment discloses a device including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the global path planning method based on the A-star algorithm.

[0076] A storage medium stores a computer program, wherein the computer program is configured to execute the global path planning method based on the A-star algorithm when running.

[0077] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A global path planning method based on the A-star algorithm, characterized in that: The following steps are involved: Step 1: Data initialization, setting obstacle area and starting point position (x a ,y a )、End point position (x b ,y b ) and the number of grids N; introduce the environmental obstacle rate T and create the cost evaluation function f(n); Step 2: Set the starting point S a (x a ,y a ) and its surrounding eight adjacent point positions S a(i) Record it in the list to be checked, openList; Step 3: Based on the current list to be checked, openList, use the cost evaluation function f(n) to obtain the minimum node S k ; Step 4: Determine the minimum node S k Is it the end position: If not, go to step 5; if so, go to step 6; Step 5: Find the minimum node S k The eight neighborhood nodes S k(i) , for the eight neighborhood nodes S k(i) Filter and update to the list to be checked openList, repeat steps 3 to 4 based on the updated list to be checked openList until the minimum node S k+l Execute step 6 for the end position, where k ≥ 1, l ≥ 0; Step 6: Remove redundant minimum nodes to optimize line breakpoints.

2. A global path planning method based on the A-star algorithm according to claim 1, characterized in that: The creation process of the cost evaluation function f(n) is as follows: The environmental obstacle rate T is expressed by the following formula: Define g(n) as the actual cost from the starting point to node n; h(n) is the estimated cost from node n to the end point. When the value of T is lower than the threshold, the weight of h(n) is increased. On the contrary, when the value of T is higher than the threshold, the search range is increased to improve the search efficiency and the weight of h(n) is reduced. Correspondingly, the formula of the cost evaluation function f(n) is as follows: f(n)=g(n)+(1―lg T)h(n), where T is the environmental obstacle rate.

3. A global path planning method based on the A-star algorithm according to claim 1, characterized in that: Arrange the cost evaluation values ​​of the point positions in the current list to be checked, openList, in ascending order, and define the point position with the minimum cost evaluation value as the minimum node S k ; The step three also includes: k Transfer from the pending list openList to the checked list closeList.

4. A global path planning method based on the A-star algorithm according to claim 1, characterized in that: The minimum node S in step 4 k The method for determining whether it is the end position is as follows: Get the minimum node S k The corresponding point position coordinates (x k ,y k ), if (x k ,y k )=(x b ,y b ), then it is judged as the end position, otherwise it is not the end position.

5. A global path planning method based on the A-star algorithm according to claim 3, characterized in that: In step 5, the eight neighborhood nodes S k(i) The specific process of screening and updating to the openList to be checked is as follows: Based on the current list to be checked openList and the checked list closeList, the eight neighboring nodes S k(i) The nodes that fall into the checked list closeList are ignored, and the other nodes are added to the to-be-checked list openList to obtain the updated check list openList.

6. A global path planning method based on the A-star algorithm according to claim 1, characterized in that: The specific operation process of step six is ​​as follows: When there are multiple nodes on the same straight line, determine the starting point S(x s ,y s ) and the end point Z(x z ,y z ); corresponding to the starting point S(x s ,y s ) and the end point Z(x z ,y z ) Each node S in the connecting area k (x k ,y k ) perform the following steps respectively: The line segment SS is calculated using the following formula: k and line segment ZS k The slope of: Among them, line segment SS k is the starting point S(x s ,y s ) and node S k (x k ,y k ), line segment ZS k is the end point Z(x z ,y z ) and node S k (x k ,y k ) If SS k =ZS k , then it means that node S k (x k ,y k ) and the starting point S(x s ,y s )、end point Z(x z ,y z ) are three points on a line, then delete node S k (x k ,y k ); The same straight line is defined as the line connecting the starting point to the end point and the starting point to each bending point.

7. A global path planning method based on the A-star algorithm according to claim 6, characterized in that: Will delete node S k (x k ,y k ) Two adjacent nodes S k―1 (x k―1 ,y k―1 ), S k+1 (x k+1 ,y k+1 ) are connected. If there is an obstacle in the connection, make node S k―1 (x k―1 ,y k―1 ) and the next node S k+2 (x k+2 ,y k+2 ), and so on, shortening the path and reducing turning points without touching obstacles.

8. A device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the global path planning method based on the A-star algorithm as described in any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the global path planning method based on the A-star algorithm described in any one of claims 1 to 7 when running.