An improved reinforcement learning AGV path planning method

By introducing the SR-PPO algorithm of sample regularization and adaptive learning rate into AGV path planning, combined with the KL divergence constraint term, the problems of local optimality and slow training speed of AGV in dynamic environments are solved, and an efficient path is achieved. Plan and learn faster.

CN117826713BActive Publication Date: 2024-09-10SHANDONG UNIV OF SCI & TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311561107.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-22
Publication Date
2024-09-10
Estimated Expiration
2043-11-22

AI Technical Summary

Technical Problem

Existing AGV path planning methods have the problems of local optimality, weak environmental adaptability and insufficient response in dynamic and complex environments. In particular, over-reliance on environmental feedback during the AGV training process leads to local optimality, and the PPO algorithm is incompatible with complex environments. Training speed is slow.

Method used

The reinforcement learning method based on sample regularization is adopted, and the sample regularization term and adaptive learning rate mechanism are added through the SR-PPO algorithm to improve the AGV's environment exploration capability and training speed. Combined with the Fisher information matrix and constraint terms of KL divergence approximation, Dynamically adjust the learning rate to optimize policy parameter updates.

Benefits of technology

It improves the AGV's autonomous planning capabilities, obtains the optimal collision-free path, reduces the AGV running time and energy consumption, solves the problems of local optimality and slow training speed, and achieves more efficient path planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117826713B
    Figure CN117826713B
Patent Text Reader

Abstract

The present invention discloses an improved reinforcement learning AGV path planning method, the steps of which are: building a three-dimensional AGV model and an obstacle model based on Gazebo and modeling a simulation environment; designing a state space and an action space based on AGV path planning in a three-dimensional simulation environment; designing a reward value function; designing an SR-PPO algorithm, adding a sample regularization term to the objective function of the PPO algorithm; designing an SR-ALR-PPO algorithm based on the SR-PPO algorithm, combining the Fisher information matrix of the KL divergence approximation and the KL divergence constraint term with the SR-PPO algorithm, and adaptively selecting the learning rate for updating the policy network parameters; establishing a path planning model based on the SR-ALR-PPO algorithm and training it to obtain a trained path planning model. The present invention proposes an improved reinforcement learning AGV path planning method, which improves the autonomous planning ability of the AGV based on sample regularization and adaptive learning rate, obtains the optimal collision-free path, and minimizes the running time and energy consumption of the AGV.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of modern logistics workshop construction and intelligent logistics system, and specifically relates to an improved reinforcement learning AGV path planning method. Background Art

[0002] The development of intelligent warehousing and logistics has reached a new height. As one of the basic equipment of intelligent warehousing and logistics, the highly intelligent Automated Guide Vehicle (AGV) reflects the development of contemporary science and technology. AGV is a wheeled mobile robot. The development of mobile robots in industries such as industry and service has provided a solid foundation for the research of AGV. Autonomous navigation is an indispensable function for mobile robots, and path planning is an important technology to realize autonomous navigation. The quality of path planning technology determines whether the robot can find a suitable driving path within a limited time. Obstacle avoidance in dynamic and complex environments also requires methods with higher real-time, robustness and stability. The current commonly used methods still have problems such as falling into local optimality, weak environmental adaptability and insufficient response in the process of mobile robot path planning. Therefore, designing an efficient and stable path planning method is of great significance to the development of mobile robots.

[0003] The decision-making ability of traditional methods is slightly insufficient in dynamic and complex scenarios. As one of the hot research directions in the field of artificial intelligence, reinforcement learning can learn experience through trial and error of intelligent agents in the environment, and then train the optimal control strategy, which has stronger environmental applicability and autonomous decision-making ability. The PPO algorithm uses importance sampling to update the strategy, but importance sampling may lead to selection bias of training samples, resulting in insufficient exploration ability in continuous space and slow convergence. In order to solve the above problems, a reinforcement learning method based on sample regularization is proposed. By reusing sample data in the training process, the problem of over-reliance on environmental feedback in the AGV path planning process leading to local optimality is solved, so that the AGV has a higher environmental exploration ability during the training process. Secondly, the mechanism of adaptive learning rate is introduced to solve the problem that the PPO algorithm consumes a lot of time in the training process in complex environments. By measuring the difference between the probability distributions of the new and old strategies, the size of the learning rate is dynamically adjusted, the update direction of the strategy parameters is accurately estimated, and the learning speed of the AGV in the path planning training stage is improved.

[0004] At present, there are no reports in domestic and foreign literature and patent documents on the application of the PPO algorithm based on sample regularization and adaptive learning rate to AGV path planning. Summary of the invention

[0005] In view of the above-mentioned technical problems existing in the prior art, the present invention proposes an improved reinforcement learning AGV path planning method, which has a reasonable design, solves the shortcomings of the prior art and has good effects.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] An improved reinforcement learning AGV path planning method includes the following steps:

[0008] Step 1: Build a 3D AGV model and obstacle model based on Gazebo and perform simulation environment modeling;

[0009] Step 2: Design the state space and action space of AGV path planning based on 3D simulation environment;

[0010] Step 3: Design a reward value function based on steps 1 and 2;

[0011] Step 4: Design the SR-PPO algorithm, add the sample regularization term to the objective function of the PPO algorithm, improve the strategy selectivity of the PPO algorithm, and thus increase the AGV training process's ability to explore the working environment;

