A dynamic obstacle avoidance path planning method and system based on a graph neural network and a policy head
By constructing a sampling graph and combining time encoding and GraphSAGE aggregation mechanism, and using the policy head module for path decision-making, the problem of low efficiency in path planning of graph neural networks in dynamic environments is solved, and efficient and safe path planning is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN UNIV
- Filing Date
- 2026-02-27
- Publication Date
- 2026-07-03
AI Technical Summary
Existing graph neural network path planning methods struggle to model and integrate temporal and obstacle information in dynamic environments in real time, resulting in low path planning efficiency and lack of robustness, failing to meet real-time and safety requirements.
A dynamic obstacle avoidance path planning method based on graph neural networks and policy heads is adopted. By constructing a sampling graph and combining time encoding and GraphSAGE aggregation mechanism, high-dimensional temporal features are generated to achieve joint modeling of spatial topology and temporal dynamics. The policy head module is used for path decision making, and a backtracking mechanism is combined to ensure collision-free path planning.
It significantly improves the speed and safety of path planning, enabling the generation of safe, smooth, collision-free paths in complex dynamic environments, reducing computational overhead, and achieving millisecond-level online response capabilities.
Smart Images

Figure CN121740057B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of robot motion planning technology, and in particular relates to a dynamic obstacle avoidance path planning method and system based on graph neural networks and a strategy head. Background Technology
[0002] In recent years, with the rapid development of autonomous driving and robotics technologies, path planning in dynamic environments has become a research hotspot. Traditional path planning methods mainly include A*, D* Lite, and RRT series algorithms. These methods can generate relatively optimal paths in static environments, but motion planning in dynamic environments, such as multi-arm assembly and human-robot interaction, is more challenging than motion planning in static environments. Dynamic obstacles generate complex trajectories in spatiotemporal space, requiring motion planners to consider global geometric constraints in the configuration space at each time step. In recent years, deep learning-based path planning methods, especially deep reinforcement learning, have shown some effectiveness in dynamic environments, enabling robots to learn relatively robust policies. However, such methods often have two significant drawbacks: first, they heavily rely on large-scale scene data for effective convergence, and when the environmental topology or obstacle distribution changes, the policy often lacks transferability and struggles to maintain stable performance in new scenarios; second, the policy decision-making process is highly black-boxed, lacking interpretability at the geometric and topological levels, failing to provide sufficient support for the safety and verifiability of the planning results, and therefore difficult to directly apply to robot operation scenarios with extremely high real-time and safety requirements.
[0003] In recent years, Graph Neural Networks (GNNs) have been introduced into the field of path planning due to their advantages in processing graph-structured data. They can naturally handle the state space of graph structures, better characterize environmental topology and temporal constraints, and alleviate the generalization shortcomings of traditional deep reinforcement learning methods to some extent. However, existing GNN path planning methods mostly focus on static graph modeling, which is insufficient for handling the temporal features of dynamic obstacles, making it difficult to meet the real-time and robustness requirements of practical applications. At the same time, the structural updates and time modeling of the model in dynamic environments incur significant overhead.
[0004] Therefore, there is an urgent need for an improved graph neural network method that can model in real time in dynamic environments, fuse temporal and obstacle information, and generate efficient paths. Summary of the Invention
[0005] To address the above technical problems, this invention provides a dynamic obstacle avoidance path planning method and system based on graph neural networks and a strategy head.
[0006] The technical solution adopted by this invention to solve its technical problem is:
[0007] A dynamic obstacle avoidance path planning method based on graph neural networks and a policy head, the method comprising the following steps:
[0008] S100: Random sampling is performed in the robot's configuration space to generate a set of sampling points. The starting point and the target point are included in the point set to form a vertex set. Based on the k-nearest neighbor method, edge relationships are established between the vertex sets to construct a sampling graph describing the feasible connectivity of the configuration space.
[0009] S200: Acquire trajectory information of dynamic obstacles in the environment at different times, and generate high-dimensional temporal features by combining the time step and the position encoding mechanism;
[0010] S300: Input the sampled graph into the graph neural network, iteratively update the features of nodes and edges through the GraphSAGE aggregation mechanism, and fuse the dynamic information of obstacles to achieve joint modeling of spatial topology and temporal dynamics, generating node and edge embeddings with spatiotemporal constraints;
[0011] S400: Based on the current node position of the robot, extract the embedding features of its candidate edges, and combine them with high-dimensional temporal features and target point state vectors. Input the data into the strategy head module, output the priority distribution of each candidate edge, and select the optimal edge as the next path decision.
[0012] S500: If an infeasible edge or a blocked path is encountered, a backtracking mechanism is triggered to reselect a suboptimal edge from historical nodes until a collision-free feasible path from the starting point to the target point is planned.
[0013] Preferably, S200 includes:
[0014] S210: Let the decision time be... The time-coded vector is denoted as , of which and The dimensions are defined as follows:
[0015]
[0016] in, The frequency base can be set as a constant or a learnable parameter. The time encoding dimension is set according to task requirements. This represents the total number of time steps.
[0017] S220: At the Decision-Making Moment Use a length of time window :
[0018]
[0019] Each obstacle at the decision-making moment The workspace position vector is denoted as It is encoded into obstacle feature representation by a multilayer perceptron. Flatten the feature representation of all obstacles within the time window as follows:
[0020]
[0021] S230: The flattened obstacle features are flattened and concatenated with the corresponding time codes, and then added to obtain the temporal features that fuse spatial and temporal location information, specifically:
[0022] .
[0023] Preferably, S300 includes:
[0024] S310: Initial encoding of nodes: Let the embedding dimension be... For nodes The initial embedding is:
[0025]
[0026] in, For the first The initial embedding vector of each node. For the first Each node is configured with a vector. Let the target point vector be... The difference between the current node and the target point. To square element by element, It is a two-layer perceptron used to capture the geometric relationship between nodes and target points and map the concatenated vectors to the embedding space;
[0027] S320: Initial encoding of edges: For edges The initial embedding is:
[0028]
[0029] in, For the edge The initial embedding vector, The direction / displacement of the edge. Let these be the positions of the nodes at both ends of the edge. It is a two-layer perceptron used to capture the direction of the edge and the geometric relationship between the two end nodes;
[0030] S330: Obstacle and Attention Fusion: The trajectory data within the obstacle time window is projected through the corresponding neural network and added to the time code to obtain the dynamic representations of the node side and the edge side, respectively. Specifically:
[0031]
[0032] in, Let the obstacle be the workspace position vector within the time window. , Two neural networks encoded by multilayer perceptrons map obstacle features to the representation spaces of nodes and edges, respectively.
[0033] Subsequently, the node feature vectors are updated through multi-head attention and interaction with nodes and edges. and edge eigenvectors :
[0034]
[0035]
[0036] in, For nodes In the The eigenvectors of the next iteration. For the edge In the The eigenvectors of the next iteration. , LN represents layer normalization.
[0037] Preferably, S300 further includes:
[0038] S340: GraphSAGE-based message passing: Node updates are performed using GraphSAGE nearest neighbor aggregation, iteratively... The layers are specifically:
[0039]
[0040] in, For nodes In the Features of layer time, For nodes In the Features of layer time, For the first The output of the layer, For neighborhood aggregation functions, It is a linear transformation matrix. For activation function, Let be the set of edges of the graph;
[0041] S350: Edges are updated through element-wise maximization.
[0042]
[0043] in, It is a multilayer perceptron;
[0044] S360: Embed the updated edges Writing to a 3D tensor Among them, for existing edges ,have:
[0045]
[0046] like Then the three-dimensional tensor Set to 0, where, This represents the set of edges generated by the nearest neighbor criterion.
[0047] Preferably, S400 includes:
[0048] S410: Construct each candidate edge The input feature vector, the input feature vector The following three parts are concatenated to obtain: edge embedding features, high-dimensional temporal features, and the target point state vector, namely:
[0049]
[0050] in, For the edge Embedding features, The state vector of the target point;
[0051] S420: Input the input feature vector into a two-layer perceptron for forward computation to obtain the priority scores of candidate edges:
[0052]
[0053]
[0054] in, This is the weight matrix. The bias term is ReLU, which is a non-linear activation function. For the edge The score;
[0055] S430: For the same node The priority scores of all candidate edges are normalized and then converted into a probability distribution using the softmax function:
[0056]
[0057] in Represents a node The set of all neighbors, Indicates the selection of edges The probability, For the edge The score;
[0058] S440: Select the candidate edge with the highest probability as the optimal edge for the current decision, and perform collision detection on that edge.
[0059] Preferably, S500 includes:
[0060] S510: When the optimal edge is detected to be infeasible due to obstruction by an obstacle, the second-best candidate edge in the current probability distribution is selected for collision detection.
[0061] S520: If all candidate edges of the current node are not feasible, the backtracking mechanism is triggered, and the process of selecting candidate edges is re-executed from the set of visited nodes to the previous node.
[0062] S530: Through repeated selection, collision detection, and backtracking processes, ensures that a collision-free path from the starting point to the target point is planned in a complex and dynamic environment;
[0063] S540: When the robot reaches the target point, the planning process is successfully terminated; if no feasible path is found within the preset time or number of steps, the path planning is deemed to have failed.
[0064] Preferably, the method uses a cross-entropy loss function to perform end-to-end optimization of the policy head module and the graph neural network during the training phase. Specifically:
[0065]
[0066] in, The edges given by the expert planner The true choice label, Selection edge for strategy head output The probability of.
[0067] A dynamic obstacle avoidance path planning system based on graph neural networks and a policy head includes:
[0068] The sampling graph construction module is used to randomly sample in the robot's configuration space, generate a set of sampling points, and include the starting point and the target point into the point set to form a vertex set. Based on the k-nearest neighbor method, edge relationships are established between the vertex sets to construct a sampling graph that describes the feasible connectivity of the configuration space.
[0069] The high-dimensional temporal feature generation module is used to acquire the trajectory information of dynamic obstacles in the environment at different times, and generate high-dimensional temporal features by combining the time step and the position encoding mechanism.
[0070] The node and edge embedding generation module is used to input the sampled graph into the graph neural network, iteratively update the features of nodes and edges through the GraphSAGE aggregation mechanism, and fuse high-dimensional temporal features to achieve joint modeling of spatial topology and temporal dynamics, generating node and edge embeddings with spatiotemporal constraints.
[0071] The optimal edge selection module is used to extract the embedding features of candidate edges based on the current node position of the robot, and combine them with the obstacle time window features and the target point state vector. The input is then sent to the strategy head module, which outputs the priority distribution of each candidate edge and selects the optimal edge as the next path decision.
[0072] The collision-free feasible path planning module is used to trigger a backtracking mechanism if an infeasible edge is encountered or the path is blocked, and to reselect a suboptimal edge from the historical nodes until a collision-free feasible path from the starting point to the target point is planned.
[0073] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of a dynamic obstacle avoidance path planning method based on a graph neural network and a policy head.
[0074] A computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of a dynamic obstacle avoidance path planning method based on a graph neural network and a policy head.
[0075] The aforementioned dynamic obstacle avoidance path planning method and system based on graph neural networks and policy heads transforms complex path search into efficient graph node decision-making by fusing graph neural networks with time coding. This avoids the large amount of geometric sampling and collision detection required by traditional methods, significantly improving planning speed. At the same time, the model can accurately perceive the movement trend of dynamic obstacles, enabling early avoidance, and combined with a backtracking mechanism, ensures the stable generation of safe, smooth, and collision-free paths in complex dynamic environments. Attached Figure Description
[0076] Figure 1 This is a flowchart of a dynamic obstacle avoidance path planning method based on graph neural networks and a strategy head in one embodiment of the present invention;
[0077] Figure 2 This is a schematic diagram illustrating the principle framework of a dynamic obstacle avoidance path planning method based on graph neural networks and a strategy head in one embodiment of the present invention.
[0078] Figure 3 This is a schematic diagram of a simulation model of a robotic arm in one embodiment of the present invention;
[0079] Figure 4 This is a schematic diagram of the working space of the robotic arm in one embodiment of the present invention;
[0080] Figure 5 This is a schematic diagram of the simulation environment setup in one embodiment of the present invention;
[0081] Figure 6 The following are schematic diagrams illustrating the planning of different algorithms in one embodiment of the present invention: (a) is a schematic diagram illustrating the planning of the algorithm proposed in the present invention, (b) is a schematic diagram illustrating the planning of the GCN algorithm, (c) is a schematic diagram illustrating the planning of the GAT algorithm, and (d) is a schematic diagram illustrating the planning of the SAGE algorithm. Detailed Implementation
[0082] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0083] In one embodiment, such as Figure 1 and Figure 2 As shown, a dynamic obstacle avoidance path planning method based on graph neural networks and a policy head is proposed. The method includes the following steps:
[0084] S100: Random sampling is performed in the robot's configuration space to generate a set of sampling points. The starting point and the target point are included in the point set to form a vertex set V. Based on the k-nearest neighbor method, edge relationships are established between the vertex sets to construct a sampling graph G=(V,E) that describes the feasible connectivity of the configuration space, where E represents the set of edges generated by the nearest neighbor criterion.
[0085] S200: Acquires trajectory information of dynamic obstacles in the environment at different times, and generates high-dimensional temporal features by combining the time step and the position encoding mechanism; enables the model to capture the dynamic characteristics of obstacles changing over time and provide temporal constraints for subsequent path planning;
[0086] S300: Input the sampled graph into the graph neural network (GNNet), iteratively update the features of nodes and edges through the GraphSAGE aggregation mechanism, and fuse the dynamic information of obstacles (including their workspace location and temporal encoding) to achieve joint modeling of spatial topology and temporal dynamics, generating node and edge embeddings with spatiotemporal constraints;
[0087] S400: Based on the current node position of the robot, extract the embedding features of its candidate edges, and combine them with high-dimensional temporal features and target point state vectors. Input the feature into the policy head module, output the priority distribution of each candidate edge, and select the optimal edge as the next path decision.
[0088] S500: If an infeasible edge or a blocked path is encountered, a backtracking mechanism is triggered to reselect a suboptimal edge from historical nodes until a collision-free feasible path from the starting point to the target point is planned.
[0089] The aforementioned dynamic obstacle avoidance path planning method based on graph neural networks and a policy head transforms the complex geometric search problem into an efficient graph node decision problem by constructing a sampling graph and using graph neural networks for spatiotemporal joint modeling. This avoids the computational overhead of traditional methods requiring extensive sampling and collision detection in high-dimensional spaces. The policy head module can output decisions in real time based on the current environmental state, achieving millisecond-level online response. An innovative temporal encoding mechanism is introduced, and the trajectory information of dynamic obstacles is deeply fused with the graph neural network as a high-dimensional temporal feature. This enables the model to accurately perceive and predict the movement trends of obstacles, allowing for early avoidance during planning and significantly improving obstacle avoidance capability and path safety in dynamic environments. The method combines connectivity guarantees and backtracking mechanisms from the sampling graph, ensuring that even in complex scenarios encountering local optima or deadlocks, a new path can be selected through backtracking, ultimately generating a stable, collision-free feasible path from the starting point to the target point, guaranteeing the completion rate of the planning task.
[0090] In one embodiment, the present invention introduces a position encoding mechanism in the time dimension to enhance the model's ability to model dynamic obstacle trajectories. Position encoding was first applied in the Transformer architecture to represent the sequential information of a sequence. In dynamic motion planning problems, robots not only need to focus on the geometric position of obstacles in space, but also need to infer the relative position of obstacles in the time series, as well as their interaction with the robot itself at each time step. Therefore, the present invention adds sine and cosine encoding corresponding to the time step to the obstacle's workspace position to explicitly characterize the temporal features. S200 includes:
[0091] S210: Let the time range be... The time-coded vector is denoted as , of which and The dimensions are defined as follows:
[0092]
[0093] in, The frequency base can be set as a constant or a learnable parameter. The time encoding dimension is set according to task requirements. The total number of time steps; by alternating sine and cosine functions of different frequencies, this encoding can uniquely identify different time steps in a high-dimensional space, thereby helping the model distinguish and learn the dynamic patterns of obstacles.
[0094] S220: In actual implementation, at the decision-making moment Use a length of Time window:
[0095]
[0096] Each obstacle at time step The workspace position vector is denoted as It is encoded into obstacle feature representation by a multilayer perceptron. Flatten the feature representation of all obstacles within the time window as follows:
[0097]
[0098] S230: The flattened obstacle features are flattened and concatenated with the corresponding time codes, and then added to obtain the temporal features that fuse spatial and temporal location information, specifically:
[0099] .
[0100] The obstacle features are added element-wise with the time code of the corresponding time step to simultaneously carry spatial and temporal location information. This design allows the model to capture the periodic and nonlinear changes of obstacles over time, thereby improving prediction and planning capabilities in complex dynamic environments.
[0101] Specifically, a temporal encoding mechanism is introduced, which uses the idea of positional encoding from Transformers. This encourages neural networks to capture temporal patterns from high-frequency input signals. By encoding time, the network can understand dynamic changes in temporal data and achieve obstacle avoidance. In particular, temporal encoding helps the model capture the positional changes of obstacles at different points in time and provides temporal information for subsequent path planning, thereby enhancing the model's adaptability to dynamic obstacles.
[0102] Furthermore, the present invention in the sampling diagram The algorithm employs graph neural networks (GNNs) for feature updates and introduces GraphSAGE (Sample and Aggregation) as the core operator to reduce the overhead of graph structure updates in dynamic environments. It also introduces an attention mechanism to acquire obstacles.
[0103] After obtaining the sampled graph, the nodes and edges are first initially encoded so that they can be fed into the graph neural network for subsequent message passing and updates.
[0104] In one embodiment, S300 includes:
[0105] S310: Initial encoding of nodes: Let the embedding dimension be... For nodes The initial embedding is:
[0106]
[0107] in, For the first The initial embedding vector of each node. For the first Each node is configured with a vector. Let the target point vector be... The difference between the current node and the target point. To square element by element, It is a two-layer perceptron used to capture the geometric relationship between nodes and target points and map the concatenated vectors to the embedding space;
[0108] S320: Initial encoding of edges: For edges The initial embedding is:
[0109]
[0110] in, For the edge The initial embedding vector, The direction / displacement of the edge. Let these be the positions of the nodes at both ends of the edge. It is a two-layer perceptron used to capture the direction of the edge and the geometric relationship between the two end nodes;
[0111] S330: Obstacle and Attention Fusion: The trajectory data within the obstacle time window is projected through the corresponding neural network and added to the time code to obtain the dynamic representations of the node side and the edge side, respectively. Specifically:
[0112]
[0113] in, Let the obstacle be the workspace position vector within the time window. , Two neural networks encoded by multilayer perceptrons map obstacle features to the representation spaces of nodes and edges, respectively.
[0114] Subsequently, the node feature vectors are updated through multi-head attention and interaction with nodes and edges. and edge eigenvectors :
[0115]
[0116]
[0117] in, For nodes In the The eigenvectors of the next iteration. For the edge In the The eigenvectors of the next iteration. , LN stands for layer normalization. This allows for the effective integration of obstacle dynamics into the representation of nodes and edges.
[0118] Specifically, to address the path planning problem in complex obstacle environments, this invention introduces a multi-head attention mechanism. The multi-head attention module can weight obstacle features from multiple angles, optimizing the interaction between obstacles and the path. Through this mechanism, the system can effectively avoid multiple dynamic obstacles, ensuring the robot can successfully complete its tasks in complex and dense environments.
[0119] In one embodiment, S300 further includes:
[0120] S340: GraphSAGE-based message passing: GraphSAGE nearest neighbor aggregation is used to update nodes iteratively. The layers are specifically:
[0121]
[0122] in, For nodes In the Features of layer time, For nodes In the Features of layer time, For the first The output of the layer, For neighborhood aggregation functions, It is a linear transformation matrix. For activation function, Let be the set of edges of the graph;
[0123] S350: Edges are updated through element-wise maximization.
[0124]
[0125] in, For a multilayer perceptron, a new edge vector is calculated using the features of nodes i and j. The maximum value is taken element by element, and the "old edge vector" and the "new edge vector calculated based on the latest node" are fused. This ensures that the edge representation dynamically incorporates the latest node geometric information, while improving robustness by maximizing the value element by element.
[0126] S360: Embed the updated edges Writing to a 3D tensor Among them, for existing edges ,have:
[0127]
[0128] like Then the three-dimensional tensor Set to 0, where, This represents the set of edges generated by the nearest neighbor criterion. This facilitates the rapid extraction of candidate edge features of the current node during inference, which can then be used as input for subsequent policy head modules.
[0129] Specifically, the SAGE (Sample and Aggregation) network effectively addresses the high overhead of structural updates and temporal modeling in dynamic environments through a local update mechanism. The SAGE network achieves efficient updates of information within local regions by sampling and feature aggregation of each node's local neighborhood, rather than performing global updates to the entire graph. This local update approach significantly reduces computational complexity, especially in dynamic environments, enabling robots to quickly respond to changes in obstacles and targets while maintaining low computational overhead. By aggregating information from neighboring nodes, the SAGE network effectively captures changes in the surrounding environment, enhancing the robot's perception of dynamic obstacles and enabling path planning to be completed quickly and accurately in complex environments.
[0130] Furthermore, when the robot is performing path planning, it is at a certain node. It is necessary to select edges from all candidates. Choose one to continue. The strategy head is to complete this "scoring + selection" step.
[0131] In one embodiment, S400 includes:
[0132] S410: Construct each candidate edge The input feature vector, the input feature vector The following three parts are concatenated to obtain: edge embedding features, high-dimensional temporal features, and the target point state vector, i.e.:
[0133]
[0134] in, For the edge Embedding features, The state vector of the target point;
[0135] S420: Input the input feature vector into a two-layer perceptron for forward computation to obtain the priority scores of candidate edges:
[0136]
[0137]
[0138] in, Here is the weight matrix, and here are the learnable parameters. The bias term is ReLU, which is a non-linear activation function. For the edge The score.
[0139] S430: For the same node The priority scores of all candidate edges are normalized and then converted into a probability distribution using the softmax function:
[0140]
[0141] in Represents a node The set of all neighbors, Indicates the selection of edges The probability, For the edge The score;
[0142] S440: Select the candidate edge with the highest probability as the optimal edge for the current decision, and perform collision detection on that edge.
[0143] Specifically, this invention also incorporates a goal-based policy head decision-making mechanism, capable of dynamically generating path selections based on the current environment and target location. This policy head not only considers the shortest path between the robot's current and target locations but also comprehensively considers the relative positions and dynamic changes of obstacles and their impact on path planning. Specifically, the policy head provides optimal action decisions for each planning step by outputting edge selection probabilities based on edge features. In goal-oriented path planning, the policy head selects the most suitable edge as the next action based on real-time calculated path costs and environmental states. Through a softmax activation function, this decision-making mechanism can dynamically adjust the selection probability based on edge features, ensuring that path selection has global optimality and local adaptability. If an infeasible path or obstacle blockage is encountered, the system will automatically initiate a backtracking mechanism, returning to the previous node and selecting a suboptimal path, ensuring the robot can move robustly in complex and dynamic environments.
[0144] In one embodiment, S500 includes:
[0145] S510: When the optimal edge is detected to be infeasible due to obstruction by an obstacle, the second-best candidate edge in the current probability distribution is selected for collision detection.
[0146] S520: If all candidate edges of the current node are not feasible, the backtracking mechanism is triggered, and the process of selecting candidate edges is re-executed from the set of visited nodes to the previous node.
[0147] S530: Through repeated selection, collision detection, and backtracking processes, ensures that a collision-free path from the starting point to the target point is planned in a complex and dynamic environment;
[0148] S540: When the robot reaches the target point, the planning process is successfully terminated; if no feasible path is found within the preset time or number of steps, the path planning is deemed to have failed.
[0149] In one embodiment, the method uses a cross-entropy loss function to perform end-to-end optimization of the policy head module and the graph neural network during the training phase. Specifically:
[0150]
[0151] in, The edges given by the expert planner The true choice label, Selection edge for strategy head output The probability of.
[0152] In one of the most detailed embodiments, the inputs to the entire scheme are: a sampling map in the configuration space, information on obstacle trajectories in the workspace, and the robot's current state. The output is a vector of priority values on candidate edges in the robot's current state. The following is a detailed implementation flow of the method proposed in this invention, including two stages: training and inference:
[0153] Training Phase: Within a predefined workspace and configuration space, a large number of path planning problems are generated using random sampling. Each example includes: a sampling graph structure, a starting point and a target point, and a sequence of obstacle trajectories. In practical applications, the obstacle trajectory sequence can be obtained through temporal prediction algorithms, such as predicting future motion after observing a portion of the trajectory using a visual sensor, thus approximating the global trajectory information. The starting point and target point can be manually set or randomly sampled, ensuring no initial collision with obstacles. To provide supervision signals to the neural network, this invention uses the SIPP (Safe Interval Path Planning) algorithm as an expert planner. SIPP can generate a collision-free optimal path from the starting point to the target point, considering dynamic obstacle constraints. Each path is transformed into a sequence of node and edge selections in the sampling graph, serving as training labels. The obstacle's workspace position vector O within the time window is projected through a multilayer perceptron (MLP) and added to the temporal code TE to obtain dynamic representations for the node and edge sides, respectively. Node and edge features are interactively updated through a multi-head attention mechanism. After attention fusion, the sampled graph is input into the GraphSAGE encoder and iteratively updated through a neighbor sampling and feature aggregation mechanism.
[0154] For each node, samples are taken from its neighbor set, and neighbor features are aggregated (mean or max pooling) to achieve efficient local updates while reducing computational complexity. Temporal features of obstacles are injected into nodes and edges via an attention mechanism, and then diffused globally using iterative aggregation in GraphSAGE, allowing spatiotemporal constraints to propagate throughout the graph. End-to-end optimization with the policy head module is performed during training, gradually bringing the representations of nodes and edges closer to the distribution of expert paths. After multiple iterative updates in GraphSAGE, node and edge embeddings that integrate spatial topology and temporal dynamic information are obtained and used as input to the policy head. These embeddings are then input into the policy head, outputting the priority distribution of candidate edges. During training, the edge selection of expert paths is used as a supervision signal, and a loss function is employed for optimization, enabling the model to learn to mimic the decision-making behavior of experts. The loss function used is cross-entropy. ,in Select labels for the edges given by the experts. This represents the probability distribution output by the policy head. However, relying solely on expert data can lead to distribution shift, where the model only sees expert trajectories during training, and encounters unseen states in actual operation, resulting in performance degradation. To address this issue, this invention employs a data aggregation method: during training, the model first uses the current policy for path planning, recording the states visited and edge choices made. Then, the expert planner (SIPP) is invoked to provide correct edge choices for these states, and this new data is merged with the original training set to form a richer dataset. This process is repeated to gradually improve the model's robustness and generalization ability under non-ideal states. The entire network comprises a graph neural network encoder (for modeling topology and obstacle interactions) and a goal-based policy head (for edge selection decisions). The parameters of both parts are updated end-to-end during training, with the optimization objective being to minimize the imitation learning loss function. After training, the model can quickly generate near-expert-level path selection policies in dynamic environments.
[0155] Inference Phase: After training, the method of this invention can be directly applied to new dynamic environments to perform online path planning. The specific process is as follows: First, random sampling is performed in the robot's new configuration space to obtain a set of sampling points. Edge relationships are generated based on the k-nearest neighbor method to construct a sampling graph G=(V,E), while the starting point and target point are included in the vertex set V. Obstacle Temporal Encoding and Attention Fusion: The real-time trajectories of obstacles in the environment are acquired and sine and cosine position encoding is performed to form high-dimensional time window features. After mapping the obstacle trajectories through a multilayer perceptron, they are added element-wise with the time encoding to obtain dynamic temporal features. Subsequently, the node and edge features are updated interactively with the obstacle temporal features through a multi-head attention mechanism, enabling the model to perceive the dynamic changes of obstacles in real time. Graph Neural Network Iterative Update: The initial encodings of nodes and edges are input into the graph neural network and combined with the obstacle temporal features through an attention mechanism to obtain spatiotemporally enhanced node and edge representations. The GraphSAGE operator is used to aggregate neighborhood information for each node and iteratively update it to ensure that the embedding of nodes and edges simultaneously includes local geometric relationships and global temporal dynamics. Strategy head decision: at the robot's current position node Extract the feature vectors of all candidate outgoing edges. Concatenate the candidate edge features with the obstacle time window features and the target point features, and input them into the policy head module. After two layers of perceptron mapping, the policy head outputs a score for each edge, which is then converted into a probability distribution using softmax to obtain the priority of the next edge. Select the feasible edge with the highest probability as the current action. Collision detection and backtracking mechanism: If the optimal edge is infeasible due to obstacle blockage, the second-best edge is selected; if all candidate edges are infeasible, backtrack to the previous node and reselect. Through the backtracking mechanism, the system can still ensure the continuity and robustness of planning in complex environments. Path generation and execution: Repeat the above process until the robot reaches the target point from the starting point, forming a complete collision-free path. If no path is found within the limited time or number of steps, the planning is considered a failure.
[0156] To verify the feasibility of this method, a simulation model of the ABBgofa5 robotic arm was first performed, such as... Figure 3 As shown, Figure 4 This forms the workspace for the robotic arm. Then, 1000 training and test sets are collected in a simulation environment. The size and location of obstacles and the trajectory of the obstacle-laden robotic arm are randomly generated for each set. A red sphere is marked at the end of the obstacle-laden robotic arm. Each set is similar to... Figure 5 As shown in the table below, the success rate and efficiency of different planning methods were compared.
[0157]
[0158] Where PTGNN represents the method implemented in this example, success_rate represents the proportion of times the planner successfully finds a collision-free feasible path from the starting point to the target in all test tasks, collision_check represents the number of times the algorithm performs collision detection on candidate paths or candidate actions during the planning process, and Path_time_ratio is the path execution time ratio, which is the ratio of the execution time of the planned path to the theoretical optimal time (or expert path time). In terms of success rate: the success rates of traditional GNN+TE and GAT+TE are 0.93 and 0.90, respectively, indicating that failures still exist in some complex dynamic environments; the success rate of GASE+TE with the introduction of the SAGE structure is improved to 0.95; the GASE+TE+GP method proposed in this invention further improves it to 0.96, close to the level of the expert planner SIPP (1.0); in terms of efficiency: the method of this invention is significantly better than the traditional method in terms of the number of collision detections, and only 50 collisions are needed to complete the planning; in contrast, although SIPP, as an expert algorithm, can guarantee the optimal solution, it requires a large number of costly collision detections (up to 430,605 times), making it difficult to meet the real-time requirements. Other baseline methods such as GAT+TE (108 times), GNN+TE (47 times), and GASE+TE (83 times) are all inferior to this invention in terms of efficiency. Regarding path quality, the path execution time ratio of this invention is 2.10, significantly better than GNN+TE (3.77) and GAT+TE (3.06), and close to GASE+TE (2.14), approaching the theoretical optimal path (1.0). This indicates that this invention can generate highly efficient paths approaching expert levels while ensuring path feasibility. In summary, this invention can significantly reduce collision detection overhead while maintaining a high success rate in dynamic environments and generate near-optimal paths. It outperforms existing learning methods in both efficiency and quality, approaching the performance of expert-level planners.
[0159] Meanwhile, this invention compared different methods in a test case, such as... Figure 6 As shown in Figures (a)-(d), the path planning results of different algorithms under the same dynamic environment are presented. The blue curve represents the planned path, the red dot is the starting point, the green dot is the target point, and the black dot and black rectangle represent the movement trajectory of the dynamic obstacle and the static obstacle, respectively. The results show that PTGNN exhibits better planning ability, and its path can effectively avoid dynamic obstacles while maintaining a shorter travel distance.
[0160] This invention significantly improves the path planning performance of robots in dynamic environments through the above-mentioned innovative methods. In particular, it enables efficient and safe path planning in complex dynamic obstacle and human-robot collaborative scenarios, and effectively improves the motion planning efficiency of robots in complex scenarios, especially in human-robot collaborative scenarios.
[0161] In one embodiment, a dynamic obstacle avoidance path planning system based on graph neural networks and a policy head is also provided, comprising:
[0162] The sampling graph construction module is used to randomly sample in the robot's configuration space, generate a set of sampling points, and include the starting point and the target point into the point set to form a vertex set. Based on the k-nearest neighbor method, edge relationships are established between the vertex sets to construct a sampling graph that describes the feasible connectivity of the configuration space.
[0163] The high-dimensional temporal feature generation module is used to acquire the trajectory information of dynamic obstacles in the environment at different times, and generate high-dimensional temporal features by combining the time step and the position encoding mechanism.
[0164] The node and edge embedding generation module is used to input the sampled graph into the graph neural network, iteratively update the features of nodes and edges through the GraphSAGE aggregation mechanism, and fuse high-dimensional temporal features to achieve joint modeling of spatial topology and temporal dynamics, generating node and edge embeddings with spatiotemporal constraints.
[0165] The optimal edge selection module is used to extract the embedding features of candidate edges based on the current node position of the robot, and combine them with the obstacle time window features and the target point state vector. The input is then sent to the strategy head module, which outputs the priority distribution of each candidate edge and selects the optimal edge as the next path decision.
[0166] The collision-free feasible path planning module is used to trigger a backtracking mechanism if an infeasible edge is encountered or the path is blocked, and to reselect a suboptimal edge from the historical nodes until a collision-free feasible path from the starting point to the target point is planned.
[0167] For specific limitations regarding the dynamic obstacle avoidance path planning system based on graph neural networks and policy heads, please refer to the limitations of the dynamic obstacle avoidance path planning method based on graph neural networks and policy heads mentioned above, which will not be repeated here. Each module in the aforementioned dynamic obstacle avoidance path planning system based on graph neural networks and policy heads can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0168] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of a dynamic obstacle avoidance path planning method based on a graph neural network and a policy head.
[0169] In one embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of a dynamic obstacle avoidance path planning method based on a graph neural network and a policy head.
[0170] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0171] The foregoing has provided a detailed description of the dynamic obstacle avoidance path planning method and system based on graph neural networks and a strategy head provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this invention.
Claims
1. A dynamic obstacle avoidance path planning method based on a graph neural network and a policy head, characterized in that, The method includes the following steps: S100: Random sampling is performed in the robot's configuration space to generate a set of sampling points. The starting point and the target point are included in the point set to form a vertex set. Based on the k-nearest neighbor method, edge relationships are established between the vertex sets to construct a sampling graph describing the feasible connectivity of the configuration space. S200: Acquire trajectory information of dynamic obstacles in the environment at different times, and generate high-dimensional temporal features by combining the time step and the position encoding mechanism; S300: Input the sampled graph into the graph neural network, iteratively update the features of nodes and edges through the GraphSAGE aggregation mechanism, and fuse the dynamic information of obstacles to achieve joint modeling of spatial topology and temporal dynamics, generating node and edge embeddings with spatiotemporal constraints; S400: Based on the current node position of the robot, extract the embedding features of its candidate edges, and combine them with high-dimensional temporal features and target point state vectors. Input the data into the strategy head module, output the priority distribution of each candidate edge, and select the optimal edge as the next path decision. S500: If an infeasible edge or a blocked path is encountered, a backtracking mechanism is triggered to reselect a suboptimal edge from historical nodes until a collision-free feasible path from the starting point to the target point is planned.
2. The method of claim 1, wherein, S200 includes: S210: Let the decision time be... The time-coded vector is denoted as , of which and The dimensions are defined as follows: in, The frequency base can be set as a constant or a learnable parameter. The time encoding dimension is set according to task requirements. This represents the total number of time steps. S220: At the Decision-Making Moment Use a length of time window : Each obstacle at the decision-making moment The workspace position vector is denoted as It is encoded into obstacle feature representation by a multilayer perceptron. Flatten the feature representation of all obstacles within the time window as follows: S230: The flattened obstacle features are flattened and concatenated with the corresponding time codes, and then added to obtain the temporal features that fuse spatial and temporal location information, specifically: 。 3. The method according to claim 2, characterized in that, The S300 includes: S310: Initial encoding of nodes: Let the embedding dimension be... For nodes The initial embedding is: in, For the first The initial embedding vector of each node. For the first Each node is configured with a vector. Let the target point vector be... The difference between the current node and the target point. To square element by element, It is a two-layer perceptron used to capture the geometric relationship between nodes and target points and map the concatenated vectors to the embedding space; S320: Initial encoding of edges: For edges The initial embedding is: in, For the edge The initial embedding vector, The direction / displacement of the edge. Let these be the positions of the nodes at both ends of the edge. It is a two-layer perceptron used to capture the direction of the edge and the geometric relationship between the two end nodes; S330: Obstacle and Attention Fusion: The trajectory data within the obstacle time window is projected through the corresponding neural network and added to the time code to obtain the dynamic representations of the node side and the edge side, respectively. Specifically: in, Let the obstacle be the workspace position vector within the time window. , Two neural networks encoded by multilayer perceptrons map obstacle features to the representation spaces of nodes and edges, respectively. Subsequently, the node feature vectors are updated through multi-head attention interactions with nodes and edges. and edge feature vectors : in, For nodes In the The eigenvectors of the next iteration. For the edge In the The eigenvectors of the next iteration. , LN represents layer normalization.
4. The method according to claim 3, characterized in that, The S300 also includes: S340: GraphSAGE-based message passing: Node updates are performed using GraphSAGE nearest neighbor aggregation, iteratively... The layers are specifically: in, For nodes In the Features of layer time, For nodes In the Features of layer time, For the first The output of the layer, For neighborhood aggregation functions, It is a linear transformation matrix. For activation function, Let be the set of edges of the graph; S350: Edges are updated through element-wise maximization. in, It is a multilayer perceptron; S360: Embed the updated edges Writing to a 3D tensor Among them, for existing edges ,have: like Then the three-dimensional tensor Set to 0, where, This represents the set of edges generated by the nearest neighbor criterion.
5. The method according to claim 4, characterized in that, The S400 includes: S410: Construct each candidate edge The input feature vector, the input feature vector The following three parts are concatenated to obtain: edge embedding features, high-dimensional temporal features, and the target point state vector, namely: in, For the edge Embedding features, The state vector of the target point; S420: Input the input feature vector into a two-layer perceptron for forward computation to obtain the priority scores of candidate edges: in, This is the weight matrix. The bias term is ReLU, which is a non-linear activation function. For the edge The score; S430: For the same node The priority scores of all candidate edges are normalized and then converted into a probability distribution using the softmax function: in Represents a node The set of all neighbors, Indicates the selection of edges The probability, For the edge The score; S440: Select the candidate edge with the highest probability as the optimal edge for the current decision, and perform collision detection on that edge.
6. The method according to claim 5, characterized in that, The S500 includes: S510: When the optimal edge is detected to be infeasible due to obstruction by an obstacle, the second-best candidate edge in the current probability distribution is selected for collision detection. S520: If all candidate edges of the current node are not feasible, the backtracking mechanism is triggered, and the process of selecting candidate edges is re-executed from the set of visited nodes to the previous node. S530: Through repeated selection, collision detection, and backtracking processes, ensures that a collision-free path from the starting point to the target point is planned in a complex and dynamic environment; S540: When the robot reaches the target point, the planning process is successfully terminated; if no feasible path is found within the preset time or number of steps, the path planning is deemed to have failed.
7. The method according to claim 6, characterized in that, The method employs a cross-entropy loss function to perform end-to-end optimization of the policy head module and the graph neural network during the training phase. Specifically: in, The edges given by the expert planner The true choice label, Selection edge for strategy head output The probability of.
8. A dynamic obstacle avoidance path planning system based on graph neural networks and a policy head, characterized in that, include: The sampling graph construction module is used to randomly sample in the robot's configuration space, generate a set of sampling points, and include the starting point and the target point into the point set to form a vertex set. Based on the k-nearest neighbor method, edge relationships are established between the vertex sets to construct a sampling graph that describes the feasible connectivity of the configuration space. The high-dimensional temporal feature generation module is used to acquire the trajectory information of dynamic obstacles in the environment at different times, and generate high-dimensional temporal features by combining the time step and the position encoding mechanism. The node and edge embedding generation module is used to input the sampled graph into the graph neural network, iteratively update the features of nodes and edges through the GraphSAGE aggregation mechanism, and fuse high-dimensional temporal features to achieve joint modeling of spatial topology and temporal dynamics, generating node and edge embeddings with spatiotemporal constraints. The optimal edge selection module is used to extract the embedding features of candidate edges based on the current node position of the robot, and combine them with the obstacle time window features and the target point state vector. The input is then sent to the strategy head module, which outputs the priority distribution of each candidate edge and selects the optimal edge as the next path decision. The collision-free feasible path planning module is used to trigger a backtracking mechanism if an infeasible edge is encountered or the path is blocked, and to reselect a suboptimal edge from the historical nodes until a collision-free feasible path from the starting point to the target point is planned.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
High-speed communication chip macro placement method based on reinforcement learning
CN120975026A
Machine Learning based Fixed-Time Optimal Path Generation
US20190184561A1