A robot motion planning method based on a graph attention network and a related device
Patent Information
- Application Number
- CN202310737800.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-06-20
AI Technical Summary
[0004]但上述规划方法中,目标偏置不等同于最优路径偏置;路径偏置大都只对优化过程中的采样区域进行约束,通过限制路径优化过程中的采样区域加速了算法收敛,其初始路径求解本身仍未在RRT*的基础上得到改进
[0024]本发明基于GAT所构建的神经网络模型可以很好的学习图型结构数据的特征,对不同环境(障碍物分布、起始点和目标点)下的路径点分布进行预测,在对具体规划问题进行求解时,该算法以一定概率进行非均匀随机采样,即以一定概率选取预测路径点集中的点作为采样点,降低了采样点生成过程中的随机性,提高了采样点的质量,因此得到了高质量的初始解,加速了算法优化过程,实现了快速运动规划。
Smart Images

Figure CN116795111B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of path planning technology, and relates to a robot motion planning method and related devices based on graph attention networks. Background Technology
[0002] Algorithms proposed and used for robot motion planning problems can be mainly divided into three categories: spatial search methods based on geometric construction, motion planning algorithms based on trajectory optimization, and motion planning algorithms based on sampling. Sampling-based motion planning is more efficient in handling high-dimensional robot motion planning problems. Its basic idea is to determine a finite set of obstacle avoidance configurations that can fully represent the connectivity of free space, used to solve the path graph problem in motion planning environments containing obstacles. The two most commonly used algorithms in random sampling planning are the Probabilistic Roadmap Method (PRM) and the Rapidly-exploring Random Tree (RRT). Liu Huajun et al., in their review of mobile robot motion planning research, compared PRM and RRT. Compared to PRM, the RRT algorithm fully considers the objective constraints of the robot (such as nonholonomic constraints and motion dynamics constraints), and the obtained trajectory is more reasonable. Although RRT can find a path solution, the quality of the solution converges to suboptimal with probability 1, meaning it can never find the optimal path. To address this issue, Sertac et al. proposed RRT*, which adds parent node reselection and rewiring steps to RRT. If an optimal solution exists, RRT* guarantees that the probability of finding the optimal solution approaches 1 as the number of iterations approaches infinity. However, under uniform global sampling, RRT* obtains the optimal solution to the planning problem by asymptotically finding the optimal path from the initial state to every state in the problem domain, which is inconsistent with its single-query nature (emphasizing finding feasible paths, i.e., speed) and is inefficient. To maintain algorithm efficiency while finding a good solution, a common approach is to first find a feasible initial solution and then optimize based on it. The quality of the initial solution is closely related to the distribution of sampling points during the solution process, making this type of motion planning sensitive to the sampling distribution and difficult to guarantee the quality of the initial solution and the algorithm's convergence time.
[0003] Some algorithms overcome this limitation through different heuristics, such as path bias and target bias. Akgun et al. proposed a bidirectional RRT*, which, once an initial solution is found, iterates and optimizes the current solution with a user-defined number of iterations. During optimization, states are randomly selected on the current path solution, and then samples are taken within its Voronoi domain. The sampling points are biased towards the current solution path during optimization, attempting to find better solutions around the current solution. Nasir et al. proposed RRT*-SMART, which first smooths the path after finding the initial solution to minimize the number of states in the path, and then performs path bias optimization on the current solution. Gammell et al. proposed Informed RRT*, which first obtains the initial solution based on RRT*, defines an ellipsoidal region as the sampling region for subsequent optimization based on the path cost of the initial solution, and resamples within this region to seek a better path. The sampling space is further adjusted based on the better path, and the adaptive sampling configuration space is used for optimal path planning. The speed of the planning algorithm is improved by biasing the sampling region, but the initial solution solution process is not improved based on RRT*. Qureshi et al. proposed P-RRT* and APGD-RRT*, combining the Artificial Potential Field (APF) method and RRT* to guide random sampling points toward the target, reducing the randomness of random tree search and expansion and improving the speed of RRT*. Liang Zhongyi and Xu Na introduced the concept of target bias into the basic RRT*, setting the target configuration as a random sampling point with a certain probability when generating new nodes, that is, accelerating the expansion of the random tree toward the target.
[0004] However, in the above planning methods, the objective bias is not equivalent to the optimal path bias; path biases mostly only constrain the sampling region during the optimization process. While limiting the sampling region accelerates algorithm convergence, the initial path solution itself is not improved upon RRT*. Furthermore, the heuristics defined in these methods are not universal and are only effective in certain environments. Although they offer some improvements in computational speed, these heuristics are not perfect in improving the quality of the initial solution and require further research. Summary of the Invention
[0005] The purpose of this invention is to solve the problems in the prior art and provide a robot motion planning method and related device based on graph attention network. This invention constructs a neural network model based on GAT to predict the distribution of path points under given planning conditions, provides a reference for the sampling process of Informed RRT*, reduces the randomness in the sampling process, improves the quality of the initial solution, and accelerates the convergence of the algorithm.
[0006] To achieve the above objectives, the present invention employs the following technical solution:
[0007] In a first aspect, the present invention provides a robot motion planning method based on graph attention networks, comprising the following steps:
[0008] Initialize the robot's motion state and solve for the initial solution;
[0009] The sampling method is selected based on the initial solution, and the joint configuration set is obtained through the sampling method.
[0010] Joint configurations are randomly selected from the set of joint configurations as sampling points;
[0011] The function Nearest obtains the distance s between existing nodes in the current tree. rand The nearest node θ nearest The positions x of each joint and end effector are obtained through forward kinematics. nearest ;
[0012] Based on the positions of each joint and end effector x nearest The joint configuration θ is obtained by expanding the nodes using the Steer function. new The positions x of each joint and end effector of the robot are obtained by combining forward kinematics. new ;
[0013] Position x of each joint and end effector new Perform collision detection until the maximum number of iterations is reached, and then output the optimal path.
[0014] Secondly, the present invention provides a robot motion planning system based on graph attention networks, comprising:
[0015] The initialization module is used to initialize the robot's motion state and solve for the initial solution.
[0016] The sampling method selection module is used to select the sampling method based on the initial solution and obtain the joint configuration set through the sampling method.
[0017] The sampling point selection module is used to randomly select joint configurations as sampling points from the set of joint configurations;
[0018] The first calculation module is used to obtain the distance sampling point s among the existing nodes in the current tree through the function Nearest. rand The nearest node θ nearest The positions x of each joint and end effector are obtained through forward kinematics. nearest ;
[0019] The second calculation module is used to calculate based on the position x of each joint and end effector. nearest The joint configuration θ is obtained by expanding the nodes using the Steer function. newThe positions x of each joint and end effector of the robot are obtained by combining forward kinematics. new ;
[0020] The optimal path output module is used to output the position x of each joint and end effector. new Perform collision detection until the maximum number of iterations is reached, and then output the optimal path.
[0021] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0022] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] This invention utilizes a neural network model built upon GAT, which effectively learns the characteristics of graph-structured data and predicts the distribution of path points in different environments (obstacle distribution, starting point, and target point). When solving specific planning problems, the algorithm performs non-uniform random sampling with a certain probability, selecting points from the predicted path point set as sampling points. This reduces the randomness in the sampling point generation process, improves the quality of sampling points, and thus obtains a high-quality initial solution, accelerates the algorithm optimization process, and achieves rapid motion planning. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart of the method of the present invention.
[0027] Figure 2 This is a schematic diagram of the system of the present invention.
[0028] Figure 3 This is a schematic diagram of the neural network model structure based on GAT in this invention.
[0029] Figure 4 This is a schematic diagram of the overall process of the motion planning method (GAT-InformedRRT*) of the present invention;
[0030] Figure 5 This is a visualization diagram of the dataset of the present invention;
[0031] Figure 6 This provides the initial solution paths for InformedRRT* and GAT-InformedRRT* in different scenarios in this invention.
[0032] Figure 7 This is a graph showing the convergence rate of the algorithm in different scenarios in this invention. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0034] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0035] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0036] In the description of the embodiments of the present invention, it should be noted that if terms such as "upper," "lower," "horizontal," or "inner" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of the invention is in use, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Furthermore, terms such as "first" and "second" are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0037] Furthermore, the use of the term "horizontal" does not imply that the component must be absolutely horizontal, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0038] In the description of the embodiments of the present invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.
[0039] The present invention will now be described in further detail with reference to the accompanying drawings:
[0040] See Figure 1 This invention discloses a robot motion planning method based on graph attention networks, comprising the following steps:
[0041] S1 initializes the robot's motion state and solves for the initial solution; the robot's motion state includes the position and orientation of the base, the initial configuration of the joint angles, the initial position x0 of the end effector, and the target position x. goal .
[0042] S2 selects the sampling method based on the initial solution and obtains the joint configuration set through the sampling method;
[0043] S3 randomly selects joint configurations from the set of joint configurations as sampling points;
[0044] S4 obtains the distance sampling point s between existing nodes in the current tree using the function Nearest. rand The nearest node θ nearest The positions x of each joint and end effector are obtained through forward kinematics. nearest ;
[0045] S5 determines the position of each joint and end effector x nearest The joint configuration θ is obtained by expanding the nodes using the Steer function. new The positions x of each joint and end effector of the robot are obtained by combining forward kinematics. new ;
[0046] S6 positions x of each joint and end effector new Perform collision detection until the maximum number of iterations is reached, and then output the optimal path.
[0047] In a feasible embodiment of the present invention, solving for the initial solution includes:
[0048] The target configuration θ is solved using robot inverse kinematics. goal ;
[0049] For the target configuration θgoal Given environmental information, a trained neural network model is used to predict joint configurations in feasible paths, resulting in a set of predicted joint configurations Θ. pred .
[0050] In a feasible embodiment of the present invention, selecting the sampling method based on the initial solution includes:
[0051] Determine whether an initial solution has been obtained to select different sampling methods;
[0052] a. If an initial solution has been obtained, then begin path optimization:
[0053] Calculate the cost of the existing solutions and compare them to obtain the optimal cost c. best Sampling is performed using the InformedSample module, as detailed below:
[0054] a1) Based on cost c best Define a heuristic sampling region in Cartesian space, where points in the region have the potential to improve the quality of the current solution;
[0055] a2) To fully utilize the advantages of the Cartesian space sampling region and the convenience of joint space sampling, a probability p1 is generated by random number generation. If p1 < 0.5, then random sampling is performed in the joint space to obtain joint configurations and added to the joint configuration set S. rand In the middle; if p1≥0.5, then based on cost c best Random sampling is performed within a defined heuristic sampling region to obtain sampling points x in Cartesian space. rand Then, the joint angle variables in the corresponding joint space are obtained through inverse kinematics, and the resulting joint configuration is added to the joint configuration set S. rand middle;
[0056] b. If an initial solution has not yet been obtained, sampling points are generated using the NNSample module, which includes both uniform and non-uniform sampling methods. A probability p2 is generated using random numbers. If p2 < 0.5, random sampling is performed in the joint space to obtain the joint configuration and added to the set S. rand If p2 ≥ 0.5, then:
[0057] b1) Traverse the nodes in the tree and find the joint configuration corresponding to the node whose end effector is closest to the target. And the distance between the end effector and the target at this time.
[0058] b2) The distance between the end effector and the target Reference configuration θ serves as a further filter for the predicted joint configuration set. referenceTraverse and predict the set of joint configurations Θ pred The joint configurations in the model are used to calculate the predicted joint configuration set Θ according to equation (1). pred The joint configuration and reference configuration θ reference Distance between cost pred :
[0059] cost pred =||θ pred ,θ reference ||2 (1)
[0060] Where δ is a preset parameter;
[0061] If cost pred If the value is less than δ, then the configuration is added to the joint configuration set Θ obtained through further filtering. SampleSet If the condition is met, continue iterating; otherwise, continue iterating.
[0062] b3) The distance between the end effector and the target As a reference cost reference ; Traverse the joint configuration set Θ SampleSet The joint configuration in the model; firstly, the end effector position x in the current base state is calculated using the robot's forward kinematics. pred Calculate the cost of reaching the target state from the current state in Cartesian space according to equation (2):
[0063] cost = ||x pred ,x goal ||2 (2)
[0064] If cost < cost reference Then the predicted joint configuration will be added to the joint configuration set S. rand middle.
[0065] In one feasible embodiment of the present invention, the position x of each joint and end effector new Collision detection includes:
[0066] If a collision occurs, the set of joint configurations S is re-evaluated. rand Randomly select joint configurations as sampling points until the set of joint configurations S is traversed. rand If no collision occurs:
[0067] 1) Perform parent node reselection and reconnection operations on the new node;
[0068] 2) Determine if the target has been reached. If not, re-enter the joint configuration set S. rand Randomly select joint configurations as sampling points until the set of joint configurations S is traversed. rand If already arrived, then:
[0069] (a) Update the set containing the solution;
[0070] (b) Determine whether the set of joint configurations S has been traversed. rand If the path has already been traversed, determine if the maximum number of iterations has been reached and output the optimal path; otherwise, start again from the joint configuration set S. rand Randomly select joint configurations as sampling points until the set of joint configurations S is traversed. rand .
[0071] like Figure 2 As shown, this embodiment of the invention discloses a robot motion planning system based on graph attention networks, comprising:
[0072] The initialization module is used to initialize the robot's motion state and solve for the initial solution.
[0073] The sampling method selection module is used to select the sampling method based on the initial solution and obtain the joint configuration set through the sampling method.
[0074] The sampling point selection module is used to randomly select joint configurations as sampling points from the set of joint configurations;
[0075] The first calculation module is used to obtain the distance sampling point s among the existing nodes in the current tree through the function Nearest. rand The nearest node θ nearest The positions x of each joint and end effector are obtained through forward kinematics. nearest ;
[0076] The second calculation module is used to calculate based on the position x of each joint and end effector. nearest The joint configuration θ is obtained by expanding the nodes using the Steer function. new The positions x of each joint and end effector of the robot are obtained by combining forward kinematics. new ;
[0077] The optimal path output module is used to output the position x of each joint and end effector. new Perform collision detection until the maximum number of iterations is reached, and then output the optimal path.
[0078] The principle of this invention:
[0079] RRT and RRT-based motion planning methods find feasible paths between the initial and target configurations by constructing a randomly expanding tree in the state space. Essentially, it's a randomly generated data structure—a tree. Tree structures are data structures with branches and hierarchical relationships between nodes. Graph structures, with their network structure and emphasis on relationships between nodes, are more complex than tree structures. Tree structures can also be considered a special case of graph structures, a constrained graph structure. Graph Neural Networks (GNNs) are effective learning networks for graph structure data. This invention proposes the GAT-Informed RRT* algorithm, which is built based on the Graph Attention Network (GAT) in graph neural networks. Figure 3 The neural network model shown predicts the distribution of path points under given planning conditions. The predicted points are used as reference points in the sampling process to reduce the randomness of the sampling process, improve the quality of the obtained initial solution path, and accelerate the convergence process of the algorithm.
[0080] like Figure 4 As shown, Figure 4 Another feasible embodiment disclosed in this invention is a motion planning method, comprising the following steps:
[0081] Step 1: Initialize the robot's motion state, including the position and orientation of the base, the initial configuration of the joint angles, the initial position x0 and target position x0 of the end effector. goal .
[0082] Step 2: Solve for the initial solution based on the robot's motion state; first, solve for the target configuration θ using the robot's inverse kinematics. goal Then, for the target configuration θ goal Given environmental information (obstacles), a trained neural network model is used to predict the joint configurations in feasible paths, resulting in a predicted joint configuration set Θ. pred .
[0083] Step 3: Determine whether an initial solution has been obtained to select different sampling methods.
[0084] a. If an initial solution has been obtained, path optimization begins. First, the cost of the existing solutions is calculated, and the optimal cost c is obtained by comparison. best Then, the InformedSample module is used for sampling, as follows:
[0085] 3-1) Based on cost c best Define a heuristic sampling region in Cartesian space, where points in the region have the potential to improve the quality of the current solution;
[0086] 3-2) To fully utilize the advantages of the Cartesian space sampling region and the convenience of joint space sampling, a probability p1 is generated by random number generation. If p1 < 0.5, random sampling is performed in the joint space to obtain the joint configuration and add it to the joint configuration set S. rand In the middle; if p1≥0.5, then based on cost c best Random sampling is performed within a defined heuristic sampling region to obtain sampling points x in Cartesian space. rand Then, the joint angle variables in the corresponding joint space are obtained through inverse kinematics, and the resulting joint configuration is added to the joint configuration set S. rand In this case, the set of joint configurations S rand It contains only one set of joint configurations.
[0087] b. If an initial solution has not yet been obtained, sampling points are generated using the NNSample module. To ensure the probabilistic completeness of the algorithm, this module includes both uniform and non-uniform sampling methods. A probability p2 is generated using random numbers. If p2 < 0.5, random sampling is performed in the joint space to obtain the joint configuration, which is then added to the set S. rand If p2 < 0.5 is not satisfied, then:
[0088] 3-2-1) Traverse the nodes in the tree and find the joint configuration corresponding to the node whose end effector is closest to the target. And the distance between the end effector and the target at this time.
[0089] 3-2-2) with Reference configuration θ serves as a further filter for the predicted joint configuration set. reference traversing Θ pred The joint configuration in the figure is calculated, and its relationship with the reference configuration θ is determined. reference Distance between cost pred The calculation method is shown in the following formula:
[0090] cost pred =||θ pred ,θ reference ||2 (1)
[0091] If the cost is satisfied pred If the value is less than δ, then the configuration will be added to the joint configuration set Θ obtained through further filtering. SampleSet In this step, δ is a preset parameter; if the condition is not met, the iteration continues. This step reduces the number of sampling points in subsequent sampling processes by eliminating predicted joint configurations in the predicted configuration set that differ too much from the reference configuration.
[0092] 3-2-3) with As a reference cost reference Traverse set ΘSampleSet The joint configuration in the model is first calculated using the robot's forward kinematics to determine the end effector position x in the current base state. pred The cost of reaching the target state from the current state in Cartesian space is calculated using the following formula:
[0093] cost = ||x pred ,x goal ||2 (2)
[0094] If cost < cost reference Then add the predicted joint configuration to the joint configuration set S. rand middle.
[0095] Step 4: From the joint configuration set S rand Randomly select joint configurations as sampling points s rand .
[0096] Step 5: Obtain the distance sampling point s among the existing nodes in the current tree using the Nearest function. rand The nearest node θ nearest And the positions x of each joint and end effector in Cartesian space are obtained through forward kinematics. nearest ;
[0097] Step 6: Expand the nodes using the Steer function to obtain θ. new The positions x of each joint and end effector of the robot are obtained by combining forward kinematics. new ;
[0098] Step 7: Assess the positions x of each joint and end effector of the robot. new Perform collision detection; if a collision occurs, proceed to step 4 until the set of joint configurations S is traversed. rand If no collision occurs:
[0099] 7-1) Perform parent node reselection and reconnection operations on the new node;
[0100] 7-2) Determine if the target has been reached. If not, proceed to step 4 until the joint configuration set S is traversed. rand If already arrived, then:
[0101] (a) Update the set containing the solution;
[0102] (b) Determine whether the set of joint configurations S has been traversed. rand If the set of joint configurations has already been traversed, proceed to step 8; otherwise, proceed to step 4 until the set of joint configurations S has been traversed. rand .
[0103] Step 8: Determine if the maximum number of iterations has been reached. If not, go to step 3; if so, output the optimal path and end the motion planning.
[0104] This invention uses the motion planning of a particle in a planar obstacle environment as an example for numerical simulation. Before performing motion planning, the GAT-InformedRRT* algorithm requires training the GAT-CVAE model to obtain model parameters. Therefore, a particle motion planning dataset in a planar obstacle environment is first generated, and a GAT-based neural network model is trained based on this dataset. When planning the motion of the particle, two different planning conditions are set, and the GAT-Informed RRT* algorithm is used to plan the particle motion under both conditions. The resulting plans are then compared and analyzed with those obtained from Informed RRT*.
[0105] To address the motion planning problem of a particle in a planar obstacle environment, this embodiment constructs different planning scenarios by adjusting the start point, end point, and obstacle distribution. Specifically, a 100×100 two-dimensional grid map is randomly generated, and 50 square obstacles are randomly placed in each map. The side length of each obstacle is randomly selected from [1, 3, 5]. Then, in obstacle-free areas, the A* algorithm and JPS algorithm are randomly selected for motion planning to obtain path data under different scenarios. Finally, 10,000 planning data points under different planning conditions are obtained. A data visualization example is shown below. Figure 6 As shown.
[0106] torch_geometric is a PyTorch library that facilitates the construction and training of graph neural network models and the creation of graph-structured datasets. In this embodiment, the dataset construction module is used to convert the obtained path planning data into graph-structured data, with path points in the path information serving as nodes in the graph, and path point coordinates as node features. The planning results vary depending on obstacle distribution and the settings of the start and end points; therefore, the start and end point coordinates and obstacle distribution are set as condition variables. 0 represents an obstacle-free area in the planning environment, and 1 represents an area with obstacles. Thus, the obstacle environment distribution is represented by a 1×10000 vector. The final condition variable size is 1×10004, and the node feature size is 1×2.
[0107] The neural network model based on GAT was trained using the Adam optimizer with its default parameters. The hyperparameters were set as follows: learning rate of 0.005 (no decay during training); batch size of 64; and epoch size of 100.
[0108] Two scenarios were set up during the simulation, with identical obstacle distributions but different starting and target point locations. The obstacle setup was the same as during dataset construction, consisting of 50 randomly selected square obstacles with side lengths randomly chosen from [1, 3, 5]. In scenario one, the starting point was set to [5, 3] and the target point to [90, 70]; in scenario two, the starting point was set to [40, 10] and the target point to [55, 70]. Eulerian distance was used to calculate the path cost in this chapter, and the specific calculation formula is as follows:
[0109]
[0110] Motion planning for different scenarios was performed using the GAT-Informed RRT* and Informed RRT* algorithms, respectively. The simulation results are as follows: Figure 6 And as shown in the table below.
[0111] Figure 6 In the figure, (a) shows the initial solution obtained by Informed RRT* planning in scenario 1, (b) shows the initial solution obtained by GAT-Informed RRT* planning in scenario 1, (c) shows the initial solution obtained by Informed RRT* planning in scenario 2, and (d) shows the initial solution obtained by GAT-Informed RRT* planning in scenario 2. As can be seen from the figure, in the same scenario, GAT-Informed RRT*, which incorporates predicted path point information, constructs a simpler tree during the planning process, with fewer nodes and edges, and the cost of the initial solution path is significantly improved. In contrast, the tree constructed using Informed RRT* planning to obtain the initial solution is more complex, with more nodes and edges. The relevant data for the initial solutions obtained by the two algorithms in different scenarios are shown in the table below. In both scenarios, the initial solution path cost obtained by GAT-Informed RRT* is better than that of Informed RRT*, and the number of sampling points is significantly reduced, resulting in a shorter time required to solve the initial solution.
[0112] Figure 7 The figure shows the convergence rates of the two algorithms under different scenarios. As can be seen from the figure, GAT-Informed RRT* consistently produces higher quality initial solutions in different scenarios, enabling the algorithm to converge faster. Furthermore, within the same time frame, the final solution path cost obtained by GAT-Informed RRT* is less than that of Informed RRT*, meaning that GAT-Informed RRT* can converge to a better solution path in a shorter time.
[0113] Initial solution path data obtained by different algorithms
[0114]
[0115] RRT* Algorithm Principle Analysis
[0116] The RRT* algorithm, proposed by Karaman in 2010, is an asymptotically optimal path planning algorithm based on RRT (Rapidly-exploring Random Tree). It adds parent node reselection and reconnection steps to RRT, improving the quality of the obtained solution. As the planning time approaches infinity, the probability of obtaining the optimal solution through this algorithm approaches 1. The pseudocode of the RRT* algorithm is shown in the table below. The path planning process using RRT* is as follows:
[0117] First, initialize the entire state space and define the starting point x. start Target point x goal Number of sampling points K, and neighborhood radius r of the determined neighborhood set. RRT* Starting from point x start The tree is expanded by using it as the root node of the tree T. In each iteration, a random sampling point x is obtained by uniformly sampling randomly in the state space. rand The function Nearest is used to find the distance x from the random sampling point in the set of nodes in the tree. rand The nearest point x nearest Then, the Steer function is used to generate a new node x. new .
[0118] For a new node, first determine the origin from x. nearest To x new If there are obstacles between them, discard the point; otherwise, use x. nearest Add the point to the tree for the parent node. (Using r) RRT * is the radius; iterate through the nodes in the tree and use the Near function to find node x. new The set of neighboring nodes X near Next, we reselect the parent node and traverse X. near The node in the middle is used as x new The parent node will make x new The point closest to the starting point is set to x. new The new parent node; during the reconnection process, traverse X. near For each node in the set, calculate x... new The distance from the parent node to the starting point, expressed as x. new If the cost to the parent node is lower, then x will be lower. new Set it as the parent node of this node. Repeat the above steps until the maximum number of iterations is reached.
[0119] RRT* Algorithm Pseudocode
[0120]
[0121]
[0122] When RRT* solves a given planning problem, after obtaining an initial solution, it improves the solution quality by using new sampling points. During the solution process, RRT* randomly samples points throughout the entire state space. Random sampling throughout the state space is beneficial for exploring the state space and approximating its connectivity; however, compared to the region where the solution is located, the entire state space is too large, so there may be cases where the randomly sampled points cannot contribute to solving the problem. This sensitivity to the distribution of sampling points means that the quality of the initial solution obtained when using the RRT* algorithm for planning cannot be guaranteed.
[0123] Informed RRT* Algorithm Principle Analysis
[0124] When using sampling-based motion planning methods to obtain a high-quality solution, a common approach is to first obtain a feasible initial solution, and then perform iterative optimization based on that initial solution. (Informed RRT*)
[36] RRT* is an optimal motion planning method proposed by Gammell et al. in 2014. It first obtains an initial solution through RRT* planning, and then optimizes the solution. The pseudocode of the Informed RRT* algorithm is shown in the table below.
[0125] Informed RRT* algorithm pseudocode
[0126]
[0127]
[0128] Informed RRT* first obtains an initial solution through RRT* planning. Then, it defines a heuristic sampling region based on the quality of the current solution. In subsequent iterative optimization processes, sampling is performed directly from this heuristic sampling region. By narrowing the range of the sampling space, the quality of the sampling points is improved, accelerating the algorithm's convergence process. The process of defining the heuristic sampling region is shown below.
[0129] For a given motion planning problem, the cost f(x) of the optimal path from the starting point to the ending point through the state x∈X is equal to the cost of the starting point x. start The cost g(x) of the optimal path to the current state x and the distance from the current state x to the target point x goal For planning problems that minimize path length, the Eulerian distance can be used to estimate the costs of the two parts mentioned above, potentially further improving the subset of states in the current solution within the state space. The cost c of the current solution can be used.best Represented as:
[0130]
[0131] The above equation is also the general equation for an n-dimensional elongated ellipsoid.
[0132] For a two-dimensional plane problem, this subset of states is an elliptical subset of states with the starting point and the target point as foci, and the distance between the starting point and the target point (the distance between the two foci) is the minimum cost c. min The major axis of the ellipse is the cost c of the current optimal path. best The minor axis is By limiting the sampling points in the optimization process to this region, the sampled points always have the potential to improve the path quality, thus improving the quality of the sampling points. Furthermore, the size of this sampling region is independent of the size of the entire sampling region. Therefore, regardless of the size of the planning problem, this method can always effectively optimize the path based on the initial solution.
[0133] Taking a two-dimensional planar heuristic sampling region as an example, directly performing uniform random sampling within an ellipse is quite difficult. We can utilize the relationship between an ellipse and a circle, first performing uniform random sampling within a unit circle, and then transforming it to sampling points within the ellipse. To do this, we first perform Cholesky decomposition on the hyperellipsoid matrix S to obtain the transformation matrix, i.e.:
[0134] LL T ≡S (5)
[0135] In the above formula, L is the required transformation matrix, and S is the hyperellipsoid matrix, satisfying the following equation:
[0136] (xx centre ) T S(xx centre )=1 (6)
[0137] The uniform sampling in the ellipsoid is obtained by transforming the uniform random sampling results within the unit sphere; that is, x is first obtained by uniform random sampling within the unit sphere. ball Then, uniform sampling within the ellipsoid is obtained through the following transformation:
[0138] x ellipse =Lx ball +x centre (7)
[0139] In the above formula Uniform sampling within the ellipsoid. For uniform random sampling within a unit sphere, where X ball ={x∈X|||x||2≤1}, x centre =(x f1 +xf2 ) / 2 is the center point of the hyperellipsoid, x f1 and x f2 Its focus.
[0140] The Informed RRT* algorithm defines an elliptical subset of the state space (in a two-dimensional plane, for example) based on the cost of the current solution. Each point in this subset has the potential to improve the quality of the current solution. During path optimization, the range of random sampling is restricted to this subset to obtain a high-quality sampling point, accelerating the optimization process. However, in the initial solution generation process, Informed RRT* does not improve upon RRT*, continuing its inherent drawback: sampling points obtained from random sampling across the entire state space may not necessarily contribute to the solution. This makes Informed RRT* continue to be sensitive to sampling distribution, leading to difficulties in guaranteeing the quality of the initial solution. The optimization process of Informed RRT* is closely related to the quality of the initial solution. Taking the two-dimensional plane path shortest path planning problem as an example, a higher-quality initial solution has a shorter path length, resulting in a smaller elliptical state space subset (i.e., a smaller sampling area). Therefore, the sampling points obtained during optimization are more likely to improve the quality of the current solution, leading to faster convergence. In summary, Informed RRT* suffers from sensitivity to sampling distribution, inability to guarantee the quality of the initial solution, and slow convergence time.
[0141] pseudocode for the NNSample module of the robot motion planning algorithm
[0142]
[0143] pseudocode for the robot motion planning algorithm InformedSample module
[0144]
[0145]
[0146] A computer device is provided according to an embodiment of the present invention. This computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the various method embodiments described above. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the various device embodiments described above.
[0147] The computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention.
[0148] The computer device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device may include, but is not limited to, a processor and memory.
[0149] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0150] The memory can be used to store the computer program and / or module, and the processor implements various functions of the computer device by running or executing the computer program and / or module stored in the memory, and by calling the data stored in the memory.
[0151] If the modules / units integrated into the computer device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0152] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A robot motion planning method based on graph attention networks, characterized in that, Includes the following steps: Initialize the robot's motion state and solve for the initial solution; the robot's motion state includes the position and orientation of the base, the initial configuration of the joint angles, and the initial position of the end effector. and target location ; The sampling method is selected based on the initial solution obtained, and the joint configuration set is obtained through the sampling method; the initial solution obtained includes: The target configuration is obtained by solving the robot's inverse kinematics. ; For the target configuration Given environmental information, a trained neural network model is used to predict joint configurations in feasible paths, resulting in a set of predicted joint configurations. ; The step of selecting the sampling method based on the initial solution includes: Determine whether an initial solution has been obtained to select different sampling methods; a. If an initial solution has been obtained, then begin path optimization: Calculate the cost of the existing solutions and compare them to obtain the optimal cost. Sampling is performed using the InformedSample module, as detailed below: a1) Based on cost Define a heuristic sampling region in Cartesian space, where points have the potential to improve the quality of the current solution; a2) To fully utilize the advantages of the Cartesian space sampling region and the convenience of joint space sampling, probabilities are generated through random numbers. ,like Then, random sampling is performed in the joint space to obtain joint configurations and they are added to the joint configuration set. In the middle; if Then based on cost Random sampling is performed within a defined heuristic sampling region to obtain sampling points in Cartesian space. Then, the joint angle variables in the corresponding joint space are obtained through inverse kinematics, and the resulting joint configuration is added to the joint configuration set. middle; b. If an initial solution has not yet been obtained, sampling points are generated using the NNSample module, which includes both uniform and non-uniform sampling methods; probabilities are generated using random numbers. ,like Then, random sampling is performed in the joint space to obtain the joint configuration and it is added to the set. In the middle; if ,but: b1) Traverse the nodes in the tree and find the joint configuration corresponding to the node whose end effector is closest to the target. And the distance between the end effector and the target at this time. ; b2) The distance between the end effector and the target Reference configurations for further screening of the predicted joint configuration set. Traverse the set of predicted joint configurations The joint configurations in the model are calculated according to equation (1) to predict the set of joint configurations. Joint configuration and reference configuration in Distance between : in, These are preset parameters; like Then add the configuration to the joint configuration set obtained through further filtering. If the condition is met, continue iterating; otherwise, continue iterating. b3) The distance between the end effector and the target As a reference cost Traversing the joint configuration set The joint configuration in the model; firstly, the position of the end effector in the current base state is calculated using the robot's forward kinematics. Calculate the cost of reaching the target state from the current state in Cartesian space according to equation (2): like Then the predicted joint configuration will be added to the joint configuration set. middle; Joint configurations are randomly selected from the set of joint configurations as sampling points; The Nearest function obtains the distance sampling point among the existing nodes in the current tree. The nearest node The positions of each joint and end effector are obtained through forward kinematics. ; Based on the position of each joint and end effector The joint configuration is obtained by expanding the nodes using the Steer function. The positions of the robot's joints and end effector are obtained by combining forward kinematics. ; Position of each joint and end effector Perform collision detection until the maximum number of iterations is reached, and then output the optimal path.
2. The robot motion planning method based on graph attention networks according to claim 1, characterized in that, The positions of each joint and end effector Collision detection includes: If a collision occurs, the joint configuration will be reassembled. Randomly select joint configurations as sampling points until the set of joint configurations has been traversed. If no collision occurs: 1) Perform parent node reselection and reconnection operations on the new node; 2) Determine if the target has been reached. If not, reassemble the joint configuration set. Randomly select joint configurations as sampling points until the set of joint configurations has been traversed. If already arrived, then: (a) Update the set containing the solution; (b) Determine whether the set of joint configurations has been traversed. If the path has already been traversed, determine if the maximum number of iterations has been reached and output the optimal path; otherwise, start from the joint configuration set again. Randomly select joint configurations as sampling points until the set of joint configurations has been traversed. .
3. A robot motion planning system based on graph attention networks for implementing the method of claim 1, characterized in that, include: The initialization module is used to initialize the robot's motion state and solve for the initial solution. The sampling method selection module is used to select the sampling method based on the initial solution and obtain the joint configuration set through the sampling method. The sampling point selection module is used to randomly select joint configurations as sampling points from the set of joint configurations; The first calculation module is used to obtain the distance sampling point among the existing nodes in the current tree through the function Nearest. The nearest node The positions of each joint and end effector are obtained through forward kinematics. ; The second calculation module is used to calculate based on the positions of each joint and the end effector. The joint configuration is obtained by expanding the nodes using the Steer function. The positions of the robot's joints and end effector are obtained by combining forward kinematics. ; The optimal path output module is used to output the position of each joint and end effector. Perform collision detection until the maximum number of iterations is reached, and then output the optimal path.
4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in claim 1 or 2.
5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in claim 1 or 2.
Citation Information
Patent Citations
Vehicle path planning method based on improved bidirectional informed-RRT*
CN113219998A
Path planning method and system, electronic equipment and readable storage medium
CN115617054A