[0012] Step 5: Design the SR-ALR-PPO algorithm based on the SR-PPO algorithm, combine the Fisher information matrix of the KL divergence approximation and the KL divergence constraint term with the SR-PPO algorithm, adaptively select the learning rate for updating the policy network parameters, improve the performance and convergence speed of the policy, and thus improve the learning speed of the AGV path planning model in the training phase;

[0013] Step 6: Establish a path planning model based on the SR-ALR-PPO algorithm and perform training to obtain a trained path planning model.

[0014] Furthermore, in step 1, a three-dimensional simulation environment of the AGV model is constructed, including an AGV body, obstacles and targets. The obstacles are used to simulate various actual objects in the AGV operating environment, and the targets are used to mark the AGV target points.

[0015] Furthermore, step 2 includes the following sub-steps:

[0016] Step 2.1, the state space design includes obstacle information, AGV posture information and target point posture information; obstacle information includes laser radar point cloud information and visual image information; AGV posture information and target point posture information are represented by arrays:

[0017] [v t ,ω t ,d t ,θ t ];

[0018] Among them, v t represents the linear velocity of the AGV at time t, ω t represents the angular velocity of the AGV at time t, d t Represents the distance of AGV relative to the target position at time t, θ t Indicates the angle difference between the AGV and the target position at time t;

[0019] Step 2.2, Dynamic Space Design According to the kinematic model of AGV, the action of AGV is discretized, and the AGV action output a is set as the continuous space of linear velocity v and angular velocity ω:

[0020] a=[v,ω];

[0021] The value range of linear velocity v is [-v max ,+v max ](m / s), the range of angular velocity ω is [-ω max ,+ω max ](rad / s).

[0022] Furthermore, in step 3, in the initial state, an initial reward value R is set i :

[0023] R i =η 0 ;

[0024] Among them, η 0 is a constant coefficient;

[0025] Set the distance difference between the AGV and the target position at two consecutive moments as the dense reward value R d1 :

[0026] R d1 =η 1 ×(d t-1 -d t );

[0027] Among them, d t and d t-1 Respectively represent the distance of AGV relative to the target position at the current time t and time t-1, η 1 is a constant coefficient greater than 0;

[0028] Set the distance difference between the AGV and the nearest obstacle at two consecutive moments as the dense reward value R d2 :

[0029]

[0030] in, and Respectively represent the distances of the obstacles closest to the AGV at the current time t and time t-1, d * is the threshold distance between AGV and obstacles, η 2 and η 3 is a constant coefficient greater than 0;

[0031] The design reward value is negative, and the intensive reward value R is set according to the change range of angular velocity and linear velocity. a :

[0032] R a =-η 4 ×(|ω t -ω t-1 |+|v t -v t-1 |):

[0033] Among them, η 4 is a constant coefficient greater than 0, ω t and ω t-1 They represent the angular velocity of the AGV at the current time t and the time t-1, respectively, t and v t-1 Represent the linear speed of AGV at the current time t and time t-1 respectively, |ω t -ω t-1 | and |v t -v t-1 | respectively represent the rate of change of angular velocity and linear velocity at the previous and next moments;

[0034] The penalty when the AGV collides with an obstacle and the reward when it reaches the target position are set as sparse reward values. The sparse reward value R e The expression is:

[0035]

[0036] Among them, η 5 and η 6 is a constant coefficient greater than 0, It represents the shortest distance between the AGV and the obstacle or target position at the current time t, d min Indicates the distance threshold for AGV to collide with obstacles, d g Indicates the distance threshold for the AGV to reach the target position;

[0037] The final reward value function R is expressed as:

[0038] R=R d1 +R d2 +R a +R e +R i .

[0039] Furthermore, step 4 includes the following sub-steps:

[0040] Step 4.1. Design a regularization term based on AGV action sample data and define the sample regularization term T(π(a|s)) as follows:

[0041] T(π(a|s))=E a~π(a|s) [f(a)]+E a,a'~π(a|s) [g(a,a')];

[0042] Where s represents the current state, a and a' represent action samples at two adjacent moments, and π(a|s) represents the probability density of action a under state s. Function f(a) defines an additional reward that is independent of the state. It is explored based on prior knowledge and is used to guide actions to aggregate toward the optimal action sequence. Function g(a,a') simulates an intrinsic relationship between actions, measures the generalized relative distance between two adjacent actions, and is used to balance the probability distribution between actions.

[0043] Step 4.2: Because sample regularization still faces the problem of high computational complexity when processing large-scale data, in order to avoid the above problem, an unbiased estimate is used, that is, in the case of repeated sampling, the average value of the estimated value is equal to the true value of the population parameter, thereby approximating the sample regularization term As shown below:

[0044]

[0045] Among them, N is the number of sampled action samples, a i ,a j is an action sample from the action probability density π(a|s);

[0046] Step 4.3: Based on the sample regularization term obtained in step 4.2, define f(a i ) and g(a i ,a j ) is as follows:

[0047]

[0048]

[0049] Among them, u is a uniform distribution, φ(z) is a non-negative function, and its expression is as follows:

[0050] φ(z)=z σ 0<σ<1;

[0051] Among them, σ is a constant coefficient;

[0052] f(a i ) and g(ai ,a j ) is substituted into the sample regularization formula with step 4.2, and the sample regularization term of the unbiased estimate approximation is obtained as follows:

[0053]

[0054] Step 4.4: Add the sample regularization term to the objective function of the PPO algorithm and define the objective function J SR-PPO The action value function and state value function under (κ) are as follows:

[0055]

[0056]

[0057] Among them, s t and a t represents the state and action at time t, the discount factor γ∈(0,1], ξ represents the weight hyperparameter of the regularization term, R(s t ,a t ) represents the reward function at time t, Q π (s t ,a t ) represents the action value function based on cumulative rewards;

