Global path planning method and mobile robot
By setting the node expansion threshold in Dijkstra's algorithm to a larger value for the grid cost of the start and end points, and gradually increasing the threshold, the problem of low path search quality in Dijkstra's algorithm is solved, and a better path search is achieved.
Patent Information
- Application Number
- CN202310496268.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-05-04
AI Technical Summary
In existing Dijkstra algorithms, the preset threshold for node expansion is usually a fixed value, which makes it impossible to find a better path and results in low path search quality.
Set the node expansion threshold to the larger value of the raster cost at the start and end points, and gradually increase the node expansion threshold until a global path is found.
It improves the quality of path search, ensuring that better paths are found and avoiding excessively high path point costs, thus enhancing the effectiveness of path search.
Smart Images

Figure CN118896603B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of path planning technology, and in particular to a global path planning method and a mobile robot. Background Technology
[0002] Global path planning refers to planning a global path connecting a starting point and a destination. A commonly used global path planning algorithm is Dijkstra's algorithm, which is based on the breadth-first search principle. Dijkstra's algorithm is a typical shortest path algorithm used to calculate the shortest path from a given node to all other nodes. It expands outwards layer by layer from the starting point until it reaches the destination.
[0003] Currently, in the Dijkstra algorithm's node expansion process, a node is only expanded if its cost value on the grid map is less than a preset threshold. Since the preset threshold is usually set to a fixed value, it may prevent the finding of better paths. Furthermore, if the preset threshold is set too high, it can result in situations where the cost values of various path points in the global path search are too high, leading to poor path search quality. Summary of the Invention
[0004] This application provides a global path planning method and a mobile robot. By setting the node expansion threshold to the larger of the grid cost value of the starting point and the grid cost value of the ending point, the method performs path search by gradually increasing the node expansion threshold, thereby improving the quality of path search.
[0005] The embodiments of this application provide the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a global path planning method, which includes:
[0007] Obtain the raster cost array, which stores the raster cost value of each raster in the raster map;
[0008] Obtain the raster generation value corresponding to the starting point and the raster generation value corresponding to the ending point, and set the node expansion threshold to the larger of the raster generation value of the starting point and the raster generation value of the ending point.
[0009] Perform global path search based on node expansion threshold;
[0010] If the global path search fails, the node expansion threshold is increased. Based on the increased node expansion threshold, the path search is performed again until the global path is found and determined.
[0011] In some embodiments, global path search is performed based on a node expansion threshold, including:
[0012] Initialize the search cost array, priority queue, parent node array, and minimum cost array;
[0013] Obtain the index value of the starting point in the grid map, initialize the search cost value corresponding to the starting point to zero, and add the starting point to the priority queue, wherein the priority queue is sorted according to the search cost value of the nodes in ascending order;
[0014] Get the first node in the priority queue;
[0015] Get the minimum cost value corresponding to the index value of the first node;
[0016] If the minimum cost value corresponding to the index value of the first node is equal to positive infinity, then add the first node to the minimum cost array and update the minimum cost value corresponding to the first node in the minimum cost array to the search cost value corresponding to the first node.
[0017] Search for the surrounding nodes of the first node in the grid map in a preset order. The surrounding nodes are at least one of the following nodes in the grid map: the left node, right node, top node, bottom node, top-left node, top-right node, bottom-left node, and bottom-right node of the first node.
[0018] Expand the surrounding nodes until all surrounding nodes of the first node have been traversed;
[0019] After the first node is expanded, the next node in the priority queue is taken as the first node, and the first node in the current priority queue is searched until the index value of the first node in the priority queue is equal to the index value of the destination in the grid map.
[0020] In some embodiments, if the surrounding nodes are one of the nodes to the left, right, top, or bottom of the first node in the grid map, the surrounding nodes are expanded, including:
[0021] If the surrounding nodes satisfy the first condition, then the expansion of the current surrounding nodes ends and the next surrounding node is searched.
[0022] If the surrounding nodes do not meet the first condition, then it is further determined whether the surrounding nodes meet the second condition. If the surrounding nodes meet the second condition, the search cost of the surrounding nodes is updated to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset extended cost. In addition, the index value of the surrounding nodes in the parent node array is determined to be the index value of the first node.
[0023] If the surrounding nodes do not meet the second condition, then search for the next surrounding node, until all surrounding nodes of the first node have been traversed.
[0024] In some embodiments, the first condition includes:
[0025] The index values of the surrounding nodes are less than the minimum index value of the raster map;
[0026] Alternatively, the index value of the surrounding nodes is greater than the maximum index value of the raster map, where the maximum index value of the raster map = the number of grid cells in the horizontal direction of the raster map * the number of grid cells in the vertical direction of the raster map - 1.
[0027] Alternatively, the minimum cost corresponding to the index value of the surrounding nodes is less than positive infinity;
[0028] Alternatively, the raster cost corresponding to the index value of the surrounding nodes is greater than the node expansion threshold.
[0029] The second condition includes:
[0030] The search value of surrounding nodes is greater than the sum of the search value of the first node, the grid value of the first node, and the preset expansion value.
[0031] In some embodiments, if the surrounding nodes are one of the top-left, top-right, bottom-left, and bottom-right nodes of the first node in the raster map, the surrounding nodes are expanded, including:
[0032] If the surrounding nodes satisfy the third condition, then the expansion of the surrounding nodes ends and the next surrounding node is searched until the top left, top right, bottom left, and bottom right nodes of the first node are traversed.
[0033] If the surrounding nodes do not meet the third condition, then it is further determined whether the surrounding nodes meet the fourth condition. If the surrounding nodes meet the fourth condition, then the search cost of the surrounding nodes is updated to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset coefficient * the preset extended cost. In addition, the index value of the surrounding nodes in the parent node array is determined to be the index value of the first node.
[0034] If the surrounding nodes do not satisfy the fourth condition, then search for the next surrounding node, and so on, until all surrounding nodes of the first node have been traversed.
[0035] In some embodiments, the third condition includes:
[0036] The index values of the surrounding nodes are less than the minimum index value of the raster map;
[0037] Alternatively, the index value of the surrounding nodes is greater than the maximum index value of the raster map, where the maximum index value of the raster map = the number of grid cells in the horizontal direction of the raster map * the number of grid cells in the vertical direction of the raster map - 1.
[0038] Alternatively, the minimum cost corresponding to the index value of the surrounding nodes is less than positive infinity;
[0039] Alternatively, the raster cost corresponding to the index value of the surrounding nodes is greater than the node expansion threshold.
[0040] Alternatively, the index value of the neighboring nodes of the surrounding node is greater than the minimum index value of the raster map, wherein the neighboring nodes of the surrounding node include the left, right, upper, and lower nodes of the surrounding node in the raster map, and the index value of the neighboring nodes of the surrounding node is less than the maximum index value of the raster map, and the raster cost value corresponding to the index value of the neighboring nodes of the surrounding node is greater than the node expansion threshold.
[0041] The fourth condition includes:
[0042] The search value of surrounding nodes is greater than the sum of the search value of the first node, the grid value of the first node, and the preset coefficient multiplied by the preset extension value.
[0043] In some embodiments, after retrieving the first node in the priority queue, the method further includes:
[0044] Determine if the index value of the first node is equal to the index value of the endpoint in the raster map;
[0045] If so, then confirm that the node search is complete and determine the global path;
[0046] If not, then obtain the minimum cost value corresponding to the first node.
[0047] In some embodiments, determining the global path includes:
[0048] Initialize the current index value to the index value of the endpoint;
[0049] Add the coordinates of the raster corresponding to the current index value to the end of the path queue;
[0050] If the current index value is not equal to the starting index value, then repeat the following steps:
[0051] Add the coordinates of the grid corresponding to the parent node of the current index value to the end of the path queue. Then, assign the index value of the grid corresponding to the parent node of the current index value to the current index value. Repeat this assignment until the current index value is equal to the index value of the starting point.
[0052] After the current index value equals the starting index value, reverse the order of all nodes in the path queue to obtain the global path.
[0053] In some embodiments, the method further includes:
[0054] When expanding the first node in the priority queue, check whether the current loop count is greater than a preset threshold.
[0055] If the current number of iterations exceeds the preset threshold, the node expansion threshold is increased to perform a new search.
[0056] In some embodiments, the cost value of each grid cell in the grid cost array is within the same value range, and increasing the node expansion threshold includes:
[0057] The new node expansion threshold = node expansion threshold + step value, where the new node expansion threshold is not greater than the maximum preset grid cost value.
[0058] Secondly, embodiments of this application provide a mobile robot, including:
[0059] At least one processor; and
[0060] A memory that is communicatively connected to at least one processor; wherein,
[0061] The memory stores instructions that can be executed by at least one processor, such that at least one processor can perform a global path planning method as described in the first aspect.
[0062] The beneficial effects of the embodiments of this application are as follows: Unlike existing technologies, the embodiments of this application provide a global path planning method, which includes: obtaining a grid cost array, wherein the grid cost array is used to store the grid cost value of each grid in the grid map; obtaining the grid cost value corresponding to the starting point and the grid cost value corresponding to the ending point, and setting a node expansion threshold to the larger of the grid cost values of the starting point and the ending point; performing a global path search based on the node expansion threshold; if the global path search fails, increasing the node expansion threshold, and re-performing the path search based on the increased node expansion threshold until a global path is found and determined. By setting the node expansion threshold to the larger of the grid cost values of the starting point and the ending point, and by using a method of gradually increasing the node expansion threshold for path search, this application can improve the quality of path search. Attached Figure Description
[0063] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0064] Figure 1 This is a schematic diagram of an application environment provided in an embodiment of this application;
[0065] Figure 2 This is a flowchart illustrating a global path planning method provided in an embodiment of this application;
[0066] Figure 3 yes Figure 2 A detailed flowchart of step S203 in the process;
[0067] Figure 4 This is a flowchart illustrating a scenario where the surrounding nodes are one of the left, right, top, and bottom nodes of the first node in a grid map, as provided in an embodiment of this application.
[0068] Figure 5 This is a flowchart illustrating a scenario where the surrounding nodes are one of the top-left, top-right, bottom-left, and bottom-right nodes of the first node in a grid map, as provided in an embodiment of this application.
[0069] Figure 6 This is a flowchart illustrating a process for determining whether the index value of the first node is equal to the index value of the endpoint in the grid map, provided in an embodiment of this application.
[0070] Figure 7 yes Figure 6 A detailed flowchart of step S602 in the process;
[0071] Figure 8 This is a flowchart illustrating a method for determining whether the current number of iterations is greater than a preset threshold, provided in an embodiment of this application.
[0072] Figure 9 yes Figure 2 A detailed flowchart of step S204 in the process;
[0073] Figure 10 This is a schematic diagram of the structure of a global path planning device provided in an embodiment of this application;
[0074] Figure 11 This is a schematic diagram of the structure of a mobile robot provided in an embodiment of this application.
[0075] Explanation of icon numbers:
[0076] label name label name 100 Application Environment 10 Mobile robots 20 server 30 terminal equipment 101 Global path planning device 1011 Data acquisition unit 1012 Path search unit 110 Mobile robots 111 processor 112 memory Detailed Implementation
[0077] To facilitate understanding of this application, a more detailed description is provided below with reference to the accompanying drawings and specific embodiments. It should be noted that when an element is described as "fixed to" another element, it can be directly on the other element, or one or more intermediate elements may exist between them. When an element is described as "connected to" another element, it can be directly connected to the other element, or one or more intermediate elements may exist between them. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this specification are for illustrative purposes only.
[0078] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0079] The technical solution of this application is described in detail below with reference to the accompanying drawings:
[0080] Please see Figure 1 , Figure 1 This is a schematic diagram of an application environment provided in an embodiment of this application;
[0081] like Figure 1 As shown, the application environment 100 includes a mobile robot 10, a server 20, and a terminal device 30. The mobile robot 10 is connected to the server 20 via a network, and the server 20 is connected to the terminal device 30 via a network. This network includes wired and / or wireless networks. It is understood that the network includes wireless networks such as 2G, 3G, 4G, 5G, Wi-Fi, and Bluetooth, and may also include wired networks such as serial cables and Ethernet cables.
[0082] In this embodiment, the mobile robot 10 includes a main body, drive wheel components, a communication module, and a controller. The main body can be generally elliptical, triangular, D-shaped, or other shapes. The controller is disposed on the main body, and the drive wheel components are mounted on the main body for driving the mobile robot to move.
[0083] In this embodiment, the drive wheel component includes a left drive wheel, a right drive wheel, and an omnidirectional wheel. The left and right drive wheels are respectively mounted on opposite sides of the main body. The omnidirectional wheel is mounted at the front of the bottom of the main body and is a movable caster that can rotate 360 degrees horizontally, allowing the mobile robot to turn flexibly. The left drive wheel, right drive wheel, and omnidirectional wheel are arranged in a triangle to improve the stability of the mobile robot's movement.
[0084] In this embodiment, the communication module is connected to the server and is used to receive data sent by the server, such as starting and ending commands sent by the server; or sending a planned global path to the terminal device. In this embodiment, the communication module can communicate with the Internet, and includes, but is not limited to, communication units such as a WIFI module, ZigBee module, NB-IoT module, 4G module, 5G module, and Bluetooth module.
[0085] In this embodiment, the controller is located inside the main body and is electrically connected to the left drive wheel, right drive wheel, and omnidirectional wheel. As the control core of the mobile robot, the controller is used to control the robot to move to a designated location and perform some logical processing. For example: obtaining the grid cost array, obtaining the grid cost value corresponding to the starting point and the grid cost value corresponding to the ending point, setting the node expansion threshold to the larger of the grid cost values of the starting point and the ending point, performing a global path search based on the node expansion threshold, and increasing the node expansion threshold if the global path search fails. The path search is then repeated based on the increased node expansion threshold until a global path is found and determined.
[0086] In the embodiments of this application, the controller can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a microcontroller, an ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. The controller can also be any conventional processor, controller, microcontroller, or state machine. The controller can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration, or one or more combinations of a microcontroller unit (MCU), a field-programmable gate array (FPGA), and a system-on-chip (SoC).
[0087] It is understood that the mobile robot 10 in this application embodiment also includes a storage module, which includes, but is not limited to, one or more of the following devices: FLASH flash memory, NAND flash memory, vertical NAND flash memory (VNAND), NOR flash memory, resistive random access memory (RRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), spin-transfer torque random access memory (STT-RAM).
[0088] In this embodiment, the server 20 communicates with the mobile robot 10 and the terminal device 30, and is used to send instructions to the mobile robot 10, such as sending a start instruction or a path planning termination instruction. There are multiple servers 20, which can form a server cluster. For example, the server cluster may include a first server, a second server, ..., an Nth server; or, the server cluster may be a cloud computing service center comprising several servers. The servers in this embodiment include, but are not limited to, tower servers, rack servers, blade servers, and cloud servers. Preferably, the server is a cloud server (Elastic Compute Service, ECS).
[0089] In this embodiment, the terminal device 30 is communicatively connected to the mobile robot 10 and is used to receive the path plan planned by the mobile robot 10. There are multiple terminals 40, including but not limited to: landline telephones, mobile communication devices, mobile personal computer devices, or other electronic devices with internet access capabilities.
[0090] Currently, in the Dijkstra algorithm's node expansion process, a node is only expanded if its cost value on the grid map is less than a preset threshold. Since the preset threshold is usually set to a fixed value, it may prevent the finding of better paths. Furthermore, if the preset threshold is set too high, it can result in situations where the cost values of various path points in the global path search are too high, leading to poor path search quality.
[0091] Based on this, this application provides a global path planning method to improve the quality of path search.
[0092] Please see Figure 2 , Figure 2 This is a flowchart illustrating a global path planning method provided in an embodiment of this application;
[0093] This global path planning method is applied to mobile robots. Specifically, the execution entity of this global path planning method is one or more processors of the mobile robot.
[0094] like Figure 2 As shown, this global path planning method includes:
[0095] Step S201: Obtain the raster cost array;
[0096] In this embodiment, the size and area of the constructed grid cost map are determined according to the scope of the path planning. Based on the occupancy of obstacles in each grid in the grid cost map, the cost value of each grid is set. The range of the grid cost value is set to [0, 255]. Since the cost value of a grid completely occupied by obstacles is 255, and so on, the farther away from the obstacle, the smaller the cost value of the grid and gradually decreases to 0. Therefore, when calculating the cost value of each grid, an equivalent calculation cannot be used. A decay process is required, that is, a decay function of the grid cost value is designed according to the actual situation. The decay function may be an exponential function or a logarithmic function. This application does not limit this.
[0097] Specifically, based on the raster cost map, a raster cost array (map_cost) is constructed to store the raster cost value of each raster in the raster cost map. The raster cost value of each raster in the raster cost array is within the same value range, for example, the value range is [0, 255].
[0098] Step S202: Obtain the raster generation value corresponding to the starting point and the raster generation value corresponding to the ending point, and set the node expansion threshold to the larger value between the raster generation value of the starting point and the raster generation value of the ending point.
[0099] Specifically, in the grid cost map, a start point and an end point are selected, each located within a different grid cell. The grid cost value corresponding to the start point and the grid cost value corresponding to the end point are obtained respectively. The node expansion threshold is set to the larger of the grid cost values of the start point and the end point. The node expansion threshold is a preset indicator for determining whether to expand the next node. For example, if the grid cost value of the next node is greater than the node expansion threshold, it means that the grid cost value of the next node in the grid cost map is too high, and it is too close to obstacles. If the node is expanded further, collisions or wall penetrations may occur, so the node cannot be expanded. When the grid cost value of the next node is less than or equal to the node expansion threshold, it means that the node can be expanded.
[0100] Step S203: Perform a global path search based on the node expansion threshold;
[0101] Please refer to the following: Figure 3 , Figure 3 yes Figure 2 A detailed flowchart of step S203 in the process;
[0102] like Figure 3 As shown, global path search is performed based on the node expansion threshold, including:
[0103] Step S2031: Initialize the search cost array, priority queue, parent node array, and minimum cost array;
[0104] Specifically, the search cost array is initialized, with its initial value set to positive infinity. This array stores the search cost value of each node during the search process. A priority queue is initialized; this queue is an open set used in the Dijkstra algorithm search process. Each element in the priority queue contains the index and search cost value of each node. For example, costs[i] represents the search cost value of the i-th node. A parent node array is initialized to store the index of each node's parent node. A potential minimum cost array is initialized; this array is a closed set used in the Dijkstra algorithm search process, storing the minimum cost value from the starting grid to the current grid. The minimum cost value of each element in the potential minimum cost array is initialized to positive infinity. A positive infinity minimum cost value for a node indicates that the minimum cost value from the starting grid to that node has not yet been found. In other words, if the cost value of a node in this closed set is positive infinity, it means that the minimum cost value for that node in the closed set has not yet been updated.
[0105] In this embodiment of the application, according to the principle of Dijkstra's algorithm, in each iteration, the search cost value of the first node taken out from the priority queue is the minimum search cost value from the starting point to that node. That is to say, no matter how much the search is performed afterward, a path with a smaller cost value (search cost value) from the starting point to that node will not be found. Therefore, the search cost value corresponding to the first node in the priority queue needs to be put into the minimum cost array, and subsequent algorithm operations will not update the cost value of that node.
[0106] Step S2032: Obtain the index value of the starting point in the grid map, initialize the search cost value corresponding to the starting point to zero, and add the starting point to the priority queue;
[0107] Specifically, obtain the index value (start_i) of the starting point (start) in the grid map, set the search cost value (costs[start_i]) of the starting point to 0, and combine the index value (start_i) of the starting point in the grid map and the search cost value (costs[start_i]) of the starting point into a set of data and store it in a priority queue. The priority queue will automatically sort the data stored in the queue and can guarantee that the search cost value of the first element in the queue is minimized.
[0108] In this embodiment of the application, assuming that the number of grids in the x-direction of the grid map is nx and the number of grids in the y-direction is ny, the index value of each grid in the grid map is set to a minimum of 0 and a maximum of (nx*ny)-1.
[0109] Step S2033: Obtain the first node in the priority queue;
[0110] In the embodiments of this application, each loop includes: step S2033, step S2034, step S2035, step 2036, step 2037, and step 2038.
[0111] Specifically, execute the current loop, retrieve the first node top from the priority queue, and obtain the index value top.index of the first node top.
[0112] Step S2034: Obtain the minimum cost value corresponding to the index value of the first node;
[0113] Specifically, based on the index value top.index of the first node, obtain the minimum cost value costs[top.index] corresponding to the index value of the first node.
[0114] Step S2035: If the minimum cost value corresponding to the index value of the first node is equal to positive infinity, then add the first node to the minimum cost array and update the minimum cost value corresponding to the first node in the minimum cost array to the search cost value corresponding to the first node.
[0115] Specifically, if the minimum cost value corresponding to the index of the first node is equal to positive infinity, it means that the node has not been added to the minimum cost array (potential). The first node `top` in the priority queue is then added to the minimum cost array (potential), resulting in `potential[top.index] = costs[top.index]`, and step S2036 continues. In other words, if the first node in the priority queue is added to the minimum cost array, it means that the shortest path from the starting point to the first node `top` in the priority queue has been found. Even after subsequent operations to find the shortest path from the starting point to each node in the non-minimum cost array set, it is impossible to find a shorter path from the starting point to the first node `top` in the priority queue. Therefore, the elements in the minimum cost array will not be updated. The minimum cost value corresponding to the first node in the minimum cost array is then updated to the search cost value corresponding to the first node.
[0116] If the cost value (potential[top.index]) of the first node in the minimum cost array is less than positive infinity, it means that the node has been added to the closed set. Then, execute the next loop and repeat steps S2033, S2034, S2035, 2036, 2037, and 2038.
[0117] Step S2036: Search for the surrounding nodes of the first node in the grid map according to the preset order;
[0118] Specifically, following a preset order, the surrounding nodes of the first node in the grid map are searched. In the embodiments of this application, the surrounding nodes of the first node in the grid map include the left, right, top, bottom, top-left, top-right, bottom-left, and bottom-right nodes of the first node. The preset order is to sequentially traverse the left, right, top, bottom, top-left, top-right, bottom-left, and bottom-right nodes of the first node for node expansion. The expansion methods for the first four nodes (left, right, top, and bottom) are the same, while the expansion methods for the last four nodes (top-left, top-right, bottom-left, and bottom-right) are the same but different from the first four nodes.
[0119] It should be noted that the preset order of searching surrounding nodes can be set according to actual needs, but this application does not limit the order of searching surrounding nodes.
[0120] Step S2037: Expand the surrounding nodes until all surrounding nodes of the first node have been traversed;
[0121] Please refer to the following: Figure 4 , Figure 4 This is a flowchart illustrating a scenario where the surrounding nodes are one of the left, right, top, and bottom nodes of the first node in a grid map, as provided in an embodiment of this application.
[0122] like Figure 4 As shown, if the surrounding nodes are one of the nodes to the left, right, top, or bottom of the first node in the grid map:
[0123] Step S401: If the surrounding node is one of the left, right, top, or bottom nodes of the first node in the grid map, expand the surrounding nodes;
[0124] Specifically, if the surrounding node is one of the left, right, top, or bottom nodes of the first node in the grid map, then the preset expansion method of the left, right, top, and bottom nodes will be used for expansion.
[0125] Step S402: Determine whether the surrounding nodes satisfy the first condition;
[0126] Specifically, the preset first conditions include: the index value of the surrounding nodes is less than the minimum index value of the raster map; or, the index value of the surrounding nodes is greater than the maximum index value of the raster map, where the maximum index value of the raster map = the number of graticles in the horizontal direction of the raster map * the number of graticles in the vertical direction of the raster map - 1; or, the minimum cost value corresponding to the index value of the surrounding nodes is less than positive infinity; or, the raster cost value corresponding to the index value of the surrounding nodes is greater than the node expansion threshold.
[0127] If the surrounding node satisfies any of the first conditions, it means that the surrounding node cannot be expanded, and step S403 is executed; if the surrounding node does not satisfy the first condition, it means that the surrounding node can be expanded, and step S404 is executed.
[0128] Step S403: End the expansion of the current surrounding nodes and search for the next surrounding node;
[0129] Specifically, when a surrounding node satisfies the first condition, the expansion of the current surrounding node ends, and the search for the next surrounding node continues. For example, if the current surrounding node is the left node of the first node, the expansion of the left node ends, and the search continues for one of the following nodes: the right node, the node above, or the node below the first node. The condition that potential[next_index] is less than positive infinity indicates that the second condition is used to determine whether the surrounding node has already been added to the minimum cost array of the closed set.
[0130] Step S404: Determine whether the surrounding nodes satisfy the second condition;
[0131] Specifically, if the surrounding nodes do not meet the first condition, then it is further determined whether the surrounding nodes meet the second condition. The preset second condition includes: the search value of the surrounding nodes is greater than the search value of the first node, the grid value of the first node, and the preset expansion value.
[0132] If the surrounding nodes do not meet the second condition, proceed to step S405; if the surrounding nodes meet the second condition, proceed to step S406.
[0133] Step S405: Search for the next surrounding node, until all surrounding nodes of the first node have been traversed;
[0134] Specifically, if the surrounding nodes do not meet the second condition, then search the next surrounding node of the first node, until all surrounding nodes of the first node are traversed.
[0135] Step S406: Update the search cost of the surrounding nodes to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset extended cost, and determine the index value of the surrounding nodes in the parent node array as the index value of the first node.
[0136] Specifically, when a surrounding node satisfies the second condition, i.e., the value of costs[next_index] is positive infinity or the value of costs[next_index] is less than positive infinity, the cost of that node is updated. The search cost of the surrounding nodes is then updated to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset expansion cost. Let costs[next_index] = top.cost + map_cost[index] + neural_cost. The parent node information of that node is recorded, and the index value of the surrounding node in the parent node array is determined as the index value of the first node. Let parent[next_index] = top.index. Where top.cost represents the search cost of the first node, map_cost[index] represents the grid cost of the first node in the grid cost array, neural_cost represents the preset extension cost, which represents the cost of extending from node index to next_index. It can be set to any value between 0 and 255 according to actual needs, and parent[next_index] represents the index value of the surrounding nodes in the parent node array. The preset extension cost value ranges from (0, 255).
[0137] Please refer to the following: Figure 5 , Figure 5 This is a flowchart illustrating a scenario where the surrounding nodes are one of the top-left, top-right, bottom-left, and bottom-right nodes of the first node in a grid map, as provided in an embodiment of this application.
[0138] like Figure 5 As shown, if the surrounding nodes are one of the following nodes in the grid map: the top-left node, the top-right node, the bottom-left node, or the bottom-right node of the first node:
[0139] Step S501: If the surrounding node is one of the top left, top right, bottom left, and bottom right nodes of the first node in the grid map, expand the surrounding nodes;
[0140] Specifically, if the surrounding node is one of the top-left, top-right, bottom-left, or bottom-right nodes of the first node in the grid map, then the expansion is performed using the preset expansion method of the top-left, top-right, bottom-left, and bottom-right nodes.
[0141] Step S502: Determine whether the surrounding nodes satisfy the third condition;
[0142] Specifically, the preset third condition includes: the index value of the surrounding node is less than the minimum index value of the raster map; or, the index value of the surrounding node is greater than the maximum index value of the raster map, wherein the maximum index value of the raster map = the number of grids in the horizontal direction of the raster map * the number of grids in the vertical direction of the raster map - 1; or, the minimum cost value corresponding to the index value of the surrounding node is less than positive infinity; or, the raster cost value corresponding to the index value of the surrounding node is greater than the node expansion threshold; or, the index value of the neighboring node of the surrounding node is greater than the minimum index value of the raster map, wherein the neighboring nodes of the surrounding node include the left, right, upper, and lower nodes of the surrounding node in the raster map, and the index value of the neighboring node of the surrounding node is less than the maximum index value of the raster map, and the raster cost value corresponding to the index value of the neighboring node of the surrounding node is greater than the node expansion threshold.
[0143] If the surrounding nodes meet the third condition mentioned above, it means that the surrounding nodes cannot be expanded. For example, when the index value of the neighboring nodes of the surrounding node is greater than the minimum index value of the raster map, and the index value of the neighboring nodes of the surrounding node is less than the maximum index value of the raster map, and the raster cost corresponding to the index value of the neighboring nodes of the surrounding node is greater than the node expansion threshold, although the raster cost corresponding to the index value of the surrounding node is less than the node expansion threshold, since the raster cost of one of the neighboring nodes above, below, left, and right of the surrounding node is very high, if the surrounding node is expanded, a wall-penetrating phenomenon may occur. Therefore, the surrounding node cannot be expanded at this time, and step S503 is executed. If the surrounding node does not meet any of the third conditions, it means that the surrounding node can be expanded, and step S504 is executed.
[0144] Step S503: End the expansion of the current surrounding nodes and search for the next surrounding node;
[0145] Specifically, when the surrounding nodes meet the third condition, the expansion of the current surrounding nodes ends and the next surrounding node is searched. For example, if the current surrounding node is the top left node of the first node, the expansion of the top left node ends and one of the top right, bottom left, and bottom right nodes of the first node is searched.
[0146] Step S504: Determine whether the surrounding nodes satisfy the fourth condition;
[0147] Specifically, when surrounding nodes do not meet the third condition, it is further determined whether surrounding nodes meet the fourth condition. The preset fourth condition includes: the search value of surrounding nodes is greater than the search value of the first node, the grid value of the first node, and the sum of the preset coefficient * the preset extended value. That is, the fourth condition is used to determine whether a smaller value for the node has been found. If the search value of surrounding nodes is greater than the sum of the search value of the first node, the grid value of the first node, and the preset coefficient * the preset extended value, it means that a smaller value for the node has been found. If the search value of surrounding nodes is not greater than the sum of the search value of the first node, the grid value of the first node, and the preset coefficient * the preset extended value, it means that a smaller value for the node has not been found. The extended value can be set to any value between 0 and 255, such as 50. In this embodiment, since the top-left node, top-right node, bottom-left node, and bottom-right node are located diagonally opposite the first node in the priority queue, the preset coefficient can be set to... The settings can also be adjusted according to the actual situation; this application does not impose any restrictions on this.
[0148] If the surrounding nodes do not meet the fourth condition, then proceed to step S505; if the surrounding nodes meet the fourth condition, then proceed to step S506.
[0149] Step S505: Search for the next surrounding node, until all surrounding nodes of the first node have been traversed;
[0150] Specifically, if the surrounding nodes do not satisfy the fourth condition, then search the next surrounding node of the first node, until all surrounding nodes of the first node are traversed.
[0151] Step S506: Update the search cost of the surrounding nodes to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset coefficient * preset extended cost, and determine the index value of the surrounding nodes in the parent node array as the index value of the first node.
[0152] Specifically, when a surrounding node satisfies the fourth condition, its cost is updated. The search cost of this surrounding node is then updated to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset coefficient multiplied by the preset extended cost. Let's assume the preset coefficient is... make It records the parent node information of the current node, and determines the index value of the surrounding nodes in the parent node array as the index value of the first node, setting parent[next_index] = top.index. Here, top.cost represents the search cost of the first node, map_cost[index] represents the raster cost value of the first node in the raster cost array, neural_cost represents the preset expansion cost value, and parent[next_index] represents the index value of the surrounding nodes in the parent node array.
[0153] Step S2038: After the first node is expanded, take the next node in the priority queue as the first node, and search the first node in the current priority queue until the index value of the first node in the priority queue is equal to the index value of the destination in the grid map.
[0154] Specifically, after traversing the left, right, top, bottom, top-left, top-right, bottom-left, and bottom-right nodes of the first node, the expansion of the first node is completed. Then, the next node in the priority queue is taken as the first node, and the next loop is executed. At this time, the first node of the current priority queue is the surrounding nodes of the first node in the previous loop. The left, right, top, bottom, top-left, top-right, bottom-left, and bottom-right nodes of the first node of the current priority queue are searched and the nodes are expanded. This process continues until the index value of the first node in the priority queue is equal to the index value of the endpoint in the grid map.
[0155] This application also provides a method for determining whether the index value of the first node is equal to the index value of the endpoint in the raster map:
[0156] Please refer to the following: Figure 6 , Figure 6 This is a flowchart illustrating a process for determining whether the index value of the first node is equal to the index value of the endpoint in the grid map, provided in an embodiment of this application.
[0157] like Figure 6 As shown, the method for determining whether the index value of the first node is equal to the index value of the endpoint in the raster map includes:
[0158] Step S601: Obtain the index value of the first node;
[0159] Specifically, based on the grid map, obtain the index value of the first node in the priority queue.
[0160] Step S602: Determine whether the index value of the first node is equal to the index value of the endpoint in the raster map;
[0161] Specifically, based on the index value of the first node and the index value of the destination in the grid map, it is determined whether the index value of the first node is equal to the index value of the destination in the grid map. If the index value of the first node is equal to the index value of the destination in the grid map, then proceed to step S603; if the index value of the first node is not equal to the index value of the destination in the grid map, then proceed to step S604.
[0162] Step S603: Determine that the node search is complete and determine the global path;
[0163] Please refer to the following: Figure 7 , Figure 7 yes Figure 6 A detailed flowchart of step S603 in the process;
[0164] like Figure 7As shown, the node search is complete, and the global path is determined, including:
[0165] Step S6031: Initialize the current index value to the index value of the endpoint;
[0166] Specifically, based on the index value of the destination, the current index value is set to the index value of the destination.
[0167] In this embodiment of the application, current_index is initialized to goal_index.
[0168] Step S6032: Add the coordinates of the raster corresponding to the current index value to the end of the path queue;
[0169] Specifically, the coordinates of the raster corresponding to the current index value (current_index) are stored at the end of the path queue (path).
[0170] Step S6033: Determine whether the current index value is equal to the starting index value;
[0171] Specifically, determine whether the current index value is equal to the starting index value. If the current index value is equal to the starting index value, proceed to step S6025; if the current index value is not equal to the starting index value, proceed to step S6024.
[0172] Step S6034: Add the coordinates of the grid corresponding to the parent node of the current index value to the end of the path queue, and assign the index value of the grid corresponding to the parent node of the current index value to the current index value, and repeat the assignment.
[0173] Specifically, when the current index value is not equal to the starting index value, that is, when current_index is not equal to start_index, the following steps are executed in a loop: the grid coordinates corresponding to parent[current_index] are stored at the end of the path queue path, and the index value of the grid corresponding to the parent node corresponding to the current index value is assigned to the current index value, that is, the index value of the grid corresponding to parent[current_index] is assigned to current_index, until the current index value is equal to the starting index value.
[0174] Step S6035: After the current index value equals the starting index value, reverse the order of all nodes in the path queue to obtain the global path;
[0175] Specifically, when the current index value is equal to the starting index value, all nodes in the path queue are reversed to obtain a global path connecting the starting point and the ending point.
[0176] Step S604: Obtain the minimum cost value corresponding to the first node;
[0177] Specifically, if the index value of the first node is not equal to the index value of the endpoint in the raster map, then continue to obtain the minimum cost value corresponding to the first node.
[0178] Please refer to the following: Figure 8 , Figure 8 This is a flowchart illustrating a method for determining whether the current number of iterations is greater than a preset threshold, provided in an embodiment of this application.
[0179] like Figure 8 As shown, determining whether the current loop count is greater than a preset threshold includes:
[0180] Step S801: Obtain the current loop count;
[0181] Specifically, the current loop count is automatically recorded each time the loop is executed.
[0182] Step S802: Determine whether the current number of iterations is greater than a preset threshold number;
[0183] Specifically, a preset loop count threshold is used to determine whether the current loop count exceeds the preset threshold to prevent infinite loops. In this embodiment, assuming the number of grid cells in the x-direction of the raster map is nx and the number of grid cells in the y-direction is ny, the loop count is set to 1.5*nx*ny based on actual needs. If the current loop count exceeds the preset threshold, step S803 is executed; if the current loop count does not exceed the preset threshold, step S803 is executed.
[0184] Step S803: Increase the node expansion threshold;
[0185] Specifically, if the current number of iterations is greater than the preset threshold, the node expansion threshold lethal_cost will be increased by a step value as needed. For example, the node expansion threshold lethal_cost can be increased by 50, but the increased node expansion threshold lethal_cost must not be greater than 254.
[0186] Step S804: Expand the first node in the priority queue;
[0187] Specifically, if the current loop count is not greater than a preset threshold,
[0188] Step S204: If the global path search fails, increase the node expansion threshold, and re-perform the path search based on the increased node expansion threshold until a global path is found and determined.
[0189] Please refer to the following: Figure 9 , Figure 9 yes Figure 2 A detailed flowchart of step S204 in the process;
[0190] like Figure 9 As shown, if the global path search fails, the node expansion threshold is increased. Based on the increased node expansion threshold, the path search is repeated until a global path is found and determined, including:
[0191] Step S2041: New node expansion threshold = node expansion threshold + step value;
[0192] Specifically, the node expansion threshold lethal_cost is increased by a step value according to actual needs. For example, the node expansion threshold lethal_cost can be increased by 50, but it must be ensured that the new node expansion threshold does not exceed the maximum preset grid cost value, that is, the increased node expansion threshold lethal_cost cannot exceed 254. In this embodiment, the step value is set according to specific needs, for example, the step value is set to 50.
[0193] In this embodiment of the application, if the global path search fails, the node expansion threshold is increased, and the node expansion is performed again according to the increased node expansion threshold. The path search is then performed until the global path is found and determined.
[0194] In this application embodiment, a global path planning method is provided. This method includes: obtaining a grid cost array, wherein the grid cost array is used to store the grid cost value of each grid in the grid map; obtaining the grid cost value corresponding to the starting point and the grid cost value corresponding to the ending point, and setting a node expansion threshold to the larger of the grid cost values of the starting point and the ending point; performing a global path search based on the node expansion threshold; if the global path search fails, increasing the node expansion threshold, and re-performing the path search based on the increased node expansion threshold until a global path is found and determined. This application can improve the quality of path search by setting the node expansion threshold to the larger of the grid cost values of the starting point and the ending point, and by gradually increasing the node expansion threshold.
[0195] Please refer to the following: Figure 10 , Figure 10 This is a schematic diagram of the structure of a global path planning device provided in an embodiment of this application;
[0196] The global path planning device is applied to one or at least two processors of the mobile robot.
[0197] like Figure 10 As shown, the global path planning device 101 includes:
[0198] The data acquisition unit 1011 acquires a grid cost array, which is used to store the grid cost value of each grid in the grid map. It acquires the grid cost value corresponding to the starting point and the grid cost value corresponding to the ending point, and sets the node expansion threshold to the larger value between the grid cost value of the starting point and the grid cost value of the ending point.
[0199] The path search unit 1012 is used to perform a global path search based on a node expansion threshold. If the global path search fails, the node expansion threshold is increased, and the path search is performed again based on the increased node expansion threshold until a global path is found and the global path is determined.
[0200] In this embodiment of the application, the data acquisition unit 1011 is specifically used for:
[0201] Obtain the raster cost array, which stores the raster cost value of each raster in the raster map;
[0202] Obtain the raster generation value corresponding to the starting point and the raster generation value corresponding to the ending point, and set the node expansion threshold to the larger of the raster generation value of the starting point and the raster generation value of the ending point.
[0203] In this embodiment of the application, the path search unit 1012 is specifically used for:
[0204] Initialize the search cost array, priority queue, parent node array, and minimum cost array;
[0205] Get the index value of the starting point in the grid map, initialize the search cost value corresponding to the starting point to zero, and add the starting point to the priority queue. The priority queue is sorted according to the search cost value of the nodes in ascending order.
[0206] Get the first node in the priority queue;
[0207] Get the minimum cost value corresponding to the index value of the first node;
[0208] If the minimum cost value corresponding to the index value of the first node is equal to positive infinity, then add the first node to the minimum cost array and update the minimum cost value corresponding to the first node in the minimum cost array to the search cost value corresponding to the first node.
[0209] Search for the surrounding nodes of the first node in the grid map in a preset order. The surrounding nodes are at least one of the following nodes in the grid map: the left node, right node, top node, bottom node, top-left node, top-right node, bottom-left node, and bottom-right node of the first node.
[0210] Expand the surrounding nodes until all surrounding nodes of the first node have been traversed;
[0211] After the first node is expanded, the next node in the priority queue is taken as the first node, and the first node in the current priority queue is searched until the index value of the first node in the priority queue is equal to the index value of the destination in the grid map.
[0212] In the embodiments of this application, the global path planning device can also be constructed from hardware devices. For example, the global path planning device can be constructed from one or more chips, and the chips can work together to complete the global path planning method described in the above embodiments. Furthermore, the global path planning device can also be constructed from various logic devices, such as general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), microcontrollers, ARM (Acorn RISC Machine) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0213] The global path planning device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0214] The global path planning device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0215] The global path planning device provided in this application embodiment can achieve... Figure 2 To avoid repetition, the various processes involved will not be described in detail here.
[0216] It should be noted that the global path planning device described above can execute the global path planning method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the embodiments of the global path planning device can be found in the global path planning method provided in the above embodiments.
[0217] In this embodiment, a global path planning device is provided, comprising: a data acquisition unit for acquiring a grid cost array, wherein the grid cost array stores the grid cost value of each grid in the grid map, acquiring the grid cost value corresponding to the starting point and the grid cost value corresponding to the ending point, and setting a node expansion threshold to the larger of the grid cost value of the starting point and the grid cost value of the ending point; and a path search unit for performing a global path search based on the node expansion threshold. If the global path search fails, the node expansion threshold is increased, and the path search is performed again based on the increased node expansion threshold until a global path is found and determined. This application can improve the quality of path search by setting the node expansion threshold to the larger of the grid cost value of the starting point and the grid cost value of the ending point, and by gradually increasing the node expansion threshold.
[0218] Please refer to the following: Figure 11 , Figure 11 This is a schematic diagram of the structure of a mobile robot provided in an embodiment of this application;
[0219] like Figure 11 As shown, the mobile robot 110 includes one or more processors 111 and a memory 112. Wherein, Figure 11 Take a processor 111 as an example.
[0220] Processor 111 and memory 112 can be connected via a bus or other means. Figure 11 Taking the example of a connection between China and Israel via a bus.
[0221] The processor 111 is configured to provide computational and control capabilities to control the mobile robot 110 to perform corresponding tasks, such as controlling the mobile robot 110 to perform the global path planning method in any of the above method embodiments, including: obtaining a grid cost array, wherein the grid cost array is used to store the grid cost value of each grid in the grid map; obtaining the grid cost value corresponding to the starting point and the grid cost value corresponding to the ending point, and setting the node expansion threshold to the larger value between the grid cost value of the starting point and the grid cost value of the ending point; performing a global path search based on the node expansion threshold; if the global path search fails, increasing the node expansion threshold, and re-performing the path search based on the increased node expansion threshold until a global path is found and the global path is determined.
[0222] By setting the node expansion threshold to the larger of the raster cost value of the starting point and the raster cost value of the ending point, and by gradually increasing the node expansion threshold for path search, this application can improve the quality of path search.
[0223] Processor 111 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0224] Memory 112, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the global path planning method in the embodiments of this application. Processor 111 can implement the global path planning method in any of the following method embodiments by running the non-transitory software programs, instructions, and modules stored in memory 112. Specifically, memory 112 may include volatile memory (VM), such as random access memory (RAM); memory 112 may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD), solid-state drive (SSD), or other non-transitory solid-state storage devices; memory 112 may also include combinations of the above types of memory.
[0225] Memory 112 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 112 may optionally include memory remotely located relative to processor 111, and these remote memories may be connected to processor 111 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0226] One or more modules are stored in memory 112. When executed by one or more processors 111, they execute the global path planning method in any of the above method embodiments, for example, the method described above. Figure 2 The steps shown can also be implemented. Figure 10 The functions of each module or unit.
[0227] In this embodiment, the mobile robot 110 may also have wired or wireless network interfaces, keyboards, and input / output interfaces for input and output. The mobile robot 110 may also include other components for implementing device functions, which will not be described in detail here.
[0228] This application also provides a computer-readable storage medium, such as a memory including program code, which can be executed by a processor to complete the global path planning method in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0229] This application also provides a computer program product comprising one or more lines of program code stored in a computer-readable storage medium. A processor of an electronic device reads the program code from the computer-readable storage medium and executes the program code to complete the method steps of the global path planning method provided in the above embodiments.
[0230] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program or program code related to hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0231] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0232] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations as described above in different aspects of this application, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A global path planning method, characterized in that, The method includes: Obtain a raster cost array, wherein the raster cost array is used to store the raster cost value of each raster in the raster map, and the cost value of each raster in the raster cost array is within the same value range; Obtain the raster generation value corresponding to the starting point and the raster generation value corresponding to the ending point, and set the node expansion threshold to the larger value between the raster generation value of the starting point and the raster generation value of the ending point. Based on the node expansion threshold, a global path search is performed; If the global path search fails, the node expansion threshold is increased when the current number of iterations exceeds the preset threshold. The path search is then performed again based on the increased node expansion threshold until the global path is found and determined. The increase of the node expansion threshold includes: The new node expansion threshold = node expansion threshold + step value, wherein the new node expansion threshold is not greater than the maximum preset raster cost value.
2. The method according to claim 1, characterized in that, The global path search based on the node expansion threshold includes: Initialize the search cost array, priority queue, parent node array, and minimum cost array; Obtain the index value of the starting point in the grid map, initialize the search cost value corresponding to the starting point to zero, and add the starting point to the priority queue, wherein the priority queue is sorted according to the search cost value of the nodes in ascending order; Get the first node in the priority queue; Obtain the minimum cost value corresponding to the index value of the first node; If the minimum cost value corresponding to the index value of the first node is equal to positive infinity, then the first node is added to the minimum cost array, and the minimum cost value corresponding to the first node is updated to the search cost value corresponding to the first node in the minimum cost array. According to a preset order, search the surrounding nodes of the first node in the grid map, wherein the surrounding nodes are at least one of the following nodes in the grid map: left node, right node, top node, bottom node, top left node, top right node, bottom left node, and bottom right node. Expand the surrounding nodes until all surrounding nodes of the first node have been traversed; After the first node is expanded, the next node in the priority queue is taken as the first node, and the first node in the current priority queue is searched until the index value of the first node in the priority queue is equal to the index value of the destination in the grid map.
3. The method according to claim 2, characterized in that, If the surrounding nodes are one of the left, right, top, and bottom nodes of the first node in the grid map, the expansion of the surrounding nodes includes: If the surrounding nodes satisfy the first condition, then the expansion of the current surrounding nodes ends and the next surrounding node is searched. If the surrounding nodes do not meet the first condition, then it is further determined whether the surrounding nodes meet the second condition. If the surrounding nodes meet the second condition, then the search cost value of the surrounding nodes is updated to the sum of the search cost value of the first node, the grid cost value of the first node in the grid cost array, and the preset extended cost value. In addition, the index value of the surrounding nodes in the parent node array is determined as the index value of the first node. If the surrounding nodes do not meet the second condition, then search for the next surrounding node, until all surrounding nodes of the first node have been traversed.
4. The method according to claim 3, characterized in that, The first condition includes: The index value of the surrounding nodes is less than the minimum index value of the raster map; Alternatively, the index value of the surrounding nodes is greater than the maximum index value of the grid map, wherein the maximum index value of the grid map = the number of grids in the horizontal direction of the grid map * the number of grids in the vertical direction of the grid map - 1. Alternatively, the minimum cost corresponding to the index value of the surrounding nodes is less than positive infinity; Alternatively, the raster value corresponding to the index value of the surrounding nodes is greater than the node expansion threshold; The second condition includes: The search value of the surrounding nodes is greater than the sum of the search value of the first node, the grid value of the first node, and the preset expansion value.
5. The method according to claim 3 or 4, characterized in that, If the surrounding nodes are one of the top-left, top-right, bottom-left, and bottom-right nodes of the first node in the grid map, the expansion of the surrounding nodes includes: If the surrounding nodes satisfy the third condition, the expansion of the surrounding nodes ends and the next surrounding node is searched until the top left node, top right node, bottom left node, and bottom right node of the first node are traversed. If the surrounding nodes do not meet the third condition, then it is further determined whether the surrounding nodes meet the fourth condition. If the surrounding nodes meet the fourth condition, then the search cost of the surrounding nodes is updated to the sum of the search cost of the first node, the grid cost of the first node in the grid cost array, and the preset coefficient * the preset extended cost. In addition, the index value of the surrounding nodes in the parent node array is determined as the index value of the first node. If the surrounding nodes do not satisfy the fourth condition, then search for the next surrounding node, until all surrounding nodes of the first node have been traversed.
6. The method according to claim 5, characterized in that, The third condition includes: The index value of the surrounding nodes is less than the minimum index value of the raster map; Alternatively, the index value of the surrounding nodes is greater than the maximum index value of the grid map, wherein the maximum index value of the grid map = the number of grids in the horizontal direction of the grid map * the number of grids in the vertical direction of the grid map - 1. Alternatively, the minimum cost corresponding to the index value of the surrounding nodes is less than positive infinity; Alternatively, the raster value corresponding to the index value of the surrounding nodes is greater than the node expansion threshold; Alternatively, the index value of the neighboring nodes of the surrounding node is greater than the minimum index value of the grid map, wherein the neighboring nodes of the surrounding node include the left, right, upper, and lower nodes of the surrounding node in the grid map, and the index value of the neighboring nodes of the surrounding node is less than the maximum index value of the grid map, and the grid value corresponding to the index value of the neighboring nodes of the surrounding node is greater than the node expansion threshold. The fourth condition includes: The search value of the surrounding nodes is greater than the sum of the search value of the first node, the grid value of the first node, and the preset coefficient multiplied by the preset expansion value.
7. The method according to any one of claims 2-4, characterized in that, After obtaining the first node in the priority queue, the method further includes: Determine whether the index value of the first node is equal to the index value of the endpoint in the grid map; If so, then confirm that the node search is complete and determine the global path; If not, continue searching for the first node of the priority queue.
8. The method according to claim 7, characterized in that, Determining the global path includes: Initialize the current index value to the index value of the endpoint; Add the coordinates of the raster corresponding to the current index value to the end of the path queue; If the current index value is not equal to the starting index value, then repeat the following steps: Add the coordinates of the grid corresponding to the parent node of the current index value to the end of the path queue. Then, assign the index value of the grid corresponding to the parent node of the current index value to the current index value. Repeat this assignment until the current index value is equal to the index value of the starting point. After the current index value equals the starting index value, all nodes in the path queue are reversed to obtain the global path.
9. The method according to any one of claims 2-4, characterized in that, The method further includes: When expanding the first node in the priority queue, determine whether the current loop count is greater than a preset threshold. If the current number of iterations is greater than a preset threshold, the node expansion threshold is increased to perform a new search.
10. A mobile robot, characterized in that, include: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the global path planning method as described in any one of claims 1-9.
Citation Information
Patent Citations
Path planning method and device and intelligent conveying system
CN113375686A
Three-dimensional space path planning method
CN115946117A