Robot social self-adaptive path planning method and system based on neural network
By optimizing the path planning algorithm through neural networks, and comprehensively considering path length, pedestrian comfort, and obstacle distance, the balance problem of path planning in robot navigation is solved, and anthropomorphic path planning in human-computer interaction environments is realized.
Patent Information
- Application Number
- CN202211161335.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-09-23
AI Technical Summary
Existing robot path planning algorithms struggle to find a balance between path length and pedestrian comfort in human-computer interaction environments, potentially leading to issues such as interrupting pedestrian social interactions or excessively long paths during navigation.
A path planning method based on neural networks is adopted. By designing a neural network structure, initializing weights, generating a path planner, and comprehensively considering path length, pedestrian comfort, and obstacle distance, the path feature vector is calculated using the neural network, and homotopy penalty and weight update are performed to optimize path planning.
In complex human-computer interaction environments, more human-like paths are planned, improving the generalization ability of path planning and the real-time performance of navigation, thus enhancing the robot's adaptability in different environments.
Smart Images

Figure CN115562258B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and in particular to a method and system for robot social adaptive path planning based on neural networks. Background Technology
[0002] The increasing maturity of artificial intelligence technology has driven the development of mobile service robots. Currently, more and more robots are endowed with social rule awareness, their navigation behavior is becoming more socialized and anthropomorphic, and their adaptability to social navigation scenarios is stronger. Mobile robot path planning technology refers to the process by which a robot automatically plans a feasible path based on environmental map information and its starting point location without human intervention. The path is usually composed of a series of points. Compared to industrial robots, service robots operate in more complex environments. Considering the uncertainty of pedestrian movement, the real-time requirements for path planning are higher. Existing classic path planning algorithms can be roughly divided into four categories: grid-based path planning algorithms, artificial potential field-based path planning algorithms, reward-based path planning algorithms, and random sampling-based path planning algorithms. Among them, random sampling-based path planning algorithms avoid modeling the state space, greatly reducing planning time and memory costs, and are more suitable for solving path planning problems in dynamic human-robot interaction environments. Combining inverse reinforcement learning with random sampling-based path planning algorithms, by learning expert paths, can improve pedestrian comfort in human-robot interaction environments.
[0003] like Figure 1 As shown, taking Learning Robot Navigation Behaviors by Demonstration Using a RRT*Planner[1] as an example, the general steps of the path planning algorithm based on inverse reinforcement learning are briefly explained: (1) Generate demonstration paths: Based on S given scenarios, generate S demonstration paths; (2) Initialize weights: In the initialization stage, randomly generate a set of feature weights with a sum of 1; (3) Calculate the average feature sum of the demonstration paths: Calculate the average feature sum of the S paths for the above S scenarios. Where f1 represents the Euclidean distance to the target point; f2 represents the distance to the nearest obstacle; f 3-5(3) Represent the cost value of the Gaussian model in the front, back and right directions of the pedestrian respectively; (4) Update the cost map information: calculate the cost value of each point in the scene using the updated weights; (5) Generate the planned path: based on the cost value of each point in the scene, perform several path planning operations using the improved fast-exploring random tree algorithm [2] (Rapidly-exploring Random Tree*, RRT*); (6) Calculate the average feature sum of the planned path: calculate the average feature sum of the planned path in each scene. (7) Calculate the gradient: When a training cycle ends, calculate the average feature of the planned path and the gradient. Subtract the average characteristics of the demonstration path and Obtain the gradient. Otherwise, return to (4); (8) Update weights: Use gradient descent to... Update the feature weights for the gradient; (9) Termination: Terminate training when all feature weights converge. Otherwise, return to (4).
[0004] In step (5) above, the point with the smallest replacement value is selected as the growth point. When the RRT* algorithm calculates the replacement value, it considers the distance to the target point, the distance to the nearest obstacle, and the Gaussian model replacement value for the pedestrian in the front, back, and right directions. This ensures that the comfort of pedestrians can be improved while minimizing the length of the planned path.
[0005] Based on this, PRTIRL Based Socially Adaptive Path Planning for MobileRobots[3] introduces a homotopy penalty module. In step (6) above, homotopy detection and homotopy penalty are performed on the demonstration path and the planned path, and the average features of the penalized planned path are obtained. Increase the gradient for non-homogeneous scenarios. This, in turn, accelerates the convergence speed.
[0006] In a human-computer interaction environment, an RRT* planner is trained using an inverse reinforcement learning framework to plan a path that is similar to the demonstration path. This leads to a socially adaptive feature model to guide the robot's navigation in the human-computer interaction environment. However, the RRT* planner in the original framework uses a linear calculation model when calculating the cost function, which fails to accurately represent the interactions between features when updating feature weights. In real-world environments, people typically consider the interactions between these features comprehensively, and the impact of these features on the cost function may be non-linear. Therefore, the results obtained using a linear model may be inaccurate.
[0007] As human-computer interaction scenarios become increasingly complex, robots may navigate through crowds and disrupt pedestrian interactions. In real-world scenarios, we often want robots to sacrifice some path length to avoid congested areas during navigation. For example... Figure 2a As shown, although the planned path is short, it disrupts pedestrians' normal social interactions, which is undesirable. In specific scenarios, we want the robot to shorten the planned path as much as possible without interrupting pedestrian interactions. For example... Figure 2b As shown, although the planned route is far from the crowd, the route length is much longer than expected.
[0008] In conclusion, it is difficult for robots to find a balance between the two in real-world navigation scenarios. Summary of the Invention
[0009] Therefore, the technical problem to be solved by the present invention is to overcome the problem that wind turbines are easily affected by sea conditions in the prior art, resulting in low construction efficiency, and thus provide a neural network-based robot social adaptive path planning method that is less affected by sea conditions and maximizes the overall stability of wind turbines.
[0010] To address the aforementioned technical problems, this invention provides a robot social adaptive path planning method based on neural networks, comprising the following steps: Step S1: Generate demonstration paths based on a designed map scene, and collect demonstration paths; design a neural network structure, initialize neural network weights, and generate a path planner; Step S2: Calculate the cost map of the current scene, and based on the cost map, repeatedly generate planned paths using the path planner; calculate the feature vectors of the demonstration path and the planned path; determine whether the demonstration path and the planned path are homotopic; if yes, proceed to step S3; if no, apply a homotopic penalty to the feature vector of the planned path before proceeding to step S3. 3; Step S3: Update the feature vector of the planned path, determine whether a cycle has ended, if not, select the next map scene and return to step S2; if yes, proceed to step S4; Step S4: Calculate the feature difference between the demonstration path and the planned path for all scenes, determine whether the feature difference is less than the allowable error, if yes, proceed to step S5; if not, update the neural network in the path planner, determine whether it has converged, if yes, proceed to step S5, if not, select the next map scene and return to step S2; The method for determining whether the feature difference is less than the allowable error is: after each training cycle, obtain the feature vectors of the demonstration paths corresponding to S training scenes. and planned path feature vector
[0011] Calculate the feature difference E:
[0012]
[0013] Where Ω(f) represents the value obtained by inputting the feature vector into the neural network; it determines whether the feature difference E is less than the allowable error E. allowance If yes, proceed to step S5; otherwise, update the neural network in the path planner; Step S5: Training terminates, and the final neural network weights are output.
[0014] In one embodiment of the present invention, the method for collecting the demonstration path is as follows: in each scene, a starting point and a target point are set; using the ROS visualization tool RVIZ, the robot is remotely controlled by a handle to walk a smooth path from the starting point to the target point; a lidar is mounted on the robot, and while controlling the robot's movement, the robot collects information about the surrounding environment in real time.
[0015] In one embodiment of the present invention, the method for designing the neural network structure is as follows: according to the problem to be solved, multiple input feature values are replaced by the original linear addition to output their value through a neural network, and a fully connected network is selected; based on the multiple feature values of each node in the map, the input layer of the neural network structure is set to multiple neurons; the number of hidden layers and the number of neurons in each layer in the neural network structure are adjusted.
[0016] In one embodiment of the present invention, the method for initializing the weights of the neural network includes: first, determining the structure of the network; then, after the network structure is determined, initializing the weights by randomly generating values between 0 and 1; and after the neural network initialization is completed, performing pre-training of the network, including randomly generating feature vectors F = [f1, f2, f3, f4, f5]. T This is used as input, and the feature vector is passed through the linear model w = [w1, w2, w3, w4, w5] in the original planner. T The calculated value c is used as the output of the neural network. The formula for calculating c is:
[0017]
[0018] After pre-training, the network weight parameters converge, and the neural network at this point approximately represents the linear model. By combining the pre-trained neural network with the original path planner, the path planner can be obtained by calculating the cost value of each node through the neural network.
[0019] In one embodiment of the present invention, the method of repeatedly generating planned paths using the path planner is as follows: Step S21: Select growth points by random sampling; Step S22: Perform collision detection. If the collision detection passes, proceed to step S23; otherwise, return to step S21; Step S23: Calculate the feature vector F = [f1, f2, f3, f4, f5] of the growth points.T The cost of the current growth point is then derived from the neural network.
[0020]
[0021] Where n represents the number of neurons, w 1-5 The value corresponds to f 1-5 The value; Step S24: Calculate the cumulative cost value from the growth point to the neighboring nodes, and take the neighboring node with the smallest cumulative cost value as the parent node of the growth point to complete the reconnection process; Step S25: Calculate the distance between the growth point and the target point. If the distance is greater than the set distance, return to step S21; otherwise, it is considered that the destination has been reached and the planning is completed.
[0022] In one embodiment of the present invention, the method for calculating the feature vectors of the demonstration path and the planned path is as follows: first, the planned path is discretized into a series of points, that is, the line is converted into points; then, the feature vectors corresponding to each point are calculated; and the feature vectors of the path are calculated from the feature vectors of each point.
[0023]
[0024]
[0025]
[0026]
[0027]
[0028] f plan =[f plan_1 f plan_2 f plan_3 f plan_4 f plan_5 ] T
[0029] Where N represents the number of nodes on the path, dist represents the distance between the Nth point and the (N+1)th point, [f 1_1 f 1_2 f 1_3 f 1_4 f 1_5 ] T This represents the feature vector of the first node on the path; similarly, the feature vector of the example path can be calculated:
[0030] f demo =[f demo_1 f demo_2 f demo_3 f demo_4 fdemo_5 ] T .
[0031] In one embodiment of the present invention, the method for determining whether the demonstration path and the planned path are homotopic is as follows: if the planned path can be smoothly transformed into the demonstration path without colliding with obstacles and pedestrians, then the two paths are homotopic; otherwise, the two paths are not homotopic, and the length of the demonstration path is greater than the length of the planned path, and the planned path is penalized for homotopicity.
[0032] In one embodiment of the present invention, the method for applying homotopy penalty to the planned path is as follows: increase the feature vector value of the planned path, thereby increasing the penalty intensity.
[0033] f plan_i =f plan_i +c
[0034] c = (c1, c2, c3, c4, c5) T
[0035] Where f plan_i Let c1, c2, c3, c4, and c5 represent the penalty values for the five feature values of the planned path, respectively, corresponding to the feature vectors of the i-th path generated by the path planner; calculate the average feature vector of the planned path in the current scene:
[0036]
[0037] In one embodiment of the present invention, the method for updating the neural network in the path planner and determining whether it has converged in step S4 is as follows: Step S41: Set the backpropagation loss δ; wherein
[0038]
[0039] Step S42: Calculate the partial derivatives of each weight w and bias b.
[0040] Update weights w and biases b:
[0041]
[0042]
[0043] Where η represents the learning rate and δ represents the backpropagation error loss; Step S43: After updating the weights w and bias b in one round, perform an error judgment. If the error E is less than the allowable error E... allowance If the training terminates, proceed to step S5; otherwise, proceed to step S41.
[0044] This invention also provides a neural network-based robot social adaptive path planning system, comprising: a data acquisition and generation module, used to generate demonstration paths based on a designed map scene and acquire demonstration paths; design a neural network structure, initialize neural network weights, and generate a path planner; a first calculation module, used to calculate a cost map of the current scene, repeatedly generate planned paths using the path planner based on the cost map, calculate the feature vectors of the demonstration paths and the planned paths, determine whether the demonstration paths and the planned paths are homotopic, if so, proceed to the judgment module; if not, apply a homotopic penalty to the feature vectors of the planned paths before proceeding to the judgment module; and a judgment module, used to update the planned paths. The feature vector is used to determine whether a cycle has ended. If not, the next map scene is selected, and the program returns to the first calculation module; if yes, the program proceeds to the second calculation module. The second calculation module calculates the feature difference between the demonstration path and the planned path for all scenes, and determines whether the feature difference is less than the allowable error. If yes, training terminates, and the final neural network weights are output; if not, the neural network in the path planner is updated, and convergence is determined. If yes, training terminates, and the final neural network weights are output; if not, the next map scene is selected, and the program returns to the first calculation module. When determining whether the feature difference is less than the allowable error: after each training cycle, feature vectors of the demonstration paths corresponding to S training scenes are obtained. and planned path feature vector
[0045] Calculate the feature difference E:
[0046]
[0047] Where Ω(f) represents the value obtained by inputting the feature vector into the neural network; it determines whether the feature difference E is less than the allowable error E. allowance If yes, training terminates and the final neural network weights are output; otherwise, the neural network in the path planner is updated; training terminates and the final neural network weights are output.
[0048] The technical solution of the present invention has the following advantages compared with the prior art:
[0049] The neural network-based robot social adaptive path planning method and system described in this invention enables the path planner to comprehensively consider the mutual influence of interactive features in complex human-computer interaction environments. This allows the trained weights to accurately measure path length, pedestrian comfort model, and distance to the nearest obstacle, greatly enhancing the generalization ability in other environments and making the planned path more human-like. In addition, the neural network-based path planning algorithm facilitates the introduction of more human-computer interaction features during robot navigation, allowing for different navigation decisions for different interactive individuals. Attached Figure Description
[0050] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein...
[0051] Figure 1 This is a schematic diagram of a human-machine collaborative environment model;
[0052] Figure 2a This is the first impact of environmental uncertainty on path planning;
[0053] Figure 2b This is the second impact of environmental uncertainty on path planning;
[0054] Figure 3 This is a flowchart of the robot social adaptive path planning method based on neural networks according to the present invention;
[0055] Figure 4a It is the first type of specific scene map;
[0056] Figure 4b It is the second type of specific scene map;
[0057] Figure 5 This is the acquisition of the demonstration path in ROS according to the present invention;
[0058] Figure 6 This is a structural diagram of the neural network in the NN-RRT* path planner of this invention;
[0059] Figures 7a-7b This is the cost map derived from the data imported and calculated in this invention;
[0060] Figures 8a-8d This is the cost map derived from the data imported and calculated in this invention;
[0061] Figure 9 This invention relates to homotopy detection for demonstration paths and planned paths. Detailed Implementation
[0062] Example 1
[0063] like Figure 3As shown, this embodiment provides a robot social adaptive path planning method based on neural networks, including the following steps: Step S1: Generate a demonstration path according to the design map scene, and collect the demonstration path; design the neural network structure, initialize the neural network weights, and generate a path planner; Step S2: Calculate the cost map of the current scene, and repeatedly generate the planned path using the path planner based on the cost map; calculate the feature vectors of the demonstration path and the planned path; determine whether the demonstration path and the planned path are homotopic; if yes, proceed to step S3; if no, apply homotopic penalty to the feature vector of the planned path before proceeding to step S3. Step S3: Update the feature vector of the planned path, determine whether a cycle has ended, if not, select the next map scene and return to step S2; if yes, proceed to step S4; Step S4: Calculate the feature difference between the demonstration path and the planned path for all scenes, determine whether the feature difference is less than the allowable error, if yes, proceed to step S5; if not, update the neural network in the path planner, determine whether it has converged, if yes, proceed to step S5; if not, select the next map scene and return to step S2; The method for determining whether the feature difference is less than the allowable error is: after each training cycle, obtain the feature vectors of the demonstration paths corresponding to S training scenes. and planned path feature vector Calculate the feature difference E:
[0064]
[0065] Where Ω(f) represents the value obtained by inputting the feature vector into the neural network; it determines whether the feature difference E is less than the allowable error E. allowance If yes, proceed to step S5; otherwise, update the neural network in the path planner; Step S5: Training terminates, and the final neural network weights are output.
[0066] The neural network-based adaptive path planning method for robots described in this embodiment proposes a path planner that can comprehensively consider the mutual influence of interactive features in complex human-computer interaction environments. This allows the trained weights to accurately measure path length, pedestrian comfort model, and distance to the nearest obstacle, greatly enhancing the generalization ability in other environments and making the planned path more human-like.
[0067] In step S1, the human-computer interaction scene map is a two-dimensional grid map. First, obstacles are added to the map to simulate a real-world scene; these obstacles can be a wall, a pillar, etc. Pedestrians are then added based on the generated map, with information including the size of the pedestrian space, their position coordinates, and their speed and direction. After this information is added, it is visualized using the RVIZ tool, thus completing the human-computer interaction scene design.
[0068] The method for collecting demonstration paths is as follows: in each scenario, a starting point and a target point are set; using the ROS visualization tool RVIZ, the robot is remotely controlled by a handle to walk a smooth path from the starting point to the target point; a LiDAR is mounted on the robot, and while controlling the robot's movement, the robot collects information about the surrounding environment in real time.
[0069] The example path described therein consists of a series of points with timestamp information.
[0070] Specifically, the data collection demonstration path includes the following steps: In each scenario, a starting point and a target point are set; using the ROS visualization tool RVIZ, a robot can be remotely controlled with a handle to walk a smooth path from the starting point to the target point; a LiDAR is mounted on the robot, allowing it to collect information about the surrounding environment in real time while controlling its movement. Using the rosbag tool in ROS, the information can be stored in a bag file for later use in learning. The data recorded in rosbag includes: the coordinates of the starting and ending points, the robot's real-time coordinates, the coordinates of obstacles, and the coordinates and movement direction of pedestrians.
[0071] Based on the generated demonstration paths, a training set is created and input into the inverse reinforcement learning module, with a learning iteration count of n. The training set consists of bags containing S demonstration paths from different map scenes. By learning from the demonstration paths in different scenes, the planner makes its generated paths increasingly similar to the demonstration paths, ultimately achieving the effect of effectively avoiding pedestrians in complex human-computer interaction scenarios.
[0072] like Figure 4a and Figure 4b As shown, Figure 4a It contains information about obstacles in the static map. Figure 4b Pedestrian information, the robot's starting point, and target point were added to the static map. Figure 4b In response to the human-computer interaction environment, a crowded crowd was designed so that the robot could learn how to avoid the crowd during navigation.
[0073] like Figure 5As shown, in the RVIZ simulation environment of the ROS system, a robot is remotely controlled via a handle to walk along a demonstration path. The robot is equipped with a 360-degree LiDAR to collect data on the surrounding environment. The rosbag tool is used to record the collected data in real time, and a series of timestamped data is used as a demonstration path for a scene. In this embodiment, 25 scenes are set up (including 15 training sets and 10 validation sets). The start point, end point, obstacle, and pedestrian information are extracted from the dataset bag file and input into the inverse reinforcement learning framework to update and optimize the NN-RRT* planner. Through repeated iterative learning, an NN-RRT* path planner that can generate human-like paths in complex human-computer interaction environments can be obtained.
[0074] The method for designing the neural network structure is as follows: Based on the problem to be solved, multiple input feature values are replaced by a neural network to output their numerical value instead of the original linear summation; a fully connected network is selected; based on the multiple feature values possessed by each node in the map, the input layer of the neural network structure is set to multiple neurons; the number of hidden layers and the number of neurons in each layer of the neural network structure are adjusted.
[0075] Specifically, such as Figure 6 As shown, based on the conditions that need to be considered when a robot navigates in a human-computer interaction scenario, this invention designs a fully connected neural network. Since each node can be represented by a feature vector consisting of five feature values, the input layer is set to have 5 neurons. Adding 10 neurons to the hidden layer not only allows for the comprehensive consideration of the five features when calculating the cost value of each node, but also takes into account the mutual influence between each feature during backpropagation updates. The final output is the cost value of the node, so the output layer is set to have one neuron.
[0076] The neural network is used to calculate the cost of the NN-RRT* planner in growing new path nodes. Each node can be represented by a set of feature vectors F = [f1, f2, f3, f4, f5]. T Let f1 represent the Euclidean distance to the target endpoint, f2 represent the distance to the nearest obstacle, and f3-f5 represent the costs associated with the point with respect to the pedestrian. The cost function is defined by a Gaussian function and is divided into three directions: in front, behind, and to the right of the pedestrian.
[0077] With point x k For example, its five corresponding feature values are:
[0078] f1(x k )=||x k x goal ||
[0079]
[0080]
[0081]
[0082]
[0083] Where γ represents the regularization parameter, a1 and a2 represent the adjustment parameters of the function, and d jk α represents the distance from the node to the j-th pedestrian. jk Let ||.|| represent the angle between the node and the j-th pedestrian, and ||.|| represent the Euclidean distance between the two points.
[0084] Considering the complexity of the five features and their mutual influence, a simple linear model may not be able to accurately represent the relationship between them, while a neural network can approximate any function. Therefore, a fully connected neural network is used to replace the linear model.
[0085] The neural network design of this invention includes the following steps: Based on the problem to be solved, the five input feature values are replaced by a neural network to output their value instead of the original linear summation. Therefore, a simple fully connected network is chosen to facilitate rapid parameter updates. The five feature values of each node in the map determine that the input layer of the neural network structure has five neurons. The number of hidden layers and the number of neurons in each layer of the neural network structure can be flexibly adjusted; for now, we set the number of hidden layers to one and the number of neurons to 10. Since the final output is the value corresponding to each node, the number of neurons in the output layer is 1.
[0086] The method for initializing the neural network weights includes: first, determining the network structure; then, after the network structure is determined, initializing the weights by randomly generating values between 0 and 1; and finally, performing pre-training of the network after initialization, including randomly generating feature vectors F = [f1, f2, f3, f4, f5]. T This is used as input, and the feature vector is passed through the linear model w = [w1, w2, w3, w4, w5] in the original planner. T The calculated value c is used as the output of the neural network. The formula for calculating c is:
[0087]
[0088] After pre-training, the network weight parameters converge, and the neural network at this point approximately represents the linear model. By combining the pre-trained neural network with the original path planner, the path planner can be obtained by calculating the cost value of each node through the neural network.
[0089] The network structure is determined, including the number of neurons in the input layer, the number of hidden layers and the number of neurons in each layer, and the number of neurons in the output layer. Furthermore, the pre-trained neural network is combined with an RRT* path planner. By calculating the cost value of each node through the neural network, the NN-RRT* path planner can be obtained.
[0090] Specifically, the weights are initialized and pre-trained according to the designed neural network to generate an NN-RRT* path planner. The process of initializing the weights involves randomly assigning values of 0 to 1 to each weight w and bias b. After initialization, pre-training is performed. Since the neural network can approximately represent any function, the linear model in the original RRT* planner can be replaced by the neural network through pre-training, thereby obtaining a new path planner NN-RRT*.
[0091] In step S2, when calculating the cost map of the current scene, data information from the bag file is read, including obstacle information, pedestrian information, target point coordinates, obstacle inflation layer, Gaussian models in three directions around the pedestrian, and distances from points to targets. These are then merged to obtain the cost map. Figures 7a-7b As shown; when generating the planned paths, based on the calculated cost map, the NN-RRT* planner is used to repeatedly generate r planned paths. The four planned paths generated in the current scene are as follows. Figures 8a-8d As shown, the white lines represent the planned paths, and the black lines represent the demonstration paths.
[0092] The computational cost map described above is the process of calculating the cost value of each point on the map. This involves iterating through all points on the map, starting with point x... k For example, similarly, designing a neural network structure can yield its feature vector. Inputting this vector into a pre-trained neural network allows us to derive its cost value. Once all points on the map have been traversed, the cost map for that scene can be obtained.
[0093] The method of repeatedly generating planned paths using the path planner is as follows:
[0094] Step S21: Select growth points through random sampling;
[0095] Step S22: Perform collision detection. If the collision detection passes, proceed to step S23; otherwise, return to step S21.
[0096] Step S23: Calculate the eigenvector F = [f1, f2, f3, f4, f5] of the growth point. T The cost of the current growth point is then derived from the neural network.
[0097]
[0098] Where n represents the number of neurons, w 1-5 The value corresponds to f 1-5 The value;
[0099] Step S24: Calculate the cumulative generation value from the growth point to neighboring nodes, and take the neighboring node with the smallest cumulative generation value as the parent node of the growth point to complete the reconnection process;
[0100] Step S25: Calculate the distance between the growth point and the target point. If the distance is greater than the set distance, return to step S21; otherwise, consider that the endpoint has been reached and the planning is complete.
[0101] The method for calculating the feature vectors of the demonstration path and the planned path is as follows:
[0102] First, the planned path is discretized into a series of points, that is, the line is transformed into points;
[0103] Then calculate the feature vector corresponding to each point;
[0104] Calculate the path's feature vector from the feature vectors of each point;
[0105]
[0106]
[0107]
[0108]
[0109]
[0110] f plan =[f plan_1 f plan_2 f plan_3 f plan_4 f plan_5 ] T
[0111] Where N represents the number of nodes on the path, dist represents the distance between the Nth point and the (N+1)th point, [f 1_1 f 1_2 f 1_3 f 1_4 f 1_5 ] T This represents the feature vector of the first node on the path.
[0112] Similarly, the feature vector of the demonstration path can be calculated:
[0113] f demo =[f demo_1 fdemo_2 f demo_3 f demo_4 f demo_5 ] T .
[0114] Specifically, when calculating the feature vectors of the demonstration path and the planned path, in one training cycle, the average feature vectors and f of the S demonstration paths are calculated respectively. demo_1 , ..., f demo_S For each scenario, r planned paths are generated, and the average feature and f of the S planned paths are calculated respectively. plan_1 , ..., f plan_S .
[0115]
[0116] The method for determining whether the demonstration path and the planned path are homotopic is as follows: if the planned path can be smoothly transformed into the demonstration path without colliding with obstacles and pedestrians, then the two paths are homotopic; otherwise, the two paths are not homotopic, and the length of the demonstration path is greater than the length of the planned path, and the planned path is penalized for homotopicity.
[0117] When determining whether the demonstration path and the planned path are homotopic, such as Figure 9 As shown, the black line represents the example path, and the white line represents the planned path. It can be seen that pedestrians exist within the closed area formed by the two paths. Therefore, the two paths are determined to be non-homotopic, and a penalty function is introduced into the feature vector of the planned path.
[0118] The method for applying homotopy penalty to the planned path is to increase the feature vector value of the planned path and increase the penalty intensity accordingly.
[0119] f plan_i =f plan_i +c
[0120] c = (c1, c2, c3, c4, c5) T
[0121] Where f plan_i The feature vectors c1, c2, c3, c4, and c5 of the path generated by the path planner in the i-th iteration represent the penalty values for the five feature values of the planned path, respectively.
[0122] Calculate the average feature vector of the planned path in the current scene:
[0123]
[0124] In step S4, when determining whether the feature difference is less than the allowable error, the feature error E of the demonstration path and the planned path for all scenarios in one loop is calculated. If it is less than the allowable error E...allowance Then the neural network in the planner is updated until the feature error E is less than the allowable error E. allowance Or it may reach the maximum number of updates.
[0125] In step S5, the training terminates and outputs the neural network parameter weights to obtain a socially adaptive path planner NN-RRT*. The output neural network weights are used by the NN-RRT* planner to generate human-like paths in human-computer interaction scenarios.
[0126] Example 2
[0127] Based on the same inventive concept, this embodiment provides a robot social adaptive path planning system based on neural networks. The principle of solving the problem is similar to that of the robot social adaptive path planning method based on neural networks, and the repeated parts will not be described again.
[0128] This embodiment provides a robot social adaptive path planning system based on neural networks, including:
[0129] The data acquisition and generation module is used to generate demonstration paths based on the designed map scene, collect demonstration paths, design neural network structure, initialize neural network weights, and generate a path planner.
[0130] The first calculation module is used to calculate the cost map of the current scene. Based on the cost map, the path planner repeatedly generates the planned path, calculates the feature vectors of the demonstration path and the planned path, and determines whether the demonstration path and the planned path are homotopic. If yes, it enters the judgment module; if no, it applies a homotopic penalty to the feature vector of the planned path before entering the judgment module.
[0131] The judgment module is used to update the feature vector of the planned path, determine whether a loop has ended, if not, select the next map scene and return to the first calculation module; if yes, proceed to the second calculation module.
[0132] The second calculation module is used to calculate the feature difference between the demonstration path and the planned path for all scenarios, and determine whether the feature difference is less than the allowable error. If yes, training terminates and the final neural network weights are output; if no, the neural network in the path planner is updated, and it is determined whether convergence has occurred. If yes, training terminates and the final neural network weights are output; if no, the next map scenario is selected, and the process returns to the first calculation module. When determining whether the feature difference is less than the allowable error:
[0133] After each training cycle, we obtain the demonstration path feature vectors corresponding to S training scenarios. and planned path feature vector
[0134] Calculate the feature difference E:
[0135]
[0136] Where Ω(f) represents the value obtained by inputting the feature vector into the neural network; it determines whether the feature difference E is less than the allowable error E. allowance If yes, training terminates and the final neural network weights are output; otherwise, the neural network in the path planner is updated; training terminates and the final neural network weights are output.
[0137] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0139] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A robot social adaptive path planning method based on neural networks, characterized in that, Includes the following steps: Step S1: Generate a demonstration path based on the designed map scene and collect the demonstration path; design the neural network structure, initialize the neural network weights, and generate a path planner; Step S2: Calculate the cost map of the current scene. Based on the cost map, use the path planner to repeatedly generate the planned path. Calculate the feature vectors of the demonstration path and the planned path. Determine whether the demonstration path and the planned path are homotopic. If yes, proceed to step S3. If no, apply homotopic penalty to the feature vector of the planned path before proceeding to step S3. Step S3: Update the feature vector of the planned path, determine whether a loop has ended, if not, select the next map scene and return to step S2; if yes, proceed to step S4. Step S4: Calculate the feature difference between the demonstration path and the planned path for all scenarios, and determine whether the feature difference is less than the allowable error. If yes, proceed to step S5; if no, update the neural network in the path planner, and determine whether it has converged. If yes, proceed to step S5; if no, select the next map scenario and return to step S2. The method for determining whether the feature difference is less than the allowable error is as follows: After each training cycle, we obtain the demonstration path feature vectors corresponding to S training scenarios. and planned path feature vector Calculate the feature difference E: Where Ω(f) represents the value obtained by inputting the feature vector into the neural network; Determine whether the characteristic difference E is less than the allowable error E allowance If yes, proceed to step S5; otherwise, update the neural network in the path planner. Step S5: Training terminates, output the final neural network weights; The method for determining whether the demonstration path and the planned path are homotopic is as follows: if the planned path can be smoothly transformed into the demonstration path without colliding with obstacles and pedestrians, then the two paths are homotopic; otherwise, the two paths are not homotopic, and the length of the demonstration path is greater than the length of the planned path, and the planned path is penalized for homotopicity. The method for applying homotopy penalty to the planned path is to increase the feature vector value of the planned path and increase the penalty intensity accordingly. f plan_i =f plan_i +c c=(c1,c2,c3,c4,c5) T Where f plan_i The feature vectors c1, c2, c3, c4, and c5 of the path generated by the path planner in the i-th iteration represent the penalty values for the five feature values of the planned path, respectively. Calculate the average feature vector of the planned path in the current scene:
2. The robot social adaptive path planning method based on neural networks according to claim 1, characterized in that: The method for collecting demonstration paths is as follows: in each scenario, a starting point and a target point are set; Using ROS's visualization tool RVIZ, the robot was remotely controlled with a handle to walk a smooth path from the starting point to the end point; a LiDAR was mounted on the robot, which collected information about the surrounding environment in real time while controlling the robot's movement.
3. The robot social adaptive path planning method based on neural networks according to claim 1, characterized in that: The method for designing the neural network structure is as follows: Based on the problem to be solved, multiple input feature values are replaced by a neural network to output their numerical value instead of the original linear summation; a fully connected network is selected; based on the multiple feature values possessed by each node in the map, the input layer of the neural network structure is set to multiple neurons; the number of hidden layers and the number of neurons in each layer of the neural network structure are adjusted.
4. The robot social adaptive path planning method based on neural networks according to claim 1, characterized in that: The method for initializing the neural network weights includes: first, determining the network structure; then, after the network structure is determined, initializing the weights by randomly generating values between 0 and 1; and finally, performing pre-training of the network after initialization, including randomly generating feature vectors F = [f1, f2, f3, f4, f5]. T This is used as input, and the feature vector is passed through the linear model w = [w1, w2, w3, w4, w5] in the original planner. T The calculated value c is used as the output of the neural network. The formula for calculating c is: After pre-training, the network weight parameters converge, and the neural network at this point approximately represents the linear model. By combining the pre-trained neural network with the original path planner, the path planner can be obtained by calculating the cost value of each node through the neural network.
5. The robot social adaptive path planning method based on neural networks according to claim 1, characterized in that: The method of repeatedly generating planned paths using the path planner is as follows: Step S21: Select growth points through random sampling; Step S22: Perform collision detection. If the collision detection passes, proceed to step S23; otherwise, return to step S21. Step S23: Calculate the eigenvector F = [f1, f2, f3, f4, f5] of the growth point. T The cost of the current growth point is then derived from the neural network. Where n represents the number of neurons, w 1-5 The value corresponds to f 1-5 The value; Step S24: Calculate the cumulative generation value from the growth point to neighboring nodes, and take the neighboring node with the smallest cumulative generation value as the parent node of the growth point to complete the reconnection process; Step S25: Calculate the distance between the growth point and the target point. If the distance is greater than the set distance, return to step S21; otherwise, consider that the endpoint has been reached and the planning is complete.
6. The robot social adaptive path planning method based on neural networks according to claim 1, characterized in that: The method for calculating the feature vectors of the demonstration path and the planned path is as follows: First, the planned path is discretized into a series of points, that is, the line is transformed into points; Then calculate the feature vector corresponding to each point; Calculate the path's feature vector from the feature vectors of each point; f plan =[f plan_1 ,f plan_2 ,f plan_3 ,f plan_4 f plan_5 ] T Where N represents the number of nodes on the path, dist represents the distance between the Nth point and the (N+1)th point, [f 1_1 f 1_2 f 1_3 f 1_4 f 1_5 , T This represents the feature vector of the first node on the path. Similarly, the feature vector of the demonstration path can be calculated: f demo =[f demo_1 ,f demo_2 ,f demo_3 ,f demo_4 ,f demo_5 ] T 。 7. The robot social adaptive path planning method based on neural networks according to claim 1, characterized in that: In step S4, the method for updating the neural network in the path planner and determining whether it has converged is as follows: Step S41: Set the backpropagation loss δ; in Step S42: Calculate the partial derivatives of each weight w and bias b. Update weights w and biases b: Where η represents the learning rate and δ represents the backpropagation error loss. Step S43: After updating the weights w and bias b in one round, perform an error check. If the error E is less than the allowable error E... allowance If the training terminates, proceed to step S5; otherwise, proceed to step S41.
8. A robot social adaptive path planning system based on neural networks, characterized in that, include: The data collection and generation module is used to generate demonstration paths based on the designed map scene and collect demonstration paths. Design the neural network structure, initialize the neural network weights, and generate the path planner; The first calculation module is used to calculate the cost map of the current scene. Based on the cost map, the path planner repeatedly generates the planned path, calculates the feature vectors of the demonstration path and the planned path, and determines whether the demonstration path and the planned path are homotopic. If yes, it enters the judgment module; if no, it applies a homotopic penalty to the feature vector of the planned path before entering the judgment module. The judgment module is used to update the feature vector of the planned path, determine whether a loop has ended, if not, select the next map scene and return to the first calculation module; if yes, proceed to the second calculation module. The second calculation module is used to calculate the feature difference between the demonstration path and the planned path for all scenarios, and determine whether the feature difference is less than the allowable error. If yes, training terminates and the final neural network weights are output; if no, the neural network in the path planner is updated, and it is determined whether convergence has occurred. If yes, training terminates and the final neural network weights are output; if no, the next map scenario is selected, and the process returns to the first calculation module. When determining whether the feature difference is less than the allowable error: After each training cycle, we obtain the demonstration path feature vectors corresponding to S training scenarios. and planned path feature vector Calculate the feature difference E: Where Ω(f) represents the value obtained by inputting the feature vector into the neural network; it determines whether the feature difference E is less than the allowable error E. allowance If yes, training terminates and the final neural network weights are output; otherwise, the neural network in the path planner is updated. Training terminates, and the final neural network weights are output. The method for determining whether the demonstration path and the planned path are homotopic is as follows: if the planned path can be smoothly transformed into the demonstration path without colliding with obstacles and pedestrians, then the two paths are homotopic; otherwise, the two paths are not homotopic, and the length of the demonstration path is greater than the length of the planned path, and the planned path is penalized for homotopicity. The method for applying homotopy penalty to the planned path is to increase the feature vector value of the planned path and increase the penalty intensity accordingly. f plan_i =f plan_i +c c=(c1,c2,c3,c4,c5) T Where f plan_i The feature vectors c1, c2, c3, c4, and c represent the penalty values for the five feature values of the planned path, respectively, corresponding to the feature vectors of the i-th path generated by the path planner. Calculate the average feature vector of the planned path in the current scene:
Citation Information
Patent Citations
Robot global path planning method based on deeply enhanced learning
CN107065881A
Mobile robot path planning method based on neural network optimization heuristic function
CN113821025A