[0058] Therefore, the objective function J of the sample regularized PPO algorithm SR-PPO is SR-PPO (κ) is as follows:

[0059]

[0060] Among them, κ represents the current policy network parameters, κ old represents the old strategy network parameters, A π It is expressed as the advantage function, which is the difference between the action value function and the state value function, ρ π (κ) is expressed as the ratio of the new and old strategies, and its expression is:

[0061]

[0062] clip(ρ π (κ),1-ε,1+ε) is expressed as the truncation function, and ρ π (κ) is truncated in (1-ε,1+ε), where ε is a hyperparameter;

[0063] Step 4.5: For the update of the SR-PPO algorithm strategy, its strategy network parameter κ follows the gradient ascent to update, as shown below:

[0064]

[0065] Among them, κ' represents the updated policy network parameters, α is the policy network learning rate, Represents the gradient.

[0066] Furthermore, step 5 includes the following sub-steps:

[0067] Step 5.1: Calculate the Fisher information matrix based on the KL divergence approximation. First, according to the SR-PPO algorithm, use the scoring function s π (κ) Evaluate the quality of κ, s π The expression of (κ) is as follows:

[0068]

[0069] Among them, x represents the set of actions and states, that is, sample data.

[0070] The covariance of the scoring function is given by:

[0071] cov(s π ,s π )=E[(s π -E[s π (κ)])·(s π -E[s π (κ)]) T ];

[0072] Find the expectation of the scoring function:

[0073]

[0074] From the above formula, we can know that the expected value of the scoring function E π [s π (κ)] is 0, and the score function expectation is brought into the covariance formula to obtain the following formula:

[0075] cov(s π ,s π )=E[(s π -0)·(s π -0) T ];

[0076] Representing it in matrix form gives us the Fisher information matrix:

[0077]

[0078] in, is the transpose of the gradient;

[0079] Use the empirical sample distribution given by the training data to approximate the expected value in the Fisher information matrix. The empirical Fisher information matrix is ​​as follows:

[0080]

[0081] Step 5.2: Regarding the relationship between the Fisher information matrix and the Hessian matrix of the scoring function, the Hessian matrix H of the scoring function logπ(x|κ) The Jacobian matrix of the scoring function Expanded, the Hessian matrix of the scoring function is as follows:

[0082]

[0083] The expectation of the Hessian matrix of the scoring function is as follows:

[0084]

[0085] Based on step 5.1, we get the relationship between the Fisher information matrix and the Hessian matrix of the scoring function:

[0086] F=-E x~π [H logπ(x|κ) ];

[0087] Step 5.3: If there are two random probability distributions π(x|κ′) and π(x|k), then the KL divergence is expressed as:

[0088]

[0089] The first-order gradient of KL divergence with respect to κ is as follows:

[0090]

[0091] The second-order gradient of KL divergence with respect to κ is as follows:

[0092]

[0093] Based on steps 5.1 and 5.2, the Fisher information matrix is ​​equal to the second-order gradient of the KL divergence of the SR-PPO algorithm, as shown below:

[0094]

[0095] Step 5.4: Update the strategy for the SR-ALR-PPO algorithm and adaptively select the learning rate for updating the strategy network parameters. First, consider the strategy network parameter update direction as k, then:

[0096]

[0097] definition

[0098]

[0099] The Taylor second-order expansion of the KL divergence of the target parameter at κ is as follows:

[0100]

[0101] According to step 4, KL(κ||κ)=0, at which point the KL divergence reaches its minimum value. Therefore, the first-order gradient of the KL divergence is 0 when κ′=κ, that is, Therefore, the approximate expression of the KL divergence Taylor second-order expansion formula is obtained:

[0102]

[0103] The KL divergence constraint is used for policy optimization. In order to accurately find the parameter update direction, it is expected to obtain an optimal policy network parameter update direction k * , the definition formula is as follows:

[0104]

[0105] Among them, the KL divergence constraint parameter μ is a constant, 0<μ<1; KL[κ||κ']≤μ is the constraint term for solving the optimal update direction. After the policy network learning rate α based on the SR-ALR-PPO algorithm is updated, the expression of the adaptive learning rate α' is obtained as follows:

[0106]

[0107] Among them, the KL divergence constraint parameter μ can be set manually according to the system performance, and finally the update method of the algorithm is obtained as follows:

[0108]

[0109] Furthermore, step 6 includes the following sub-steps:

[0110] Step 6.1, initialize the network parameters of the reinforcement learning algorithm, including the initialization of the policy network parameter κ and the value network parameter δ; the policy network includes the Actor_new network and the Actor_old network, and their policy functions are π(a t |s t ;κ) andπ(a t |s t κ old );

[0111] Step 6.2: Initialize the environment information, including the initial position of the AGV, the position of static obstacles, the position of dynamic obstacles, and the position of the target;

[0112] Step 6.3: AGV obtains current status information s through sensors t , according to the strategy function π(a t |s t ; κ), select the executable action a of AGV t , that is, choose a suitable linear velocity v t and angular velocity ω t ;

[0113] Step 6.4: AGV performs action a t Then enter the new state s t+1 , and according to the designed reward value function R, the current action a t Perform value assessment and obtain reward value r t ;

[0114] Step 6.5: Sample data (s t ,a t ,r t ,s t+1 ) is stored in the experience pool, and the sample data in the experience pool is used to calculate the sample regularization term, which acts as an additional term on the action value function and state value function of the value network, and is also a part of the objective function; then, the action value function Q(s) at time t is calculated based on the sample data t ,a t ;δ) and objective function J(κ), and then calculate the time difference error Loss(δ) and the objective function gradient

