Path planning method and device, computer equipment, medium and product
By determining the search direction based on random sampling points in the RRT algorithm and dynamically adjusting the step size, the problem of low path planning efficiency and quality in complex environments is solved, and more efficient and accurate path planning is achieved.
Patent Information
- Application Number
- CN202510320080.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-06-27
AI Technical Summary
The existing RRT algorithms have problems such as insufficient sampling strategies, poor path quality and improper step size selection in path planning, resulting in low planning efficiency and path quality in complex environments.
By determining the first node from the search tree based on the random sampling points, and determining the search direction based on the random sampling points and the first node, dynamically adjusting the step size in the search direction, determining whether there are obstacles between the nodes to adjust the step size, and finally determining the target path.
It improves the path planning efficiency and quality of AGV in complex environments, balances the relationship between exploration efficiency and path accuracy, and reduces computing resource consumption and path length.
Smart Images

Figure CN120218802A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path planning, and in particular to a path planning method, apparatus, computer device, medium and product. Background Art
[0002] With the rapid development of AGV (Automated Guided Vehicle) technology, the application scenarios of path planning in fields such as industrial manufacturing, warehousing logistics, and home services are becoming increasingly complex, posing higher requirements for the performance of planning algorithms. Although the RRT (Rapidly-exploring Random Trees) algorithm has achieved wide success in practical applications due to its probabilistic completeness and fast exploration ability, in-depth analysis shows that the current RRT algorithm still has obvious deficiencies in sampling strategy and path quality, restricting the application effect of the algorithm in real-time scenarios.
[0003] The limitations of the current RRT algorithm are mainly reflected in three aspects: sampling strategy, path quality, and step size selection. In terms of the sampling strategy, the existing algorithm generates sampling points in a completely random manner, lacking the exploration of environmental characteristics, which may lead to a waste of a large amount of computing resources in exploring invalid areas. Especially when dealing with complex scenarios such as narrow channels and dense obstacles, its planning efficiency drops significantly. In terms of path quality, due to the lack of directional guidance and control during the expansion process, the finally generated path often has unnecessary twists and detours, or there are obvious local oscillation phenomena, greatly increasing the path length. In addition, the expansion strategy with a fixed step size also limits the practical performance of the algorithm, making it difficult for the algorithm to achieve a good balance between exploration efficiency and path accuracy. Summary of the Invention
[0004] In view of this, the present invention provides a path planning method, apparatus, computer device, medium and product, aiming to improve the path planning efficiency and quality of AGVs in complex environments.
[0005] In a first aspect, the present invention provides a path planning method, the method comprising:
[0006] Determine a first node from a search tree based on a random sampling point, and determine a search direction according to the random sampling point and the first node, where the first node is the node in the search tree closest to the random sampling point;
[0007] Based on the first node and a preset first step size, determine a second node in the search direction;
[0008] Judge whether there is an obstacle between the first node and the second node, so as to adjust the preset first step size based on the judgment result and a preset adjustment parameter, and determine a target second node;
[0009] Determine all the target second nodes based on the adjusted preset first step length, so as to determine the target path based on the target second nodes, the preset starting point and the preset ending point.
[0010] In an alternative embodiment, the determining the first node from the search tree based on the random sampling point includes:
[0011] Generate a random sampling point;
[0012] Calculate the distance between the nodes in the search tree and the random sampling point, and determine the first node.
[0013] In an alternative embodiment, the determining the search direction according to the random sampling point and the first node includes:
[0014] Determine a reference search direction based on the coordinate difference between the random sampling point and the first node;
[0015] Determine the search direction according to the reference search direction, and the search direction includes at least a first search direction, a second search direction, a third search direction and a fourth search direction;
[0016] The reference search direction is determined according to the following formula:
[0017]
[0018] wherein, represents the coordinates of the first node, represents the coordinates of the random sampling point;
[0019] The search direction is determined according to the following formula:
[0020]
[0021] wherein, d1 represents the first search direction, d2 represents the second search direction, d3 represents the third search direction, and d4 represents the fourth search direction.
[0022] In an alternative embodiment, the determining the second node based on the first node and the preset first step length in the search direction includes:
[0023] In the search direction, taking the first node as the starting point, and determine the second node based on the preset first step length.
[0024] In an alternative embodiment, the preset adjustment parameter includes a first parameter and a second parameter. The first parameter is used for expansion, and the second parameter is used for contraction. The first parameter is greater than the second parameter. Judging whether there is an obstacle between the first node and the second node, and adjusting the preset first step length based on the judgment result and the preset adjustment parameter, and determining the target second node, includes:
[0025] Judging whether there is an obstacle between the first node and the second node;
[0026] If there is no obstacle between the first node and the second node, then determine the second node as the target second node, and adjust the preset first step length based on the first parameter;
[0027] If there is an obstacle between the first node and the second node, then adjust the preset first step length based on the second parameter, and re-obtain the second node according to the preset first step length adjusted based on the second parameter.
[0028] In an alternative embodiment, determining all the target second nodes based on the adjusted preset first step length, and determining the target path based on the target second node, the preset starting point and the preset ending point, includes:
[0029] Determining a new target second node based on the adjusted preset first step length and the target second node until the distance between a target second node and the preset ending point is less than or equal to the preset threshold;
[0030] Determining the target path based on all the target second nodes, the preset starting point and the preset ending point.
[0031] In a second aspect, the present invention provides a path planning device, and the device includes:
[0032] A search direction determination module, configured to determine a first node from a search tree based on a random sampling point, and determine a search direction according to the random sampling point and the first node, where the first node is the node in the search tree that is closest to the random sampling point;
[0033] A second node determination module, configured to determine a second node based on the first node and a preset first step length in the search direction;
[0034] A target second node determination module, configured to judge whether there is an obstacle between the first node and the second node, adjust the preset first step length based on the judgment result and the preset adjustment parameter, and determine the target second node;
[0035] A path determination module, configured to determine all the target second nodes based on an adjusted preset first step length, so as to determine a target path based on the target second nodes, a preset starting point, and a preset ending point.
[0036] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the method according to the first aspect or any corresponding embodiment thereof.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the method according to the first aspect or any corresponding embodiment thereof.
[0038] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the method according to the first aspect or any corresponding embodiment thereof.
[0039] The path planning method provided in this embodiment includes determining a first node from a search tree based on a random sampling point, and determining a search direction according to the random sampling point and the first node, where the first node is the node in the search tree closest to the random sampling point; in the search direction, determining a second node based on the first node and a preset first step length; determining whether there is an obstacle between the first node and the second node, so as to adjust the preset first step length based on the determination result and a preset adjustment parameter, and determine a target second node; determining all target second nodes based on the adjusted preset first step length, so as to determine a target path based on the target second nodes, a preset starting point, and a preset ending point. This method can perform spatial exploration more pertinently by dynamically adjusting the step size, can quickly explore in open areas, and finely search in areas with obstacles, balancing the relationship between exploration efficiency and path accuracy, and improving the path planning efficiency and quality. Description of the Drawings
[0040] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0041] Figure 1 is a flowchart of the path planning method according to an embodiment of the present invention;
[0042] Figure 2 is an orthogonal parallel direction diagram according to an embodiment of the present invention;
[0043] Figure 3 It is a schematic diagram of adaptive step size control according to an embodiment of the present invention;
[0044] Figure 4 It is a path diagram in a simple open environment according to an embodiment of the present invention;
[0045] Figure 5 It is a path diagram in a narrow passage environment according to an embodiment of the present invention;
[0046] Figure 6 It is a path diagram in a maze environment according to an embodiment of the present invention;
[0047] Figure 7 It is a structural block diagram of a path planning device according to an embodiment of the present invention;
[0048] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Specific embodiments
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0050] With the rapid development of industrial automation and intelligent logistics, the application scenarios of AGVs have expanded from traditional structured workshops to complex environments such as dynamic warehousing, flexible production lines, and indoor service robots. As one of the core technologies of AGVs, path planning needs to achieve safe and efficient navigation under high-dimensional spaces, dynamic obstacles, and real-time constraints. Due to its advantages of probabilistic completeness and the need for no prior environmental modeling, the RRT algorithm has become the mainstream solution. However, in terms of the sampling strategy, existing algorithms generate sampling points in a completely random manner, lacking the exploration of environmental features, which may lead to a waste of a large amount of computing resources in exploring invalid areas. Especially when dealing with complex scenarios such as narrow passages and dense obstacles, its planning efficiency drops significantly. In terms of path quality, due to the lack of directional guidance and control during the expansion process, the finally generated path often has unnecessary twists and detours, or there are obvious local oscillation phenomena, greatly increasing the path length. In addition, the fixed-step expansion strategy also limits the practical performance of the algorithm, making it difficult for the algorithm to achieve a good balance between exploration efficiency and path accuracy. Based on this, the embodiments of the present invention provide a path planning method applicable to the navigation problems of mobile robots in complex environments in scenarios such as unmanned platforms, industrial manufacturing, warehousing logistics, and intelligent services.
[0051] According to an embodiment of the present invention, an embodiment of a path planning method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0052] In this embodiment, a path planning method is provided. Figure 1 It is a flowchart of the path planning method according to an embodiment of the present invention, as Figure 1 shown, and the process includes the following steps:
[0053] Step S101, determine a first node from the search tree based on a random sampling point, and determine a search direction according to the random sampling point and the first node.
[0054] Among them, the first node is the node in the search tree that is closest to the random sampling point. The random sampling point is a random point generated in the free space, which is used to guide the expansion direction of the search tree and can be randomly generated by code.
[0055] Before generating the random sampling point, based on the given starting point q start and the target point q goal , initialize the search tree T. The search tree includes the coordinates of the nodes, the cost from the starting point to the nodes (the initial value is 0), and the index of the parent node (when the initial value is 0, it means there is no parent node). Set the starting point as the root node of the search tree, which can ensure that the algorithm starts planning from the correct starting point. Set the initial step size and the maximum number of explorations. After generating the random sampling point, determine the first node. Specifically, it can be optimized and searched through the Euclidean distance or the K-D tree (k-dimensional Tree, a tree-shaped data structure used to efficiently organize and manage multi-dimensional space data), so as to find the first node in the search tree that is closest to the random sampling point.
[0056] The search direction is an orthogonal search direction generated after calculating the reference search direction. Specifically, the reference search direction can be calculated by calculating the unit vector from the first node to the random sampling point, and then based on the reference search direction, an orthogonal search direction (i.e., the search direction) is generated. The search direction can be one or more.
[0057] Step S102, on the search direction, determine a second node based on the first node and a preset first step size.
[0058] The preset first step size is the initial step size δ0. Reasonably setting the initial step size plays a crucial role in the performance of the algorithm. If it is too large, it will lead to insufficient accuracy, and if it is too small, it will increase the calculation amount. On each search direction, extend the preset first step size with the first node as the starting point to obtain the second node.
[0059] In some alternative embodiments, the size of the preset first step length can be set according to the map size. For example, it can be 5% - 10% of the map size.
[0060] In some alternative embodiments, the maximum number of exploration times N max is from 1000 to 5000.
[0061] Step S103: Determine whether there is an obstacle between the first node and the second node, and based on the judgment result and the preset adjustment parameter, adjust the preset first step length and determine the target second node.
[0062] Determine whether there is an obstacle between the first node and the second node. If there is no obstacle, it means that the point is successfully sampled, and the second node is used as the target second node. At the same time, adjust the preset first step length. When there is no obstacle between the first node and the second node, the preset first step length is adjusted by enlarging the preset first step length, so as to increase the preset first step length. The preset first step length can be adjusted by the preset adjustment parameter for enlargement.
[0063] If there is an obstacle between the first node and the second node, it means that the point sampling fails. Adjust the preset first step length. Specifically, the preset first step length is adjusted by shrinking the preset first step length, so as to reduce the preset first step length. The preset first step length can be adjusted by the preset adjustment parameter for shrinking. Starting from the first node, and perform exploration again with the adjusted preset first step length to obtain a new second node, and further determine whether there is an obstacle between the first node and the second node until there is no obstacle between the first node and the second node, and use the second node as the target second node.
[0064] Add the target second node to the search tree, and at the same time update the tree structure and maintain the optimal path information. Ensure the continuity and effectiveness of the tree structure, laying a foundation for the final path extraction. To accelerate the convergence speed, the algorithm explores directly in the direction of the target point with a fixed probability (usually 10%) after each iteration. This strategy further improves the convergence rate of the algorithm by increasing the target orientation.
[0065] Step S104: Determine all target second nodes based on the adjusted preset first step length, and determine the target path based on the target second node, the preset starting point, and the preset ending point.
[0066] If there is no obstacle between the first node and the second node based on step S103, then the second node is used as the target second node, that is, one of the nodes on the target path. Next, starting from the target second node and executing the adjusted preset first step length, a new second node is obtained. If there is no obstacle between the target node and the new second node, it means that the sampling is successful, and the newly sampled point is also regarded as one of the target second nodes. And so on, continuously adjusting the preset first step length for sampling.
[0067] The termination of the algorithm includes the following two cases:
[0068] (1) It terminates when the specified maximum number of iterations N max is completed, to avoid infinite loop of the algorithm.
[0069] (2) When the distance between a node in the search tree and the preset end point is less than the preset threshold, it means that the path is successfully found and the exploration is terminated. (Node q ∈ search tree T, and ||q - q goal || ≤ δ min ), q goal represents the preset end point, and δ min represents the preset threshold.
[0070] All the second target nodes, the preset start point and the preset end point constitute the target path. These two conditions jointly ensure that the algorithm can complete the planning within a reasonable time or return a result of no solution. Once the termination condition is met, the algorithm performs path extraction and optimization, and outputs a high-quality path that satisfies the kinematic constraints of the AGV.
[0071] The path planning method provided in this embodiment includes determining a first node from a search tree based on a random sampling point, and determining a search direction according to the random sampling point and the first node, where the first node is the node in the search tree that is closest to the random sampling point; in the search direction, determining a second node based on the first node and a preset first step length; determining whether there is an obstacle between the first node and the second node, to adjust the preset first step length based on the judgment result and a preset adjustment parameter, and determine the target second node; determining all the target second nodes based on the adjusted preset first step length, to determine the target path based on the target second nodes, the preset start point and the preset end point. This method can perform spatial exploration more pertinently by dynamically adjusting the step length size, can quickly explore in open areas, finely search in areas with obstacles, balances the relationship between exploration efficiency and path accuracy, and improves the path planning efficiency and quality.
[0072] In this embodiment, a path planning method is provided, and this method includes the following steps:
[0073] Step S201, determining a first node from a search tree based on a random sampling point, and determining a search direction according to the random sampling point and the first node.
[0074] Specifically, step S201 includes:
[0075] Step S2011, generating random sampling points;
[0076] Step S2012, calculating the distance between the nodes in the search tree and the random sampling points, and determining the first node.
[0077] Random sampling points are randomly generated by code, and the first node closest to the random sampling points in the search tree is determined through nearest neighbor search. Specifically, a K-D tree can be used to find the leaf node containing the random sampling points, and then the squared Euclidean distance between each tree node and the random sampling points is calculated in the leaf node, and the node with the smallest distance is found through comparison as the first node.
[0078] Step S2013, determining the reference search direction based on the coordinate difference between the random sampling points and the first node.
[0079] Specifically, the reference search direction is determined according to the following formula:
[0080]
[0081] where (q cx,cy ) represents the coordinates of the first node, and (q rx,ry ) represents the coordinates of the random sampling points.
[0082] Step S2014, determining the search direction according to the reference search direction.
[0083] Among them, the search direction includes at least a first search direction, a second search direction, a third search direction, and a fourth search direction;
[0084] Specifically, the search direction is determined according to the following formula:
[0085]
[0086] where d1 represents the first search direction, d2 represents the second search direction, d3 represents the third search direction, and d4 represents the fourth search direction. As shown in the schematic diagram of orthogonal parallel directions in Figure 2 .
[0087] This step provides the global exploration ability for the algorithm through randomness, and is the key to keeping the algorithm probabilistically complete.
[0088] Step S202, determining the second node based on the first node and a preset first step length in the search direction.
[0089] Specifically, step S202 includes: starting from the first node in the search direction and determining the second node based on a preset first step size.
[0090] For each search direction d i , the algorithm starts from the first node v0 and executes a preset first step size δ0 to explore and obtain the second node v1.
[0091] Step S203, determine whether there is an obstacle between the first node and the second node, adjust the preset first step size based on the judgment result and a preset adjustment parameter, and determine the target second node.
[0092] Specifically, the preset adjustment parameter includes a first parameter and a second parameter. The first parameter is used for expansion, and the second parameter is used for contraction. The first parameter is greater than the second parameter. Step S203 includes:
[0093] Step S2031, determine whether there is an obstacle between the first node and the second node.
[0094] Determine whether there is an obstacle between the first node and the second node. In some alternative embodiments, the path between the first node and the second node can be discretized into multiple points, and each point is detected to see if it is within the obstacle area.
[0095] In some alternative embodiments, real-time data such as lidar and depth cameras can be combined to determine whether there is an obstacle on the path from the first node to the second node.
[0096] Step S2032, if there is no obstacle between the first node and the second node, determine the second node as the target second node and adjust the preset first step size based on the first parameter.
[0097] After initially determining the map, appropriate first and second parameters can be selected according to the map features. The specific parameter values can be determined through experimental analysis. The available values of the first parameter α and the second parameter β include [α, b] = [1.2, 0.5] / [1.5, 0.7] / [2, 0.9]. Among them, the parameter [1.5, 0.7] can generally be applicable to most scenarios.
[0098] If the path from the first node v0 to the second node v1 is free of obstacles, a point is successfully sampled and exploration continues. v1 is used as the target second node. At this time, the first preset step size δ0 is increased to δ1 = ·δ0, and exploration continues to obtain point v2. δ1 represents the adjusted preset first step size. If between node v1 and node v2, the step size δ2 = ·δ1 is expanded to continue sampling.
[0099] Step S2033, if there is an obstacle between the first node and the second node, adjust the preset first step length based on the second parameter, and re-obtain the second node according to the preset first step length adjusted based on the second parameter.
[0100] If there is an obstacle between the first node and the second node, shrink the preset first step length δ1 to δ2 = ·δ1, where δ2 represents the adjusted preset first step length, and continue to explore from v1 with this step length to re-obtain the second node until the target second node is determined.
[0101] As Figure 3 shown in the schematic diagram of adaptive step length control, the dynamic step length adjustment formula is:
[0102]
[0103] Step S204, determine all target second nodes based on the adjusted preset first step length, and determine the target path based on the target second nodes, the preset starting point, and the preset ending point.
[0104] Specifically, step S204 includes:
[0105] Step S2041, determine new target second nodes based on the adjusted preset first step length and the target second nodes until the distance between a target second node and the preset ending point is less than or equal to the preset threshold.
[0106] Step S2042, determine the target path based on all target second nodes, the preset starting point, and the preset ending point.
[0107] Continue to obtain new target second nodes based on the adjusted preset first step length. If there is no obstacle between the first node and the second node, take the second node as the target second node, that is, one of the nodes on the target path. Next, take the target second node as the starting point and execute the adjusted preset first step length to obtain a new second node. If there is no obstacle between the target node and the new second node, it means that the sampling is successful, and the newly sampled point is also taken as one of the target second nodes. And so on, continuously adjust the preset first step length for sampling.
[0108] Before determining the target second node, the feasibility of the newly generated node can be evaluated. If it can be determined as the target second node, add it to the search tree, and at the same time update the tree structure to maintain the optimal path information. Ensure the continuity and effectiveness of the tree structure, laying a foundation for the final path extraction. To accelerate the convergence speed, the algorithm explores directly in the direction of the target point with a fixed probability (usually 10%) after each iteration. This strategy further improves the convergence rate of the algorithm by increasing the target orientation.
[0109] Based on all the second target nodes, a preset starting point, and a preset ending point, a target path is formed.
[0110] The path planning method provided in this embodiment, based on the parallel exploration strategy in the orthogonal direction and the adaptive step size control mechanism, enables the algorithm to explore the space more targeted and avoid a large number of invalid samplings. Experimental results show that, compared with the traditional RRT algorithm, the planning time of this method is reduced by 93.7% in a simple and open environment, by 97.1% in a narrow passage environment, and by 90% in a maze environment, demonstrating excellent computational efficiency advantages. By adopting an efficient sampling strategy, the number of nodes required for path planning is significantly reduced. Through directional guidance and gradient search, the algorithm avoids redundant exploration and significantly reduces the consumption of computing resources. The number of nodes is reduced by 91.8% in a simple environment, by 95.2% in a narrow passage environment, and by 83.9% in a maze environment, reflecting the significant advantages of the algorithm in resource utilization and making it more suitable for resource-constrained real-time application scenarios. The generated path has better geometric characteristics and spatial distribution. Through the precise positioning ability of the search mechanism and post-processing optimization, the path generated by the algorithm is smoother and more coherent, with fewer turns, and is more suitable for the kinematic constraints of the AGV. In various test environments, the length of the path generated by the proposed method is reduced by an average of 8.5%, with a smaller curvature, improving the running efficiency and stability of the AGV. It performs excellently in various complex environments, especially having unique advantages in dealing with challenging scenarios such as narrow passages, dense obstacles, and complex topologies. The algorithm effectively responds to different environmental characteristics through an adaptive adjustment strategy and can still maintain stable planning performance in a highly constrained space, improving the reliability and adaptability of the AGV system in complex dynamic environments. Figure 4 It is a path graph in a simple and open environment. Figure 5 It is a path graph in a narrow passage environment. Figure 6 It is a path graph in a maze environment. Among them, the thick lines and large nodes are the target path and all the nodes constituting the target path. The small nodes are the tree nodes generated during the exploration process of the algorithm. Each small node represents a node in the search tree. The thin lines connect the parent node and the child node, showing the structure and expansion direction of the tree. Each line represents the connection from one node to its child node. The algorithm starts from the starting point and gradually explores the space in all directions by continuously generating new sampling points and connecting them to the nearest node. Until the target path is determined, and this target path bypasses the obstacles.
[0111] In this embodiment, a path planning device is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0112] This embodiment provides a path planning device, as Figure 7 shown, including:
[0113] A search direction determination module, configured to determine a first node from a search tree based on a random sampling point, and determine a search direction according to the random sampling point and the first node, where the first node is the node in the search tree that is closest to the random sampling point;
[0114] A second node determination module, configured to determine a second node in the search direction based on the first node and a preset first step length;
[0115] A target second node determination module, configured to determine whether there is an obstacle between the first node and the second node, adjust the preset first step length based on the determination result and a preset adjustment parameter, and determine a target second node;
[0116] A path determination module, configured to determine all the target second nodes based on the adjusted preset first step length, and determine a target path based on the target second nodes, a preset starting point, and a preset ending point.
[0117] In some alternative implementation manners, the search direction determination module includes:
[0118] A sampling point generation unit, configured to generate a random sampling point;
[0119] A first node determination unit, configured to calculate the distance between a node in the search tree and the random sampling point, and determine the first node.
[0120] In some alternative implementation manners, the search direction determination module includes:
[0121] A reference direction determination unit, configured to determine a reference search direction based on the coordinate difference between the random sampling point and the first node;
[0122] A search direction determination unit, configured to determine the search direction according to the reference search direction, where the search direction includes at least a first search direction, a second search direction, a third search direction, and a fourth search direction;
[0123] The reference search direction is determined according to the following formula:
[0124]
[0125] Among them, represents the coordinates of the first node, represents the coordinates of the random sampling point;
[0126] The search direction is determined according to the following formula:
[0127]
[0128] Among them, d1 represents the first search direction, d2 represents the second search direction, d3 represents the third search direction, and d4 represents the fourth search direction.
[0129] In some alternative embodiments, the second node determination module includes:
[0130] A second node determination unit, configured to determine a second node at the starting point of the first node in the search direction and based on the preset first step length.
[0131] In some alternative embodiments, the preset adjustment parameter includes a first parameter and a second parameter. The first parameter is used for expansion, the second parameter is used for contraction, and the first parameter is greater than the second parameter. The target second node determination module includes:
[0132] An obstacle determination unit, configured to determine whether there is an obstacle between the first node and the second node;
[0133] A first adjustment unit, configured to, if there is no obstacle between the first node and the second node, determine the second node as the target second node and adjust the preset first step length based on the first parameter;
[0134] A second adjustment unit, configured to, if there is an obstacle between the first node and the second node, adjust the preset first step length based on the second parameter and re-obtain the second node according to the preset first step length adjusted based on the second parameter.
[0135] In some alternative embodiments, the path determination module includes:
[0136] A new target second node determination unit, configured to determine a new target second node based on the adjusted preset first step length and the target second node until the distance between the target second node and the preset end point is less than or equal to the preset threshold;
[0137] A path determination unit, configured to determine a target path based on all target second nodes, the preset starting point, and the preset end point.
[0138] The further function descriptions of the above-mentioned modules and units are the same as those in the corresponding embodiments above, and will not be elaborated here.
[0139] The path planning device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0140] The embodiment of the present invention further provides a computer device having the above path planning device.
[0141] Please refer to Figure 8 , Figure 8 FIG. is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 8 shown, the computer device includes: one or more processors 10, a memory 20, and an interface for connecting each component, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 8 In FIG., one processor 10 is taken as an example.
[0142] The processor 10 can be a central processor, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a general array logic, or any combination thereof.
[0143] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0144] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device and the like. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely disposed relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0145] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memory.
[0146] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0147] The embodiments of the present invention also provide a computer-readable storage medium. The methods according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the methods described herein can be stored in such software processes on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium may further include a combination of the above types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods shown in the above embodiments are implemented.
[0148] A part of the present invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can call or provide the methods and / or technical solutions according to the present invention through the operations of the computer. Those skilled in the art should understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.
[0149] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the present invention.
Claims
1. A path planning method, characterized in that: The method comprises: Determine a first node from a search tree based on a random sampling point, and determine a search direction according to the random sampling point and the first node, the first node being a node in the search tree that is closest to the random sampling point; In the search direction, determining a second node based on the first node and a preset first step length; Determine whether there is an obstacle between the first node and the second node, adjust the preset first step length based on the determination result and the preset adjustment parameter, and determine the target second node; All the target second nodes are determined based on the adjusted preset first step length, so as to determine the target path based on the target second nodes, the preset starting point and the preset end point.
2. The method according to claim 1, characterized in that The determining the first node from the search tree based on the random sampling point comprises: Generate random sampling points; The distance between the node in the search tree and the random sampling point is calculated to determine the first node.
3. The method according to claim 1, characterized in that: The determining the search direction according to the random sampling point and the first node includes: Determining a reference search direction based on a coordinate difference between the random sampling point and the first node; Determine the search direction according to the reference search direction, the search direction at least including a first search direction, a second search direction, a third search direction and a fourth search direction; The reference search direction is determined according to the following formula: in, represents the coordinates of the first node, represents the coordinates of the random sampling points; The search direction is determined according to the following formula: Among them, d1 represents the first search direction, d2 represents the second search direction, d3 represents the third search direction, and d4 represents the fourth search direction.
4. The method according to claim 1, characterized in that: Determining the second node in the search direction based on the first node and a preset first step length includes: In the search direction, taking the first node as a starting point and based on the preset first step length, a second node is determined.
5. The method according to claim 1, characterized in that The preset adjustment parameter includes a first parameter and a second parameter, the first parameter is used for expansion, the second parameter is used for contraction, the first parameter is greater than the second parameter, and the determining whether there is an obstacle between the first node and the second node, adjusting the preset first step length based on the determination result and the preset adjustment parameter, and determining the target second node includes: Determining whether there is an obstacle between the first node and the second node; If there is no obstacle between the first node and the second node, determining the second node as the target second node, and adjusting the preset first step length based on the first parameter; If there is an obstacle between the first node and the second node, the preset first step length is adjusted based on the second parameter, and the second node is reacquired according to the preset first step length adjusted based on the second parameter.
6. The method according to claim 5, characterized in that The step of determining all the target second nodes based on the adjusted preset first step length, so as to determine the target path based on the target second nodes, the preset starting point and the preset end point, comprises: Determine a new target second node based on the adjusted preset first step length and the target second node until a distance between the target second node and the preset end point is less than or equal to a preset threshold; A target path is determined based on all target second nodes, a preset starting point, and a preset end point.
7. A path planning device, characterized in that: The device comprises: A search direction determination module, configured to determine a first node from a search tree based on a random sampling point, and determine a search direction according to the random sampling point and the first node, the first node being a node in the search tree that is closest to the random sampling point; A second node determination module, configured to determine a second node in the search direction based on the first node and a preset first step length; a target second node determination module, configured to determine whether there is an obstacle between the first node and the second node, to adjust the preset first step length based on the determination result and a preset adjustment parameter, and to determine the target second node; The path determination module is used to determine all the target second nodes based on the adjusted preset first step length, so as to determine the target path based on the target second node, the preset starting point and the preset end point.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the path planning method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the path planning method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the path planning method according to any one of claims 1 to 6.