Path planning method, device, electronic device and storage medium
By using an improved heuristic function based on Manhattan distance in the cargo area and workstation area to determine the starting intersection point of the target, the problem of the A* algorithm searching for increased invalid nodes in path planning is solved, and the efficiency and accuracy of path planning are improved. .
Patent Information
- Application Number
- CN202111136454.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-09-27
AI Technical Summary
The existing A* algorithm leads to an increase in invalid search nodes when the robot walks between the shelf area and the workstation, reducing the algorithm search efficiency and increasing the robot's processing burden.
An improved heuristic function based on Manhattan distance is used to adjust the path planning algorithm to improve search efficiency and reduce processing burden by determining the target starting intersection point in the cargo area and workstation area.
Through the improved heuristic function, the efficiency of path planning is improved, the search for invalid nodes is reduced, the processing burden of the robot is reduced, and the accuracy of path planning is enhanced.
Smart Images

Figure CN113932812B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotics technology, and in particular to a path planning method, device, electronic equipment and storage medium. Background Art
[0002] With the development of artificial intelligence and automation, the research on robots has become more and more in-depth. The most urgent problem to be solved in robot operation control is the understanding of the operating environment and the operation path planning. The A* (A-Star) algorithm is a commonly used robot path planning method. It is a heuristic search algorithm for solving the shortest path of a static network. It combines the completeness of the Dijkstra algorithm and the efficiency of the Breadth First Search (BFS), so it is widely used in actual projects.
[0003] In the prior art, when a robot walks between a shelf area and a workstation, an A* algorithm is usually used to plan the path between the starting and ending points in the shelf area and the workstation. The heuristic function of the A* algorithm is h(n)=C*(|n x -goal x |+|n y -goal y |), where C = 1 is the unit grid path cost, n x is the row number of the current grid, n y is the column number of the current grid, goal x is the row number of the target grid, goal y The column number of the target grid.
[0004] However, since the robot carrying the shelf can only walk on a one-way path, the actual distance between the starting and ending points in the shelf area and the workstation will be greater than or equal to the Manhattan distance between the two points. In this way, when the A* algorithm is used to plan the path between the starting and ending points, the number of invalid nodes searched by the A* algorithm will increase, thereby reducing the algorithm search efficiency and further increasing the processing burden of the robot. Summary of the invention
[0005] In view of the problems existing in the prior art, embodiments of the present invention provide a path planning method, device, electronic device and storage medium.
[0006] The present invention provides a path planning method, comprising:
[0007] Acquire a target map; wherein the target map includes a cargo area;
[0008] When it is determined that the target node is located in the cargo area, performing path planning for the cargo area according to a target path algorithm including a first heuristic function;
[0009] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0010] According to a path planning method provided by the present invention, the first heuristic function is determined based on the sum of the Manhattan distance between the target node and the target starting intersection point and the Manhattan distance between the target starting intersection point and the target position.
[0011] According to a path planning method provided by the present invention, the target map further includes a workstation area, the target location includes a target workstation, and after acquiring the target map, the method further includes:
[0012] When it is determined that the target node is located in the workstation area, and when it is determined that the target node is not located in the area between the target workstation and the target transition node, performing path planning for the workstation area according to a target path algorithm including a second heuristic function;
[0013] Among them, the transition node is the entry point when entering the workstation area from the cargo area; the second heuristic function is determined based on the sum of the Manhattan distance between the target node and the target transition node and the Manhattan distance between the target transition node and the target workstation.
[0014] According to a path planning method provided by the present invention, when determining that the target node is located in the workstation area, the method further includes:
[0015] In the case where it is determined that the target node is located in an area between the target workstation and the target transition node, performing path planning for the workstation area according to a target path algorithm including a third heuristic function;
[0016] The third heuristic function is determined based on the Manhattan distance between the target node and the target workstation.
[0017] According to a path planning method provided by the present invention, the target path algorithm includes the product of a jitter factor and a target heuristic function; wherein the jitter factor includes a number greater than 1, and the target heuristic function includes one of the following: the first heuristic function, the second heuristic function and the third heuristic function.
[0018] According to a path planning method provided by the present invention, before obtaining the target map, the method further includes:
[0019] Adding a corresponding starting intersection to each set of one-way road signs on the target map;
[0020] Each group of the one-way road signs is obtained by dividing all the first one-way road signs and all the second one-way road signs; the first one-way road signs are signs on the road in the first direction; and the second one-way road signs are signs on the road in the second direction.
[0021] The present invention also provides a path planning device, comprising:
[0022] An acquisition unit, used for acquiring a target map; wherein the target map includes a cargo area;
[0023] a first planning unit, configured to, when determining that a target node is located in the cargo area, perform path planning for the cargo area according to a target path algorithm including a first heuristic function;
[0024] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0025] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned path planning methods are implemented.
[0026] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned path planning methods are implemented.
[0027] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned path planning methods are implemented.
[0028] The present invention provides a path planning method, device, electronic device and storage medium. In the process of traversing nodes on a target map, when it is determined that a target node adjacent to a current node is located in a cargo area, a path planning is performed on the cargo area according to a target path algorithm including a first heuristic function. The first heuristic function is jointly determined based on the target node, the target position and the target starting intersection corresponding to the target node. Since the target starting intersection is the point closest to the one-way road pointing to the target position, it can compensate for the distance error obtained by directly calculating the Manhattan distance determined by the target node and the target position, thereby improving the algorithm search efficiency and further reducing the processing burden of the robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0030] Figure 1 It is one of the flow charts of the path planning method provided by the present invention;
[0031] Figure 2 is a schematic diagram of a target map provided by the present invention;
[0032] Figure 3 This is the second flow chart of the path planning method provided by the present invention;
[0033] Figure 4 This is the third flow chart of the path planning method provided by the present invention;
[0034] Figure 5 It is a schematic diagram of the search process of the original A* algorithm provided by the present invention;
[0035] Figure 6 It is one of the schematic diagrams of experimental results of the path planning method in the prior art;
[0036] Figure 7 This is one of the schematic diagrams of the experimental results of path planning using Strategy 1 provided by the present invention;
[0037] Figure 8 This is one of the schematic diagrams of the experimental results of path planning using Strategy 2 provided by the present invention;
[0038] Fig. 9 This is the second schematic diagram of the experimental results of the path planning method in the prior art;
[0039] Fig.10This is the second schematic diagram of the experimental results of path planning using strategy 1 provided by the present invention;
[0040] Fig.11 This is the second schematic diagram of the experimental results of path planning using Strategy 2 provided by the present invention;
[0041] Fig.12 This is the third schematic diagram of the experimental results of the path planning method in the prior art;
[0042] Fig.13 This is the third schematic diagram of the experimental results of path planning using strategy 2 provided by the present invention;
[0043] Fig.14 This is the fourth schematic diagram of the experimental results of the path planning method in the prior art;
[0044] Fig.15 This is the fourth schematic diagram of the experimental results of path planning using strategy 2 provided by the present invention;
[0045] Fig.16 It is a structural schematic diagram of the path planning device provided by the present invention;
[0046] Fig.17 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0048] The main idea of the A* algorithm to search for paths is to traverse the surrounding feasible points from the starting point, evaluate these feasible points through a cost function, select the point with the minimum cost, and then continue to traverse the surrounding points from the point with the minimum cost, and iterate continuously until the end point is included. The following formula (1) is usually used to express the cost function:
[0049] f(n)=g(n)+h(n) (1)
[0050] Among them, f(n) is the cost function, g(n) is the actual cost from the starting node to node n, and h(n) is the estimated cost from node n to the end point.
[0051] In the cost function, g(n) depends on the definition of the path cost in the application scenario, which can be the path length, travel time, or a combination of path length and travel time. The heuristic function h(n) guides the algorithm to search in the direction of the end point. Theoretically, a completely correct heuristic function can make the A* algorithm converge quickly to the optimal solution, but a completely correct heuristic function is impossible to obtain. Therefore, the selection of the heuristic function determines the search efficiency of the A* algorithm and the quality of the solution.
[0052] When the value of h(n) is greater than the actual cost, the search range of the A* algorithm decreases, and the search speed toward the target node increases. This may result in only one feasible path, but it is not the optimal path. In extreme cases, when the value of h(n) is much greater than g(n), the A* algorithm will degenerate into the BFS algorithm; when the value of h(n) is less than the actual cost, the A* algorithm will expand the search range of optional paths, which can ensure that the solution obtained is the optimal solution, but the expansion of the search range means the sacrifice of speed. In extreme cases, when the value of h(n) is much less than g(n), the A* algorithm will degenerate into the Dijkstra algorithm. Therefore, it is necessary to weigh the choice of h(n) according to the actual application scenario. In the environment established by the grid method, there are the following commonly used heuristic functions:
[0053] The Manhattan distance h1(n) is expressed by the following formula (2):
[0054] h1(n)=C*(|n x -goal x |+|n y -goal y |) (2)
[0055] The diagonal distance h2(n) is expressed by the following formula (3):
[0056]
[0057] Wherein, h1 is expressed by the following formula (4), and h2 is expressed by the following formula (5):
[0058] h1=min(|n x -goal x |,|n y -goal y |) (4)
[0059] h2=|n x -goal x |+|n y -goal y | (5)
[0060] The Euclidean distance h3(n) is expressed by the following formula (6):
[0061]
[0062] The squared Euclidean distance h4(n) is expressed using the following formula (7):
[0063] h4(n)=C*[(n x -goal x ) 2 +(n y -goal y ) 2 ] (7)
[0064] The present invention is based on the improvement of Manhattan distance, that is, the function h1(n)=C*(|n x -goal x |+|n y -goal y |) improvements.
[0065] Combine the following Figure 1-Figure 15 The path planning method of the present invention is described.
[0066] Figure 1 is one of the flow charts of the path planning method provided by the present invention, such as Figure 1 As shown, the method includes:
[0067] Step 110: Obtain the target map.
[0068] Wherein, the target map includes a cargo area and a workstation area.
[0069] Specifically, a target map may be drawn in advance based on the location of the goods, and then the drawn target map may be stored, and the robot may directly obtain the target map when performing work.
[0070] Figure 2 is a schematic diagram of the target map provided by the present invention, such as Figure 2 As shown, a corresponding starting intersection is added to each set of one-way road signs on the target map.
[0071] Each group of the one-way road signs is obtained by dividing all the first one-way road signs and all the second one-way road signs; the first one-way road signs are signs on the road in the first direction; and the second one-way road signs are signs on the road in the second direction.
[0072] exist Figure 2In the figure, the target map is a grid map, which is divided into two areas, namely the cargo area and the workstation area. The cells filled with grids are transition nodes, and the cells filled with slashes are workstations. The part above the transition node is the cargo area (the specific cargo position is the position indicated by the black cell), and the part below the transition node is the workstation area. Each one-way road mark is an arrow line, representing the walking direction of the robot. Each group of one-way road marks includes one or several one-way road marks. The starting intersection is represented by a circle plus a number, such as starting intersection ①, starting intersection ⑧, etc. Figure 2 It can be seen that the starting intersection is the set of the ends of each arrow line in each group of arrow lines. In practical applications, the coordinate position of the cell covered by each one-way street mark in each group of one-way street marks is connected with the coordinate position of the starting intersection corresponding to the group of one-way street marks, so that when the other nodes of the group except the starting intersection are traversed later, the starting intersection is used to calculate the h value corresponding to other nodes; in addition, if the first one-way street mark is a mark on the horizontal channel, then the second one-way street mark is a mark on the vertical channel. The horizontal channel and the vertical channel are the channels formed between each group of goods or the channels outside the edge goods; for all horizontal channels, the direction interval of the first one-way street mark is the same, for example, in Figure 2 There are 7 horizontal channels in total. The directions of the one-way signs on the first, third, fifth and seventh horizontal channels are the same. The directions of the one-way signs on the second, fourth and sixth horizontal channels are the same. For all vertical channels, the directions of the second one-way signs are also the same. For example, Figure 2 There are 5 vertical channels in total. The directions of the one-way signs on the first, third and fifth vertical channels are the same, and the directions of the one-way signs on the second and fourth vertical channels are the same. In addition, one-way signs are also added in the workstation area. The specific directions of the one-way signs are as follows: Figure 2 As shown, no further details are given here.
[0073] Step 120: When it is determined that the target node is located in the cargo area, a path planning is performed for the cargo area according to a target path algorithm including a first heuristic function.
[0074] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0075] Optionally, the first heuristic function is determined based on the sum of the Manhattan distance between the target node and the target starting intersection point and the Manhattan distance between the target starting intersection point and the target position.
[0076] Specifically, the target path algorithm is an improved A* algorithm. The present invention is an improvement on the original A* algorithm, that is, the heuristic function in the original A* algorithm is improved, and the improved A* algorithm is used to traverse the nodes on the target map based on the starting point. The specific traversal process is similar to the process of the original A* algorithm. The process of the original A* algorithm is described below: The original A* algorithm maintains two queues, namely an open (OPEN) list and a closed (CLOSED) list. The OPEN list is used to store the nodes to be detected during the operation of the algorithm, that is, the boundary of the algorithm search area; the CLOSED list is used to store the nodes that have been detected during the operation of the algorithm, that is, the inside of the algorithm search area. The basic process of the original A* algorithm includes the following steps S1 to S5:
[0077] Step S1, add the starting point to the OPEN list and initialize the CLOSED list to empty.
[0078] Step S2: remove the current node with the smallest f value in the OPEN list from the list, and add the current node to the CLOSED list.
[0079] Step S3, examine all adjacent nodes that are adjacent to the current node, reachable, and not in the CLOSED list. If the adjacent node already exists in the OPEN list, calculate the current f value of the adjacent node, and compare the current f value of the adjacent node with the original f value of the adjacent node. If the current f value of the adjacent node is less than the original f value of the adjacent node, it means that the path through the current node is better, then update the parent node of the adjacent node to the current node, and update the f, g, and h values of the adjacent node. Otherwise, do nothing; if the adjacent node is not in the OPEN list, set the parent node of the adjacent node to the current node, then calculate the f value of the adjacent node, and add it to the OPEN list.
[0080] Step S4, repeat steps S2 and S3 until the end point appears in the OPEN list, and the path search is successful.
[0081] Step S5: If steps S2 and S3 are repeated until the OPEN list is empty and the end point does not appear in the OPEN list, the path search fails.
[0082] In this embodiment, the neighboring nodes of the current node are expressed by the target node, and a heuristic function list is stored in advance, which contains the corresponding relationship between the heuristic function and the area. When it is determined that the target node is located in the cargo area, the first heuristic function corresponding to the cargo area is searched in the heuristic function list, and then the path planning is performed on the cargo area according to the A* algorithm including the first heuristic function. Preferably, the first heuristic function is the Manhattan distance between the target node and the target starting intersection corresponding to the target node, and the sum of the Manhattan distance between the target starting intersection and the target position, so that the shortest path from the starting point to the target position is divided into several parts and summed, and the sum result is equal to the actual shortest path length from the starting point to the target position. The reason why this can be done is that the relative position relationship between each one-way road and the workstation has been determined. If the target position is to be reached, the robot must first drive to the one-way road pointing to the target position, and the starting intersection is to locate each target node to the one-way road pointing to the target position direction closest to the target node.
[0083] It should be noted that the target position can be a target cargo position in the cargo area or a target workstation in the workstation area. When the target position is the target cargo position, the robot moves from the cargo area to the cargo area; when the target position is the target workstation, the robot moves from the cargo area to the target workstation.
[0084] The present invention provides a path planning method, device, electronic device and storage medium. In the process of traversing nodes on a target map, when it is determined that a target node adjacent to a current node is located in a cargo area, a path planning is performed on the cargo area according to a target path algorithm including a first heuristic function. The first heuristic function is jointly determined based on the target node, the target position and the target starting intersection corresponding to the target node. Since the target starting intersection is the point closest to the one-way road pointing to the target position, it can compensate for the distance error obtained by directly calculating the Manhattan distance determined by the target node and the target position, thereby improving the algorithm search efficiency and further reducing the processing burden of the robot.
[0085] Based on any of the above embodiments, Figure 3 is a second flow chart of the path planning method provided by the present invention. When the target map also includes a workstation area, and the target location includes a target workstation, as shown in FIG. Figure 3 As shown, the method further comprises the following steps:
[0086] Step 130: When it is determined that the target node is located in the workstation area and when it is determined that the target node is not located in the area between the target workstation and the target transition node, perform path planning for the workstation area according to a target path algorithm including a second heuristic function.
[0087] Among them, the transition node is the entry point when entering the workstation area from the cargo area; the second heuristic function is determined based on the sum of the Manhattan distance between the target node and the target transition node and the Manhattan distance between the target transition node and the target workstation.
[0088] Specifically, when the target map includes a cargo area and a workstation area, and the target position is the target workstation, during the traversal process, if it is determined that the target node is located in the workstation area, it is necessary to further determine whether the target node is located in the area between the target workstation and the target transition node corresponding to the target workstation based on the coordinate position of the target node. When it is determined that the target node is not located in the area between the target workstation and the target transition node, it means that the target node has not yet reached the one-way road entering the target workstation. At this time, the second heuristic function called is the sum of the Manhattan distance between the target node and the target transition node corresponding to the target workstation, and the Manhattan distance between the target transition node and the target workstation. The path currently remaining to the target workstation is further planned according to the A* algorithm including the second heuristic function.
[0089] Based on any of the above embodiments, Figure 4 This is the third flow chart of the path planning method provided by the present invention, such as Figure 4 As shown, the method further comprises the following steps:
[0090] Step 140: When it is determined that the target node is located in the area between the target workstation and the target transition node, path planning is performed on the workstation area according to a target path algorithm including a third heuristic function.
[0091] The third heuristic function is determined based on the Manhattan distance between the target node and the target workstation.
[0092] Specifically, when it is determined that the target node is located in the area between the target workstation and the target transition node, it means that the target node has reached the one-way road entering the target workstation. At this time, the third heuristic function called is the Manhattan distance between the target node and the target workstation. The path currently remaining to the target workstation is further planned according to the A* algorithm including the third heuristic function.
[0093] Furthermore, the target path algorithm includes a product of a jitter factor and a target heuristic function.
[0094] The jitter factor includes a number greater than 1, and the target heuristic function includes one of the following: the first heuristic function, the second heuristic function, and the third heuristic function.
[0095] Specifically, for the scenario where the robot walks from cargo area to cargo area and all situations where the actual shortest path length is equal to the Manhattan distance between the start and end points (including the scenario of walking from the cargo area to the target workstation), although the heuristic function in the original A* algorithm is already equal to the actual shortest path cost, when there are multiple shortest paths with the same cost between the start and end points, and we only need one of them, then the points on the remaining shortest paths with the same cost are also equivalent to invalid nodes, resulting in low search efficiency of the original A* algorithm. Figure 5 It is a schematic diagram of the search process of the original A* algorithm provided by the present invention, such as Figure 5 As shown, each bold black box represents a main loop of the original A* algorithm. Figure 5 All cells marked with letters represent points that appear in the OPEN list during the search process, cells marked with grid lines represent points in the CLOSED list, cells marked with slashes represent the current node of the current main loop, cells marked with dots represent the adjacent nodes of the current main loop, white circles before filling represent the starting point, and black circles represent the end point; the specific search process is as follows:
[0096] In the first cycle, A1 and A2 are added to the OPEN list, and the f values of A1 and A2 are both the minimum f(A1)=f(A2)=1+9=10.
[0097] In the second loop, the point with the smallest f value in the OPEN list is selected. At this time, there are two points with the smallest f values, A1 and A2. A1 is selected as the current node of this loop in order, and then extended outward to obtain the adjacent nodes B1 and B2 of this loop, and then added to the OPEN list. The f values of the adjacent nodes B1 and B2 are also the smallest f(B1)=f(B2)=2+8=10.
[0098] In the third loop, the point with the smallest f value in the OPEN list is selected. At this time, there are three points with the smallest f values, A2, B1, and B2. A2 is selected as the current node of this loop in order, and then extended outward to obtain the adjacent node C1 of this loop, which is then added to the OPEN list. The f value of the adjacent node C1 is also the smallest, f(C1)=3+7=10.
[0099] And so on, until the end point is included in the OPEN list. In this process, we can see that all the nodes between the rectangles with the end point and the starting point as diagonal points have been searched, because they are all nodes on the same shortest path, and we only need one of them, so we can make adaptive improvements to it so that it only includes nodes around one shortest path during the search process.
[0100] It can be seen from the search process of the original A* algorithm above that if we add a jitter factor to the f value of the adjacent nodes of the current node with different distances from the end point, so that the f value of the points on the same path cost of each cycle is different, and the f value closer to the end point is smaller, then the algorithm will search in one direction instead of traversing all points on the same shortest path between the start and end nodes. Therefore, the present invention multiplies the heuristic function obtained by the above embodiment by a jitter factor greater than 1, so that the cost of the same path cost point far from the end point is magnified in the f value, so that the adjacent nodes of the current node with different distances can be distinguished. In addition, when actually selecting the jitter factor, if the jitter factor is much greater than 1, it will cause h(n) to be much greater than the actual cost, and the optimality of the path may be lost; if the jitter factor is too close to 1, the effect of reducing the traversal of invalid nodes is not obvious. Considering comprehensively, the jitter factor can be selected as 4.
[0101] In actual applications, when using a target path algorithm that includes a first heuristic function, the first heuristic function can be further multiplied by a jitter factor; when using a target path algorithm that includes a second heuristic function, the second heuristic function can be further multiplied by a jitter factor; when using a target path algorithm that includes a third heuristic function, the third heuristic function can be further multiplied by a jitter factor.
[0102] The technical effect of the improved A* algorithm of the present invention is verified based on the experimental results below. For the convenience of description, the target path algorithm based on the first heuristic function, the second heuristic function and the third heuristic function for path planning is referred to as path planning using strategy one, and the target path algorithm based on the jitter factor multiplied by the first heuristic function, the jitter factor multiplied by the second heuristic function, and the jitter factor multiplied by the third heuristic function for path planning is referred to as path planning using strategy two.
[0103] The first set of experiments is as follows:
[0104] For the scenario where the robot walks from the cargo area to the workstation area, Figure 6 This is one of the experimental results of the path planning method in the prior art. Figure 6As shown, the path formed by the cells marked by all the grid points is the shortest path solved by the original A* algorithm, and the cells marked by the grid are other points traversed by the original A* algorithm when solving the shortest path.
[0105] For the scenario where the robot walks from the cargo area to the workstation area, Figure 7 FIG. 1 is one of the experimental results of the path planning using strategy 1 provided by the present invention. Figure 7 As shown in the figure, the path formed by the cells marked by all the grid points is the shortest path solved by strategy 1, and the cells marked by the grid are the points traversed when the shortest path is solved by strategy 1. It can be seen that Figure 7 The theoretically unfeasible points have been removed in advance, corresponding to the figure as Figure 7 There are fewer cells in the grid marker than Figure 6 The cells marked in the grid are used to improve the algorithm search efficiency.
[0106] For the scenario where the robot walks from the cargo area to the workstation area, Figure 8 This is one of the experimental results of the path planning using Strategy 2 provided by the present invention. Figure 8 As shown in the figure, the path formed by the cells marked by all the grid points is the shortest path solved by Strategy 2, and the cells marked by the grid are the points traversed when the shortest path is solved by Strategy 2. It can be seen that Strategy 2 is based on Strategy 1, which deletes the shortest path in the search process and only retains one shortest path, corresponding to Figure 8 The number of cells marked by the grid on the same shortest path is represented by Figure 7 The number of marked cells in the grid is reduced, which further improves the algorithm search efficiency.
[0107] The second set of experiments is as follows:
[0108] For the scenario where the robot walks from the cargo area to the workstation area, Fig. 9 This is the second schematic diagram of the experimental results of the path planning method in the prior art. Fig. 9 As shown, the path formed by the cells marked by all the grid points is the shortest path solved by the original A* algorithm, and the cells marked by the grid are other points traversed by the original A* algorithm when solving the shortest path.
[0109] For the scenario where the robot walks from the cargo area to the workstation area, Fig.10 FIG. 2 is a second schematic diagram of the experimental results of path planning using strategy 1 provided by the present invention. Fig.10 As shown in the figure, the path formed by the cells marked by all the grid points is the shortest path solved by strategy 1, and the cells marked by the grid are the points traversed when the shortest path is solved by strategy 1. It can be seen that Fig.10The theoretically unfeasible points have been removed in advance, corresponding to the figure as Fig.10 There are fewer cells in the grid marker than Fig. 9 The cells marked in the grid are used to improve the algorithm search efficiency.
[0110] For the scenario where the robot walks from the cargo area to the workstation area, Fig.11 FIG. 2 is a second schematic diagram of the experimental results of path planning using Strategy 2 provided by the present invention. Fig.11 As shown in the figure, the path formed by the cells marked by all the grid points is the shortest path solved by Strategy 2, and the cells marked by the grid are the points traversed when the shortest path is solved by Strategy 2. It can be seen that Strategy 2 is based on Strategy 1, which deletes the shortest path in the search process and only retains one shortest path, corresponding to Fig.11 The number of cells marked by the grid on the same shortest path is represented by Fig.10 The number of marked cells in the grid is reduced, which further improves the algorithm search efficiency.
[0111] The third set of experiments is as follows:
[0112] For the scenario where the robot walks from the cargo area to the cargo area, Fig.12 This is the third schematic diagram of the experimental results of the path planning method in the prior art. Fig.12 As shown, the path formed by the cells marked by all the grid points is the shortest path solved by the original A* algorithm, and the cells marked by the grid are the points traversed by the original A* algorithm when solving the shortest path.
[0113] For the scenario where the robot walks from the cargo area to the cargo area, Fig.13 FIG. 3 is a schematic diagram of the experimental results of path planning using strategy 2 provided by the present invention. Fig.13 As shown in the figure, the path formed by the cells marked by all the grid points is the shortest path solved by Strategy 2, and the cells marked by the grid are the points traversed when the shortest path is solved by Strategy 2. It can be seen that Strategy 2 is based on Strategy 1, which deletes the shortest path in the search process and only retains one shortest path, corresponding to Fig.13 The number of cells marked by the grid on the same shortest path is represented by Fig.12 The number of marked cells in the grid is reduced, which further improves the algorithm search efficiency.
[0114] The fourth set of experiments is as follows:
[0115] For the scenario where the robot walks from the cargo area to the cargo area, Fig.14 This is the fourth schematic diagram of the experimental results of the path planning method in the prior art. Fig.14As shown, the path formed by the cells marked by all the grid points is the shortest path solved by the original A* algorithm, and the cells marked by the grid are the points traversed by the original A* algorithm when solving the shortest path.
[0116] For the scenario where the robot walks from the cargo area to the cargo area, Fig.15 FIG. 4 is a schematic diagram of the experimental results of path planning using strategy 2 provided by the present invention. Fig.15 As shown in the figure, the path formed by the cells marked by all the grid points is the shortest path solved by Strategy 2, and the cells marked by the grid are the points traversed when the shortest path is solved by Strategy 2. It can be seen that Strategy 2 is based on Strategy 1, which deletes the shortest path in the search process and only retains one shortest path, corresponding to Fig.15 The number of cells marked by the grid on the same shortest path is represented by Fig.14 The number of marked cells in the grid is reduced, which further improves the algorithm search efficiency.
[0117] It should be noted that the path planning method for the scenario where the robot walks from the workstation area to the cargo area is similar to the path planning method for the scenario where the robot walks from the cargo area to the workstation area, except that in the scenario where the robot walks from the workstation area to the cargo area, no transition node is involved, and the position of the marked starting intersection is different. For details, please refer to the path planning method for the scenario where the robot walks from the cargo area to the workstation area, and the present invention will not go into details here.
[0118] The path planning device provided by the present invention is described below. The path planning device described below and the path planning method described above can be referenced to each other.
[0119] Fig.16 is a schematic diagram of the structure of the path planning device provided by the present invention, such as Fig.16 As shown, the path planning device includes an acquisition unit 1610 and a first planning unit 1620; wherein:
[0120] The acquisition unit 1610 is used to acquire a target map; wherein the target map includes a cargo area;
[0121] A first planning unit 1620, configured to perform path planning for the cargo area according to a target path algorithm including a first heuristic function when determining that the target node is located in the cargo area;
[0122] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0123] The present invention provides a path planning device, in the process of traversing nodes on a target map, when it is determined that a target node adjacent to a current node is located in a cargo area, a path planning is performed on the cargo area according to a target path algorithm including a first heuristic function. The first heuristic function is jointly determined based on the target node, the target position and the target starting intersection corresponding to the target node. Since the target starting intersection is the point closest to the one-way road pointing to the target position, the distance error obtained by directly calculating the Manhattan distance determined by the target node and the target position can be compensated, thereby improving the algorithm search efficiency and further reducing the processing burden of the robot.
[0124] Based on any of the above embodiments, the first heuristic function is determined based on the sum of the Manhattan distance between the target node and the target starting intersection point and the Manhattan distance between the target starting intersection point and the target position.
[0125] Based on any of the above embodiments, the target map further includes a workstation area, the target location includes a target workstation, and the device further includes a second planning unit;
[0126] a second planning unit, configured to, when it is determined that the target node is located in the workstation area and when it is determined that the target node is not located in an area between the target workstation and the target transition node, perform path planning for the workstation area according to a target path algorithm including a second heuristic function;
[0127] Among them, the transition node is the entry point when entering the workstation area from the cargo area; the second heuristic function is determined based on the sum of the Manhattan distance between the target node and the target transition node and the Manhattan distance between the target transition node and the target workstation.
[0128] Based on any of the above embodiments, when it is determined that the target node is located in the workstation area, the device further includes a third planning unit;
[0129] a third planning unit, configured to, when determining that the target node is located in an area between the target workstation and the target transition node, perform path planning on the workstation area according to a target path algorithm including a third heuristic function;
[0130] The third heuristic function is determined based on the Manhattan distance between the target node and the target workstation.
[0131] Based on any of the above embodiments, the target path algorithm includes the product of a jitter factor and a target heuristic function; wherein the jitter factor includes a number greater than 1, and the target heuristic function includes one of the following: the first heuristic function, the second heuristic function and the third heuristic function.
[0132] Based on any of the above embodiments, the device further includes an adding unit;
[0133] An adding unit, used for adding a corresponding starting intersection to each group of one-way road signs on the target map;
[0134] Each group of the one-way road signs is obtained by dividing all the first one-way road signs and all the second one-way road signs; the first one-way road signs are signs on the road in the first direction; and the second one-way road signs are signs on the road in the second direction.
[0135] Fig.17 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Fig.17 As shown, the electronic device may include: a processor 1710, a communications interface 1720, a memory 1730 and a communication bus 1740, wherein the processor 1710, the communications interface 1720 and the memory 1730 communicate with each other via the communication bus 1740. The processor 1710 may call the logic instructions in the memory 1730 to execute the path planning method, which includes: obtaining a target map; wherein the target map includes a cargo area;
[0136] When it is determined that the target node is located in the cargo area, performing path planning for the cargo area according to a target path algorithm including a first heuristic function;
[0137] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0138] In addition, the logic instructions in the above-mentioned memory 1730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0139] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the path planning method provided by the above methods, the method comprising: obtaining a target map; wherein the target map includes a cargo area;
[0140] When it is determined that the target node is located in the cargo area, performing path planning for the cargo area according to a target path algorithm including a first heuristic function;
[0141] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0142] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the path planning method provided by the above methods, the method comprising: obtaining a target map; wherein the target map includes a cargo area;
[0143] When it is determined that the target node is located in the cargo area, performing path planning for the cargo area according to a target path algorithm including a first heuristic function;
[0144] Among them, the target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position and the target starting intersection corresponding to the target node; the target starting intersection is the point closest to the one-way road pointing to the direction of the target position.
[0145] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A path planning method, characterized in that: include: Adding a corresponding starting intersection to each group of one-way road signs on the target map; wherein each group of the one-way road signs is obtained by dividing all the first one-way road signs and all the second one-way road signs; the first one-way road signs are signs on the first direction road; the second one-way road signs are signs on the second direction road; Acquire a target map; wherein the target map includes a cargo area; When it is determined that the target node is located in the cargo area, performing path planning for the cargo area according to a target path algorithm including a first heuristic function; The target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position, and the target starting intersection corresponding to the target node; the target starting intersection is the starting intersection closest to the one-way road pointing to the target position. The target map also includes a workstation area, the target location includes a target workstation, and after acquiring the target map, the method further includes: When it is determined that the target node is located in the workstation area, and when it is determined that the target node is not located in the area between the target workstation and the target transition node, performing path planning for the workstation area according to a target path algorithm including a second heuristic function; wherein the transition node is an entry point from the cargo area into the workstation area; the second heuristic function is determined based on the sum of the Manhattan distance between the target node and the target transition node and the Manhattan distance between the target transition node and the target workstation; When determining that the target node is located in the workstation area, the method further includes: In the case where it is determined that the target node is located in the area between the target workstation and the target transition node, path planning is performed on the workstation area according to a target path algorithm including a third heuristic function; wherein the third heuristic function is determined based on the Manhattan distance between the target node and the target workstation; The target path algorithm comprises a product of a jitter factor and a target heuristic function; wherein the jitter factor comprises a number greater than 1, and the target heuristic function comprises one of: the first heuristic function, the second heuristic function, and the third heuristic function.
2. The path planning method according to claim 1, characterized in that: The first heuristic function is determined based on the sum of the Manhattan distance between the target node and the target starting intersection point and the Manhattan distance between the target starting intersection point and the target position.
3. A path planning device, characterized in that: include: An adding unit, used for adding a corresponding starting intersection to each group of one-way road signs on the target map; wherein each group of the one-way road signs is obtained by dividing all the first one-way road signs and all the second one-way road signs; the first one-way road signs are signs on the first direction road; the second one-way road signs are signs on the second direction road; An acquisition unit, used for acquiring a target map; wherein the target map includes a cargo area; a first planning unit, configured to, when determining that a target node is located in the cargo area, perform path planning for the cargo area according to a target path algorithm including a first heuristic function; The target node is an adjacent node of the current node, and the first heuristic function is determined according to the target node, the target position, and the target starting intersection corresponding to the target node; the target starting intersection is the starting intersection closest to the one-way road pointing to the target position. The target map also includes a workstation area, the target location includes a target workstation, and the device further includes: a second planning unit, configured to plan a path for the workstation area according to a target path algorithm including a second heuristic function when it is determined that the target node is located in the workstation area and when it is determined that the target node is not located in an area between the target workstation and a target transition node; wherein the transition node is an entry point when entering the workstation area from the cargo area; and the second heuristic function is determined based on the sum of the Manhattan distance between the target node and the target transition node and the Manhattan distance between the target transition node and the target workstation; a third planning unit, configured to, when it is determined that the target node is located in the workstation area and when it is determined that the target node is located in the area between the target workstation and the target transition node, perform path planning for the workstation area according to a target path algorithm including a third heuristic function; wherein the third heuristic function is determined based on the Manhattan distance between the target node and the target workstation; The target path algorithm comprises a product of a jitter factor and a target heuristic function; wherein the jitter factor comprises a number greater than 1, and the target heuristic function comprises one of: the first heuristic function, the second heuristic function, and the third heuristic function.
4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the path planning method as claimed in claim 1 or 2 are implemented.
5. A non-transitory 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 path planning method according to any one of claims 1 or 2 are implemented.