[0115] Step 6.6: Update the value network parameter δ according to the temporal difference error Loss(δ), and in the objective function gradient When updating the policy network parameter κ, an adaptive learning rate α' is introduced, which can adaptively select the direction of parameter update;

[0116] Step 6.7: Determine whether the round end conditions are met, including the AGV colliding with an obstacle and reaching the target point; if the end conditions are met, end the round and jump to step 6.2; otherwise, return to step 6.3 and continue training.

[0117] Step 6.8: Set a reasonable number of training rounds to determine whether the strategy function converges to the optimal strategy π * If yes, save the trained path planning model, otherwise jump to step 6.2 and continue training.

[0118] The beneficial technical effects brought by the present invention are:

[0119] The present invention proposes an improved reinforcement learning AGV path planning method, which improves the autonomous planning ability of AGV based on sample regularization and adaptive learning rate, obtains the optimal collision-free path, and minimizes the AGV running time and energy consumption.

[0120] The present invention proposes an improved reinforcement learning AGV path planning method based on the PPO algorithm. Adding a sample regularization term in the objective function can solve the problem of falling into local optimality due to excessive reliance on environmental feedback during AGV path planning, so that AGV has a higher environmental exploration ability during training. The introduction of an adaptive learning rate mechanism can solve the problem that the PPO algorithm consumes a lot of time in the training process in a complex environment, and improve the learning speed of AGV during the path planning training stage. BRIEF DESCRIPTION OF THE DRAWINGS

[0121] Figure 1 A training diagram of the path planning model in the present invention;

[0122] Figure 2 It is a reward value convergence curve diagram of the training path planning model in the present invention; DETAILED DESCRIPTION

[0123] The present invention proposes an improved reinforcement learning AGV path planning method. In order to make the advantages and technical solutions of the present invention clearer and more specific, the present invention is described in detail below in conjunction with specific embodiments.

[0124] An improved reinforcement learning AGV path planning method includes the following steps:

[0125] Step 1: Build a 3D AGV model and obstacle model based on Gazebo and perform simulation environment modeling;

[0126] Construct a three-dimensional simulation environment for the AGV model, including the AGV body, obstacles and targets. Obstacles are used to simulate various real objects in the AGV operating environment, and targets are used to mark the AGV target points.

[0127] Step 2: Design the state space and action space of AGV path planning based on 3D simulation environment;

[0128] Step 2 includes the following sub-steps:

[0129] Step 2.1, the state space design includes obstacle information, AGV posture information and target point posture information; obstacle information includes laser radar point cloud information and visual image information; AGV posture information and target point posture information are represented by arrays:

[0130] [v t ,ω t ,dt ,θ t ];

[0131] Among them, v t represents the linear velocity of the AGV at time t, ω t represents the angular velocity of the AGV at time t, d t Represents the distance of AGV relative to the target position at time t, θ t Indicates the angle difference between the AGV and the target position at time t;

[0132] Step 2.2, Dynamic Space Design According to the kinematic model of AGV, the action of AGV is discretized, and the AGV action output a is set as the continuous space of linear velocity v and angular velocity ω:

[0133] a=[v,ω];

[0134] The value range of linear velocity v is [-v max ,+v max ](m / s), the range of angular velocity ω is [-ω max ,+ω max ](rad / s).

[0135] Step 3: Design a reward value function based on steps 1 and 2;

[0136] In step 3, a suitable reward function is designed to balance the sparse reward value and the dense reward value to guide the AGV to better learn the correct behavior. In the initial state, in order to promote the AGV's learning and exploration ability of the environment, an initial reward value R is set. i :

[0137] R i =η 0 ;

[0138] Among them, η 0 is a constant coefficient;

[0139] In order to promote the AGV to move to the target point, the distance difference between the AGV and the target position at two adjacent moments is set as the dense reward value R d1 :

[0140] R d1 =η 1 ×(d t-1 -d t );

[0141] Among them, d t and d t-1 Respectively represent the distance of AGV relative to the target position at the current time t and time t-1, η 1 is a constant coefficient greater than 0;

[0142] In order to enable the AGV to avoid obstacles as much as possible and reach the target point with the optimal path, the distance difference between the AGV and the nearest obstacle at two consecutive moments is set as the dense reward value R d2 :

[0143]

[0144] in, and Respectively represent the distances of the obstacles closest to the AGV at the current time t and time t-1, d * is the threshold distance between AGV and obstacles, η 2 and η 3 is a constant coefficient greater than 0;

[0145] In order to ensure the smoothness of the path planned by the AGV, the expected rate of change of the angular velocity and linear velocity is small, so the reward value is designed to be negative, which ensures the comfort of the AGV operation to a certain extent. The intensive reward value R is set according to the change range of the angular velocity and linear velocity. a :

[0146] R a =-η 4 ×(|ω t -ω t-1 |+|v t -v t-1 |):

[0147] Among them, η 4 is a constant coefficient greater than 0, ω t and ω t-1 They represent the angular velocity of the AGV at the current time t and the time t-1, respectively, t and v t-1 Represent the linear speed of AGV at the current time t and time t-1 respectively, |ω t -ω t-1 | and |v t -v t-1 | respectively represent the rate of change of angular velocity and linear velocity at the previous and next moments;

[0148] In order to encourage AGV to avoid obstacles and move to the target point, the penalty when AGV collides with obstacles and the reward when it reaches the target position are set as sparse reward values. The sparse reward value R e The expression is:

[0149]

[0150] Among them, η 5 and η 6 is a constant coefficient greater than 0, It represents the shortest distance between the AGV and the obstacle or target position at the current time t, d min Indicates the distance threshold for AGV to collide with obstacles, d g Indicates the distance threshold for the AGV to reach the target position;

[0151] The final reward value function R is expressed as:

[0152] R=R d1 +R d2 +R a +R e +R i .

[0153] Step 4: Design the SR-PPO algorithm, add the sample regularization term to the objective function of the PPO algorithm, improve the strategy selectivity of the PPO algorithm, and thus increase the AGV training process's ability to explore the working environment;

[0154] Step 4 includes the following sub-steps:

[0155] Step 4.1. Design a regularization term based on AGV action sample data and define the sample regularization term T(π(a|s)) as follows:

[0156] T(π(a|s))=E a~π(a|s) [f(a)]+E a,a'~π(a|s) [g(a,a')];

[0157] Where s represents the current state, a and a' represent action samples at two adjacent moments, and π(a|s) represents the probability density of action a under state s. Function f(a) defines an additional reward that is independent of the state. It is explored based on prior knowledge and is used to guide actions to aggregate toward the optimal action sequence. Function g(a,a') simulates an intrinsic relationship between actions, measures the generalized relative distance between two adjacent actions, and is used to balance the probability distribution between actions.

[0158] Step 4.2: Because sample regularization still faces the problem of high computational complexity when processing large-scale data, in order to avoid the above problem, an unbiased estimate is used, that is, in the case of repeated sampling, the average value of the estimated value is equal to the true value of the population parameter, thereby approximating the sample regularization term As shown below:

[0159]

[0160] Among them, N is the number of sampled action samples, a i ,a j is an action sample from the action probability density π(a|s);

[0161] Step 4.3: Based on the sample regularization term obtained in step 4.2, define f(a i ) and g(a i ,a j ) is as follows:

[0162]

[0163]

[0164] Among them, u is a uniform distribution, φ(z) is a non-negative function, and its expression is as follows:

[0165] φ(z)=z σ 0<σ<1;

[0166] Among them, σ is a constant coefficient;

[0167] f(a i ) and g(a i ,a j ) is substituted into the sample regularization formula with step 4.2, and the sample regularization term of the unbiased estimate approximation is obtained as follows:

[0168]

[0169] Step 4.4: Add the sample regularization term to the objective function of the PPO algorithm and define the objective function J SR-PPO The action value function and state value function under (κ) are as follows:

[0170]

[0171]

[0172] Among them, s t and a t represents the state and action at time t, the discount factor γ∈(0,1], ξ represents the weight hyperparameter of the regularization term, R(s t ,a t ) represents the reward function at time t, Q π (s t ,a t ) represents the action value function based on cumulative rewards;

[0173] Therefore, the objective function J of the sample regularized PPO algorithm SR-PPO is SR-PPO (κ) is as follows:

[0174]

[0175] Among them, κ represents the current policy network parameters, κ oldrepresents the old strategy network parameters, A π It is expressed as the advantage function, which is the difference between the action value function and the state value function, ρ π (κ) is expressed as the ratio of the new and old strategies, and its expression is:

[0176]

[0177] clip(ρ π (κ),1-ε,1+ε) is expressed as the truncation function, and ρ π (κ) is truncated in (1-ε,1+ε), where ε is a hyperparameter;

[0178] Step 4.5: For the update of the SR-PPO algorithm strategy, its strategy network parameter κ follows the gradient ascent to update, as shown below:

[0179]

[0180] Among them, κ' represents the updated policy network parameters, α is the policy network learning rate, Represents the gradient.

[0181] Step 5: Design the SR-ALR-PPO algorithm based on the SR-PPO algorithm, combine the Fisher information matrix of the KL divergence approximation and the KL divergence constraint term with the SR-PPO algorithm, adaptively select the learning rate for updating the policy network parameters, improve the performance and convergence speed of the policy, and thus improve the learning speed of the AGV path planning model in the training phase;

[0182] Step 5 includes the following sub-steps:

[0183] Step 5.1: Calculate the Fisher information matrix based on the KL divergence approximation. First, according to the SR-PPO algorithm, use the scoring function s π (κ) Evaluate the quality of κ, s π The expression of (κ) is as follows:

[0184]

[0185] Among them, x represents the set of actions and states, that is, sample data.

[0186] The covariance information of the scoring function is usually expressed as Fisher information. The covariance of the scoring function is as follows:

[0187] cov(s π ,s π )=E[(s π -E[s π (κ)])·(s π -E[s π(κ)]) T ];

[0188] Find the expectation of the scoring function:

[0189]

[0190] From the above formula, we can know that the expected value of the scoring function E π [s π (κ)] is 0, and the score function expectation is brought into the covariance formula to obtain the following formula:

[0191] cov(s π ,s π )=E[(s π -0)·(s π -0) T ];

[0192] Representing it in matrix form gives us the Fisher information matrix:

[0193]

[0194] in, is the transpose of the gradient;

[0195] Use the empirical sample distribution given by the training data to approximate the expected value in the Fisher information matrix. The empirical Fisher information matrix is ​​as follows:

[0196]

[0197] Step 5.2: Regarding the relationship between the Fisher information matrix and the Hessian matrix of the scoring function, the Hessian matrix H of the scoring function logπ(x|κ) The Jacobian matrix of the scoring function Expanded, the Hessian matrix of the scoring function is as follows:

[0198]

[0199] The expectation of the Hessian matrix of the scoring function is as follows:

[0200]

[0201] Based on step 5.1, we get the relationship between the Fisher information matrix and the Hessian matrix of the scoring function:

[0202] F=-E x~π [H logπ(x|κ) ];

[0203] Step 5.3, KL divergence can measure the change between the probability distributions of two strategies and capture the directional difference between the two distributions. If there are two random probability distributions π(x|κ′) and π(x|k), then KL divergence is expressed as:

[0204]

[0205] The first-order gradient of KL divergence with respect to κ is as follows:

[0206]

[0207] The second-order gradient of KL divergence with respect to κ is as follows:

[0208]

[0209] Based on steps 5.1 and 5.2, the Fisher information matrix is ​​equal to the second-order gradient of the KL divergence of the SR-PPO algorithm, as shown below:

[0210]

[0211] Using KL divergence for sample approximation can avoid calculating all samples, simplify the calculation process, and provide more accurate gradient information to better guide the parameter update and optimization process.

[0212] Step 5.4: Update the strategy for the SR-ALR-PPO algorithm and adaptively select the learning rate for updating the strategy network parameters. First, consider the strategy network parameter update direction as k, then:

[0213]

[0214] definition

[0215]

[0216] The Taylor second-order expansion of the KL divergence of the target parameter at κ is as follows:

[0217]

[0218] According to step 4, KL(κ||κ)=0, at which point the KL divergence reaches its minimum value. Therefore, the first-order gradient of the KL divergence is 0 when κ′=κ, that is, Therefore, the approximate expression of the KL divergence Taylor second-order expansion formula is obtained:

[0219]

[0220] The KL divergence constraint is used for policy optimization. In order to accurately find the parameter update direction, it is expected to obtain an optimal policy network parameter update direction k * , the definition formula is as follows:

[0221]

[0222] Among them, the KL divergence constraint parameter μ is a constant, 0<μ<1; KL[κ||κ']≤μ is the constraint item for solving the optimal update direction. After the policy network learning rate α based on the SR-ALR-PPO algorithm is updated, the expression of the adaptive learning rate α' is obtained as follows:

[0223]

[0224] Among them, the KL divergence constraint parameter μ can be set manually according to the system performance, and finally the update method of the algorithm is obtained as follows:

[0225]

[0226] Step 6: Establish a path planning model based on the SR-ALR-PPO algorithm and perform training to obtain a trained path planning model.

[0227] like Figure 1 As shown, step 6 includes the following sub-steps:

[0228] Step 6.1, initialize the network parameters of the reinforcement learning algorithm, including the initialization of the policy network parameter κ and the value network parameter δ; the policy network includes the Actor_new network and the Actor_old network, and their policy functions are π(a t |s t ;κ) andπ(a t |s t κ old );

[0229] Step 6.2: Initialize the environment information, including the initial position of the AGV, the position of static obstacles, the position of dynamic obstacles, and the position of the target;

[0230] Step 6.3: AGV obtains current status information s through sensors t , according to the strategy function π(a t |s t ; κ), select the executable action a of AGV t , that is, choose a suitable linear velocity v t and angular velocity ω t ;

[0231] Step 6.4: AGV performs action a t Then enter the new state st+1 , and according to the designed reward value function R, the current action a t Perform value assessment and obtain reward value r t ;

[0232] Step 6.5: Sample data (s t ,a t ,r t ,s t+1 ) is stored in the experience pool, and the sample data in the experience pool is used to calculate the sample regularization term, which acts as an additional term on the action value function and state value function of the value network, and is also a part of the objective function; then, the action value function Q(s) at time t is calculated based on the sample data t ,a t ;δ) and objective function J(κ), and then calculate the time difference error Loss(δ) and the objective function gradient

[0233] Step 6.6: Update the value network parameter δ according to the temporal difference error Loss(δ), and in the objective function gradient When updating the policy network parameter κ, an adaptive learning rate α' is introduced, which can adaptively select the direction of parameter update;

[0234] Step 6.7: Determine whether the round end conditions are met, including the AGV colliding with an obstacle and reaching the target point; if the end conditions are met, end the round and jump to step 6.2; otherwise, return to step 6.3 and continue training.

[0235] Step 6.8: Set a reasonable number of training rounds to determine whether the strategy function converges to the optimal strategy π * ,like Figure 2 If yes, save the trained path planning model; otherwise, jump to step 6.2 to continue training.

[0236] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. An improved reinforcement learning AGV path planning method, characterized in that: The following steps are involved: Step 1: Build a 3D AGV model and obstacle model based on Gazebo and perform simulation environment modeling; Step 2: Design the state space and action space of AGV path planning based on 3D simulation environment; Step 3: Design a reward value function based on steps 1 and 2; Step 4: Design the SR-PPO algorithm, add the sample regularization term to the objective function of the PPO algorithm, improve the strategy selectivity of the PPO algorithm, and thus increase the AGV training process's ability to explore the working environment; Step 5: Design the SR-ALR-PPO algorithm based on the SR-PPO algorithm, combine the Fisher information matrix of the KL divergence approximation and the KL divergence constraint term with the SR-PPO algorithm, adaptively select the learning rate for updating the policy network parameters, improve the performance and convergence speed of the policy, and thus improve the learning speed of the AGV path planning model in the training phase; Step 6: Establish a path planning model based on the SR-ALR-PPO algorithm and perform training to obtain a trained path planning model; Step 6 includes the following sub-steps: Step 6.1, initialize the network parameters of the reinforcement learning algorithm, including the initialization of the policy network parameter κ and the value network parameter δ; the policy network includes the Actor_new network and the Actor_old network, and their policy functions are π(a t |s t ;κ) andπ(a t |s t κ old ); Step 6.2: Initialize the environment information, including the initial position of the AGV, the position of static obstacles, the position of dynamic obstacles, and the position of the target; Step 6.3: AGV obtains current status information s through sensors t , according to the policy function π(a t |s t ; κ), select the executable action a of AGV t , that is, choose a suitable linear velocity v t and angular velocity ω t ; Step 6.4: AGV performs action a t Then enter the new state s t+1 , and according to the designed reward value function R, the current action a t Perform value assessment and obtain reward value r t ; Step 6.5: Sample data (s t ,a t ,r t ,s t+1 ) is stored in the experience pool, and the sample data in the experience pool is used to calculate the sample regularization term, which acts as an additional term on the action value function and state value function of the value network, and also serves as part of the objective function; Then, the action value function Q(s) at time t is calculated based on the sample data. t ,a t ;δ) and objective function J(κ), and then calculate the time difference error Loss(δ) and the objective function gradient Step 6.6: Update the value network parameter δ according to the temporal difference error Loss(δ), and in the objective function gradient When updating the policy network parameter κ, an adaptive learning rate α' is introduced, which can adaptively select the direction of parameter update; Step 6.7: Determine whether the round end conditions are met, including the AGV colliding with an obstacle and reaching the target point; if the end conditions are met, then end the round and jump to step 6.2; otherwise, return to step 6.3 and continue training; Step 6.8: Set a reasonable number of training rounds to determine whether the strategy function converges to the optimal strategy π * If yes, save the trained path planning model, otherwise jump to step 6.2 and continue training.

2. The improved reinforcement learning AGV path planning method according to claim 1, characterized in that: In step 1, a three-dimensional simulation environment of the AGV model is constructed, including the AGV body, obstacles and targets. The obstacles are used to simulate various actual objects in the AGV operating environment, and the targets are used to mark the AGV target points.

3. The improved reinforcement learning AGV path planning method according to claim 2, characterized in that: Step 2 includes the following sub-steps: Step 2.1, the state space design includes obstacle information, AGV posture information and target point posture information; obstacle information includes laser radar point cloud information and visual image information; AGV posture information and target point posture information are represented by arrays: [v] t ,oh t ,d t ,i t ]; Among them, v t represents the linear velocity of the AGV at time t, ω t represents the angular velocity of the AGV at time t, d t Represents the distance of AGV relative to the target position at time t, θ t Indicates the angle difference between the AGV and the target position at time t; Step 2.2, motion space design According to the kinematic model of AGV, the motion of AGV is discretized, and the AGV motion output a is set as the continuous space of linear velocity v and angular velocity ω: a=[v,ω]; The value range of linear velocity v is [-v max ,+v max ](m / s), the range of angular velocity ω is [-ω max ,+ω max ](rad / s).

4. The improved reinforcement learning AGV path planning method according to claim 3, characterized in that: In step 3, in the initial state, set an initial reward value R i : R i =η0; Among them, η0 is a constant coefficient; Set the distance difference between the AGV and the target position at two consecutive moments as the dense reward value R d1 : R d1 =η1×(d t-1 -d t ); Among them, d t and d t-1 They represent the distances of the AGV relative to the target position at the current time t and time t-1, respectively, and η1 is a constant coefficient greater than 0; Set the distance difference between the AGV and the nearest obstacle at two consecutive moments as the dense reward value R d2 : in, and Respectively represent the distances of the obstacles closest to the AGV at the current time t and time t-1, d * is the threshold distance between AGV and obstacle, η2 and η3 are constant coefficients greater than 0; The design reward value is negative, and the intensive reward value R is set according to the change range of angular velocity and linear velocity. a : R a =-η4×(|ω t -ω t-1 |+|v t -v t-1 |): Among them, η4 is a constant coefficient greater than 0, ω t and ω t-1 They represent the angular velocity of the AGV at the current time t and the time t-1, respectively, t and v t-1 Represent the linear speed of AGV at the current time t and time t-1 respectively, |ω t -ω t-1 | and |v t -v t-1 | respectively represent the rate of change of angular velocity and linear velocity at the previous and next moments; The penalty when the AGV collides with an obstacle and the reward when it reaches the target position are set as sparse reward values. The sparse reward value R e The expression is: Among them, η5 and η6 are constant coefficients greater than 0, d t 1 It represents the shortest distance between the AGV and the obstacle or target position at the current time t, d min Indicates the distance threshold for AGV to collide with obstacles, d g Indicates the distance threshold for the AGV to reach the target position; The final reward value function R is expressed as: R=R d1 +R d2 +R a +R e +R i 。 5. The improved reinforcement learning AGV path planning method according to claim 4, characterized in that: Step 4 includes the following sub-steps: Step 4.

1. Design a regularization term based on AGV action sample data and define the sample regularization term T(π(a|s)) as follows: T(π(a|s))=E a~π(a|s) [f(a)]+E a,a'~π(a|s) [g(a,a)]: Among them, s represents the state at the current moment, a and a' represent action samples at two adjacent moments, and π(a|s) represents the probability density of action a under state s; the function f(a) defines an additional reward that is independent of the state. It is explored based on prior knowledge and is used to guide actions to aggregate toward the optimal action sequence; the function g(a,a') simulates an intrinsic relationship between actions, measures the generalized relative distance between two adjacent actions, and is used to balance the probability distribution between actions; Step 4.2: Because sample regularization still faces the problem of high computational complexity when processing large-scale data, in order to avoid the above problem, an unbiased estimate is used, that is, in the case of repeated sampling, the average value of the estimated value is equal to the true value of the population parameter, thereby approximating the sample regularization term As shown below: Among them, N is the number of sampled action samples, a i ,a j is an action sample from the action probability density π(a|s); Step 4.3: Based on the sample regularization term obtained in step 4.2, define f(a i ) and g(a i ,a j ) is as follows: Among them, u is uniform distribution, is a non-negative function, and its expression is as follows: =from σ 0<σ<1; Among them, σ is a constant coefficient; f(a i ) and g(a i ,a j ) is substituted into the sample regularization formula with step 4.2, and the sample regularization term of the unbiased estimate approximation is obtained as follows: Step 4.4: Add the sample regularization term to the objective function of the PPO algorithm and define the objective function J SR-PPO The action value function and state value function under (κ) are as follows: Among them, s t and a t represents the state and action at time t, the discount factor γ∈(0,1], ξ represents the weight hyperparameter of the regularization term, R(s t ,a t ) represents the reward function at time t, Q π (s t ,a t ) represents the action value function based on cumulative rewards; Therefore, the objective function J of the sample regularized PPO algorithm SR-PPO is SR-PPO (κ) is as follows: Among them, κ represents the current policy network parameters, κ old represents the old strategy network parameters, A π It is expressed as the advantage function, which is the difference between the action value function and the state value function, ρ π (κ) is expressed as the ratio of the new and old strategies, and its expression is: clip(ρ π (κ),1-ε,1+ε) is expressed as the truncation function, and ρ π (κ) is truncated in (1-ε,1+ε), where ε is a hyperparameter; Step 4.5: For the update of the SR-PPO algorithm strategy, its strategy network parameter κ follows the gradient ascent to update, as shown below: Among them, κ' represents the updated policy network parameters, α is the policy network learning rate, Represents the gradient.

6. The improved reinforcement learning AGV path planning method according to claim 5, characterized in that: Step 5 includes the following sub-steps: Step 5.1: Calculate the Fisher information matrix based on the KL divergence approximation. First, according to the SR-PPO algorithm, use the scoring function s π (κ) Evaluate the quality of κ, s π The expression of (κ) is as follows: Among them, x represents the set of actions and states, that is, sample data; The covariance of the scoring function is given by: cov(s π ,s π )=E[(s π -E[s π (κ)])·(s π -E[s π (κ)]) T ]; Find the expectation of the scoring function: From the above formula, we can know that the expected value of the scoring function E π [s π (κ)] is 0, and the score function expectation is brought into the covariance formula to obtain the following formula: those π ,s π )=E[(s π -0)·(s π -0) T ]; Representing it in matrix form gives us the Fisher information matrix: in, is the transpose of the gradient; Use the empirical sample distribution given by the training data to approximate the expected value in the Fisher information matrix. The empirical Fisher information matrix is ​​as follows: Step 5.2: Regarding the relationship between the Fisher information matrix and the Hessian matrix of the scoring function, the Hessian matrix H of the scoring function logπ(x|κ) The Jacobian matrix of the scoring function Expanded, the Hessian matrix of the scoring function is as follows: The expectation of the Hessian matrix of the scoring function is as follows: Based on step 5.1, we get the relationship between the Fisher information matrix and the Hessian matrix of the scoring function: F=-E x~π [H logπ ( x|κ) ]; Step 5.3: If there are two random probability distributions π(x|κ′) and π(x|k), then the KL divergence is expressed as: The first-order gradient of KL divergence with respect to κ is as follows: The second-order gradient of KL divergence with respect to κ is as follows: Based on steps 5.1 and 5.2, the Fisher information matrix is ​​equal to the second-order gradient of the KL divergence of the SR-PPO algorithm, as shown below: Step 5.4: Update the strategy for the SR-ALR-PPO algorithm and adaptively select the learning rate for updating the strategy network parameters. First, consider the update direction of the strategy network parameters as k, then: definition The Taylor second-order expansion of the KL divergence of the target parameter at κ is as follows: According to step 4, KL(κ||κ)=0, at which point the KL divergence reaches its minimum value. Therefore, the first-order gradient of the KL divergence is 0 when κ′=κ, that is, Therefore, the approximate expression of the KL divergence Taylor second-order expansion formula is obtained: The KL divergence constraint is used for policy optimization. In order to accurately find the parameter update direction, it is expected to obtain an optimal policy network parameter update direction k * , the definition formula is as follows: Among them, the KL divergence constraint parameter μ is a constant, 0<μ<1; KL[κ||κ']≤μ is the constraint item for solving the optimal update direction. After the policy network learning rate α based on the SR-ALR-PPO algorithm is updated, the expression of the adaptive learning rate α' is obtained as follows: Among them, the KL divergence constraint parameter μ can be set manually according to the system performance, and finally the update method of the algorithm is obtained as follows:

Citation Information

Patent Citations

  • Systems and methods of adaptive path planning

    CN111566583A

  • Unmanned aerial vehicle obstacle avoidance and path planning method

    CN113110592A

  • Multi-agent collaborative navigation method based on deep reinforcement learning

    CN116579372A

  • Unmanned vehicle adaptive path planning method based on dynamic window method and near-end strategy

    CN116679719A

  • Multi-AGV path planning method based on deep reinforcement learning and recurrent neural network

    CN116859919A