A path planning method for quadruped robots based on DRL
Through the combination of deep reinforcement learning and artificial potential field algorithms, quadruped robots can achieve effective path planning and real-time obstacle avoidance in complex obstacle environments, solving the problem of insufficient path planning capabilities of quadruped robots in complex environments and improving autonomy. Learning rate and motion safety.
Patent Information
- Application Number
- CN202210477781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-04-28
AI Technical Summary
It is difficult for quadruped robots to achieve effective path planning in complex obstacle environments, especially when unknown dynamic obstacles exist, resulting in insufficient path planning capabilities and low movement safety.
The path planning method based on deep reinforcement learning (DRL) is adopted, the DQN algorithm is used for global information planning, and the artificial potential field algorithm is combined with the artificial potential field algorithm for real-time obstacle avoidance to improve the independent learning rate and movement safety. Specific steps include: environment pre-scanning, raster modeling, Markov decision process modeling, DQN network introducing attention mechanism, confidence interval strategy selection action, artificial potential field algorithm real-time obstacle avoidance and reward value update.
It improves the autonomous learning rate and movement safety of the quadruped robot, enhances its adaptability and robustness to complex environments, and ensures that it can effectively plan the optimal path and avoid local traps in complex obstacle environments.
Smart Images

Figure CN114859911B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robot path planning, and relates to a path planning algorithm based on deep reinforcement learning. DQN is used to plan global information, and after an optimal path is determined, the dynamic obstacle information in the environment is predicted based on an artificial potential field algorithm to avoid obstacles in real time. Background Art
[0002] With the development of robot technology, legged robots are widely used in practical applications, such as post-disaster search and rescue, military reconnaissance, etc. Compared with wheeled and tracked robots, legged robots only need to find a series of discrete foot points to contact the ground, and have better adaptability to some rugged terrains; and because the legs of legged robots have multiple degrees of freedom, they have good flexibility in adjusting the center of gravity during movement.
[0003] Among legged robots, quadruped robots are widely used in practice due to their good load capacity and walking stability. With the rise of artificial intelligence, quadruped robots are developing in the direction of self-exploration, self-learning, and self-adaptation. The autonomous navigation process of quadruped robots can be divided into three processes: environmental perception, path planning, and motion control. Path planning, as an intermediate link, is a key technology for mobile robots to achieve autonomous navigation. The quality of the path planning results of mobile robots will directly affect the quality of the robot's task completion.
[0004] In the field of mobile robots, path planning has always been a hot topic of research, and its purpose is to plan an optimal collision-free path from the starting point to the target point. The traditional path planning method is to build the robot's motion environment based on the physical model, and then combine it with traditional search algorithms such as particle swarm optimization to complete the path planning. However, these methods require the construction of environmental maps in advance, and have poor generalization ability for unfamiliar scenes. Quadruped robots are often trapped in local areas because they cannot bypass obstacles. In many application environments of robots, the working environment of robots is complex, diverse and unpredictable, which requires robots to have a certain degree of intelligence, that is, autonomous learning ability and the ability to explore the environment. On the other hand, since the robot is in an unknown environment and the robot's grasp of environmental information is not sufficient, in order for the robot to successfully and efficiently implement path planning in an unknown environment, the robot system needs to have a certain degree of adaptability and the ability to handle emergencies. Therefore, improving the adaptability of quadruped robots to the environment and perceiving the environment is of great significance to improving their path planning capabilities.
[0005] According to the degree of knowledge of environmental information in the path planning process, path planning can be divided into global path planning and local path planning. Among them, the more widely used global path planning algorithms include A* algorithm, dijkstra algorithm, free space method, visibility graph method, etc.; local path planning algorithms include artificial potential field algorithm, genetic algorithm, reinforcement learning algorithm, etc.
[0006] In recent years, reinforcement learning has attracted much attention in the field of quadruped robot technology and has performed well in path planning problems. As an important machine learning method, reinforcement learning adopts a "trial and failure" mechanism, based on the Markov strategy and the environment to continuously interact and trial and error, and modifies the state-to-action mapping strategy according to the immediate reward feedback from the environment, thereby obtaining the optimal behavior strategy. Since reinforcement learning does not require prior knowledge in the learning process and optimizes the strategy by accumulating rewards through interaction with the environment, it has broad application prospects in solving complex optimization decision-making problems. Summary of the invention
[0007] The purpose of the present invention is to provide a DRL-based quadruped robot path planning method to solve the path planning problem of the quadruped robot in a complex obstacle environment (in which there are not only static known obstacles but also unknown dynamic obstacles). First, based on the Markov strategy, the quadruped robot motion environment is modeled, a reward function is set, and the DQN algorithm is used to plan the global information to obtain an optimal or better path; then, based on the global planning, the dynamic obstacles in the environment are continuously detected based on the artificial potential field algorithm, and real-time obstacle avoidance is performed, so that the autonomous learning rate and motion safety of the quadruped robot are improved, avoiding being trapped in a local state, and its motion robustness is stronger.
[0008] To achieve the above object, the present invention is implemented by the following technical solution: a DRL-based quadruped robot path planning method, comprising the following steps:
[0009] Step S1, pre-scan the environment through the RGB-D camera of the quadruped robot, model the motion environment based on the grid method to obtain an environment map, and represent the quadruped robot, obstacles, and target positions through grid coordinates to obtain an initial state;
[0010] Step S2, decomposing the quadruped robot motion environment into a series of grid units with binary information, thereby dividing the grids occupied by obstacles and the grids that can be freely passed;
[0011] Step S3: Modeling based on the Markov decision process and initializing basic parameters;
[0012] Step S4: Introduce the attention mechanism to optimize the neural network model and establish a DQN network;
[0013] Step S5: taking the extracted state features and target positions as the input of the network, and performing exploration actions according to the confidence interval upper bound strategy;
[0014] Step S6: Next, based on the global path planning, the artificial potential field algorithm is used to continuously detect dynamic obstacles in the environment and avoid them in real time;
[0015] Step S7: Execute the action to obtain the current reward value, and continuously update the weight through the target value network to obtain the best expected reward and realize the training of the estimated value network;
[0016] Step S8: Repeat steps S4, S5 and S6 to determine an optimal global path.
[0017] Specifically, in step S1, before path planning, the environmental image obtained by the quadruped robot is segmented, and based on the grid method, its motion environment is defined as a 20*20 grid map; if an obstacle is found in the grid, it is defined as the obstacle position; if a target point is found in the grid, it is defined as the target position.
[0018] Specifically, in step S2, the grid map takes each grid as a basic unit, and mainly includes two states: if there is an obstacle in the grid, it is defined as an obstacle grid, otherwise it is a free grid; the environment map is composed of the grid map i The composition is as shown in formula (1):
[0019] Map = {map i ,map i =0 or 1, i is an integer} (1)
[0020] where map i =0 means the grid is a free grid, map i =1 indicates that the grid is an obstacle grid.
[0021] Specifically, in S3, the specific steps of modeling and initializing parameters are as follows:
[0022] Step S3.1: Model the motion environment of the quadruped robot based on the Markov decision process, and its MDP is defined as follows:
[0023] (1) Single agent: quadruped robot;
[0024] (2) Action space: The quadruped robot moves along the blank grid and can move up, down, left, and right. Its action space can be expressed as A = {0, 1, 2, 3}, where 0 represents east, 1 represents southeast, 2 represents south, 3 represents southwest, 4 represents west, 5 represents northwest, 6 represents north, and 7 represents northeast. The direction is coded clockwise.
[0025] (3) State space: includes the state information of the quadruped robot and the state information of the obstacle at time t. The state information of the quadruped robot at time t is defined as S t ={(x,y),θ / 2π,d obj ,d aim}, where (x, y) represents the coordinates of the quadruped robot in the current map, θ / 2π represents its orientation, and d obj and d aim Represent the distance to the nearest obstacle and the target position respectively. The state of the ith obstacle observed at time t is represented by O i ={p x ,p y ,v x ,v y ,r}, respectively representing the position of the obstacle [p x ,p y ], speed [v x ,v y ] and size radius r;
[0026] (4) Reward function: The agent evaluates the quality of actions through feedback from the environment and selects the action with the largest reward value after learning. When the quadruped robot reaches the target point or obstacle, a fixed reward value is given and the path planning ends. When the quadruped robot is in other states, the closer the robot is to the target point, the greater the reward value it receives in each step of movement. On the contrary, the closer the robot is to the obstacle, the negative reward it receives in each step of movement. Here, the sum of the two reward values is taken as the final reward obtained by the quadruped robot after executing an action, which is calculated by formula (2):
[0027]
[0028] The reward value function of the quadruped robot when performing an action is shown in formula (3):
[0029]
[0030] Among them, if the quadruped robot reaches the target point, the reward value is 200; if the minimum distance between the quadruped robot and the obstacle is less than the set value, it means that there is a collision with the obstacle, and the reward value is -200. Under these two conditions, the quadruped robot will stop training. Otherwise, the reward value at this time consists of two parts: a negative reward value for the distance information between the quadruped robot and the nearest obstacle, and a positive reward value for the distance information between the quadruped robot and the target point;
[0031] Step S3.2: The specific steps for initializing the basic parameters of the deep reinforcement learning model are: reinforcement learning learning rate α∈(0,1), reward discount factor γ∈(0,1), greed factor ε, experience replay pool capacity L, target value network weight update step C, estimated value network random parameter θ, target value network parameter θ', number of iterations N, and the update expression of the Q value function is shown in formula (4):
[0032] Q(s t ,a)=Q(s t ,a t )+α(reward+γmaxQ(s t+1 ,a t+1 )-Q(s t ,a t ) (4)
[0033] Step S3.3: Randomly generate the coordinates of the starting point and the target point, and ensure that there are no obstacles at the starting point and the target point.
[0034] Specifically, in step S4, the fully convolutional neural network model based on DQN is as follows: the network model consists of 4 convolutional layers with a spatial size of 3*3 and 1 special convolutional layer of 1*1. The linear rectifier unit (ReLU) is used as the activation function between the layers, and the final output of the convolutional layer is input into the Softmax function; in the robot path planning problem, the optimal solution to the problem can be obtained by selecting the moving direction with the highest value. The introduction of the attention mechanism in the network can make full use of the key local information of the features. It selects part of the input in a structured way, reduces the dimension of the data, and reduces the amount of calculation. At the same time, it enables the neural network to focus more on utilizing more critical information in the input data. The specific steps of environmental feature extraction are as follows:
[0035] (1) First, use MLP to analyze the state vector S t and O t Perform feature extraction to generate a fixed-length state feature vector, and then perform feature fusion to obtain a fixed-length feature vector e of n+1 i , i = 1,...,n+1, where n represents the number of obstacles in the environment;
[0036] (2) The obtained eigenvector e i As the input of the second layer MLP, e i Input into the multi-layer perceptron φ f and φ a In the above equation, we obtain the paired human-computer interaction features f i and the attention score a of each obstacle i , where the attention score refers to the possibility that obstacles will interfere with the quadruped robot;
[0037] f i =φ f (e i ,w f ),i=1,...,n+1 (5)
[0038] a i =φ a (e i ,w a ),i=1,...,n+1 (6)
[0039] (3) Using the Softmax class to obtain the attention score a i Normalized and compared with the human-computer interaction feature f i Linear combination obtains environmental obstacle features C t , as shown in formula (7):
[0040]
[0041] (4) The environmental obstacle feature C t With the quadruped robot features S t Perform feature fusion to obtain feature H t , the feature H t Input into the DQN network to obtain the best action of the quadruped robot at the next moment.
[0042] Specifically, in S5, the specific steps of the quadruped robot action selection strategy are: using the upper-confidence-bound (UCB) as the exploration strategy of the neural network. The confidence interval is used to measure the confidence level of a random variable distribution. The larger the confidence interval, the greater the uncertainty factor of the variable. The UCB strategy is to use the confidence level to achieve a balance between development and exploration, as shown in formula (8):
[0043] a t = argmax(Q t (a)+U t (a)) (8)
[0044] Where N t (a) represents the number of times action a is selected, lnt represents the logarithm of the total number of actions, and c is a weight. As training progresses, when the number of times the current action is sampled is very low, N t (a) remains unchanged, while lnt is increasing, U t (a) As the value becomes larger, the uncertainty becomes higher and the probability of the corresponding action being executed becomes greater; vice versa.
[0045] Specifically, in S6, the specific steps of the real-time obstacle avoidance process based on the artificial potential field algorithm are as follows: based on the idea of the artificial potential field, the movement around the quadruped robot is virtualized, obstacles will generate a "repulsive force" on it, and the target will generate a "gravitational force" on it. The "gravitational force" and "repulsive force" potential field functions are shown in formula (9) and formula (10) respectively:
[0046]
[0047]
[0048] Where: φ and η are the gain coefficients of attraction and repulsion respectively;
[0049] ρ0 is the distance at which the obstacle can affect the quadruped robot;
[0050] ρ g is the Euclidean distance from the target point to the quadruped robot;
[0051] ρ is the minimum distance from the obstacle influence area to the robot.
[0052] The negative gradient of the potential field function is the corresponding attraction and repulsion function, which are expressed as formula (11) and formula (12) respectively:
[0053]
[0054]
[0055] The total force on the robot is F = F att +F rep , which determines the robot's walking path.
[0056] Specifically, in S7, the specific steps of performing the action are:
[0057] Step S7.1: Execute the selected action a t , and calculate the reward value reward according to the reward function t , reaching a new state statet t+1 ;
[0058] Step S7.2: Set state t 、a t 、reward t 、state t+1 Composition experience set <state t ,a t ,reward t ,state t+1>Store in the memory pool; since the capacity of the experience pool playback pool is L, when the number of experience sets exceeds its capacity, the earliest experience set is deleted;
[0059] Step S7.3: Randomly sample small batches of random samples from the experience replay pool D for training, and calculate the target value y based on the target value network and the experience set i i , the calculation method is as follows, as shown in formula (13):
[0060]
[0061] Step S7.4: Update the weights θ of the estimation network using gradient descent via back-propagation;
[0062] Step S7.5: Update the weight θ' of the target value network every C steps so that θ' = θ;
[0063] Step S7.6: When the quadruped robot reaches the target position or collides with an obstacle, the path planning ends;
[0064] Step S7.7: Repeat the training step.
[0065] In the present invention, the entire path planning algorithm is divided into global path planning and local path planning. The grid method is used to model the motion environment of the quadruped robot, and the DQN algorithm is used to plan the global information to determine an optimal or better route. Then, the dynamic obstacle information in the environment is detected based on the artificial potential field algorithm, and real-time obstacle avoidance is performed, so that the autonomous learning rate and motion safety of the quadruped robot are improved, and its motion robustness is stronger and has good generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 is a flow chart of a method for real-time obstacle avoidance and path planning for a quadruped robot based on an attention mechanism and deep reinforcement learning provided in an exemplary embodiment;
[0067] Figure 2 is a motion direction diagram of a quadruped robot provided in an exemplary embodiment;
[0068] Figure 3 is a force analysis diagram of an artificial potential field method used in a real-time obstacle avoidance process of a quadruped robot provided in an exemplary embodiment;
[0069] Figure 4 It is a model diagram of the deep reinforcement learning DQN algorithm in the real-time obstacle avoidance and path planning method for a quadruped robot provided in an exemplary embodiment. DETAILED DESCRIPTION
[0070] A DRL-based quadruped robot path planning method, reference Figure 1 , the method comprises the following steps:
[0071] Step S1, pre-scan the environment through the RGB-D camera of the quadruped robot, model the motion environment based on the grid method to obtain an environment map, and represent the quadruped robot, obstacles, and target positions through grid coordinates to obtain an initial state;
[0072] Step S2, decomposing the robot motion environment into a series of grid units with binary information, thereby dividing the grids occupied by obstacles and the grids that can be freely passed;
[0073] Step S3: Modeling based on the Markov decision process and initializing basic parameters;
[0074] Step S4: Introduce the attention mechanism to optimize the neural network model and establish a DQN network;
[0075] Step S5: Taking the extracted environment state features and target position as the input of the network, and selecting an action according to the ε-greedy strategy;
[0076] Step S6: Next, based on the global path planning, the artificial potential field algorithm is used to continuously detect dynamic obstacles in the environment and avoid them in real time;
[0077] Step S7: Execute the action to obtain the current reward value, and continuously update the weight through the target value network to obtain the best expected reward and realize the training of the estimated value network;
[0078] Step S8: Repeat steps S4, S5 and S6 to determine an optimal global path.
[0079] The step S1 includes the following steps:
[0080] The grid method was proposed by WE Howden in 1986. He used a grid to represent the map when performing path planning. The grid method decomposes the robot planning space into a series of network units with binary information, and divides the map into grids with basic elements as the minimum grid granularity. After assigning a traffic factor to each grid, the path planning problem becomes a problem of finding the optimal path between two grid nodes on the grid network.
[0081] Before path planning, the environment image obtained by the quadruped robot's RGB-D camera is segmented and processed, and its motion environment is defined as a 20*20 grid map based on the grid method. If an obstacle is found in the grid, it is defined as the obstacle position; if a target point is found in the grid, it is defined as the target position.
[0082] The step S2 includes the following steps:
[0083] The grid map uses each grid as the basic unit, which mainly includes two states: if there is an obstacle in the grid, it is defined as an obstacle grid with a value of 1, otherwise it is a free grid with a value of 0. The environment map consists of a grid map i The composition can be described as follows:
[0084] Map = {map i ,map i =0 or 1, i is an integer} (1)
[0085] where map i =0 means the grid is a free grid, map i =1 indicates that the grid is an obstacle grid.
[0086] The step S3 includes the following steps:
[0087] Step S3.1: Model the motion environment of the quadruped robot based on the Markov decision process, and its MDP is defined as follows:
[0088] (1) Single agent: quadruped robot;
[0089] (2) Action space: The quadruped robot moves along the blank grid and can move up, down, left, and right. Its action space can be expressed as A = {0, 1, 2, 3}, where 0 represents east, 1 represents southeast, 2 represents south, 3 represents southwest, 4 represents west, 5 represents northwest, 6 represents north, and 7 represents northeast. The direction is coded clockwise. The working direction of the quadruped robot is as follows: Figure 2 As shown;
[0090] (3) State space: includes the state information of the quadruped robot and the state information of the obstacles at time t. The state information of the quadruped robot at time t is defined as S t ={(x,y),θ / 2π,d obj ,d aim}, where (x, y) represents the coordinates of the quadruped robot in the current map, θ / 2π represents its orientation, and d obj and d aim Represent the distance to the nearest obstacle and the target position respectively. The state of the ith obstacle observed at time t is represented by O i ={p x ,p y ,v x ,v y ,r}, respectively representing the position of the obstacle [p x ,p y ], speed [v x ,v y ] and size radius r;
[0091] (4) Reward function: The agent evaluates the quality of actions through feedback from the environment and selects the action with the largest reward value after learning. When the quadruped robot reaches the target point or obstacle, a fixed reward value is given and the path planning ends. When the quadruped robot is in other states, the closer the robot is to the target point, the greater the reward value it receives in each step of movement. On the contrary, the closer the robot is to the obstacle, the negative reward it receives in each step of movement. Here, the sum of the two reward values is taken as the final reward obtained by the quadruped robot after executing an action, which is calculated by formula (2):
[0092]
[0093] The reward value function of the quadruped robot when performing an action is shown in formula (3):
[0094]
[0095] Among them, if the quadruped robot reaches the target point, the reward value is 200; if the minimum distance between the quadruped robot and the obstacle is less than the set value, it means that there is a collision with the obstacle, and the reward value is -200. Under these two conditions, the quadruped robot will stop training. Otherwise, the reward value at this time consists of two parts: a negative reward value for the distance information between the quadruped robot and the nearest obstacle, and a positive reward value for the distance information between the quadruped robot and the target point;
[0096] Step S3.2: The specific steps for initializing the basic parameters of the deep reinforcement learning model are: setting the reinforcement learning learning rate α = 0.01, the reward discount factor γ = 0.9, the greed factor ε, the experience replay pool capacity L = 10000, the target value network weight update step C, the estimated value network random parameter θ, the target value network parameter θ', the number of iterations N = 12000, and the update expression of the Q value function is shown in formula (4):
[0097] Q(s t ,a)=Q(s t ,a t )+α(reward+γmaxQ(s t+1 ,a t+1 )-Q(s t ,a t ) (4)
[0098] The step S4 includes the following steps: first, design a fully convolutional neural network model based on DQN, which can retain the original spatial information of the image to the maximum extent. The network model consists of 4 convolutional layers with a spatial size of 3*3 and 1 special convolutional layer with a size of 1*1. The linear rectifier unit (ReLU) is used between the layers as the activation function, and the final output of the convolutional layer is input into the Softmax function; because in the robot path planning problem, the optimal solution to the problem can be obtained by selecting the moving direction with the highest value; introducing the attention mechanism in the network can make full use of the key local information of the features. It selects part of the input in a structured way, reduces the dimension of the data, and reduces the amount of calculation. At the same time, it enables the neural network to focus more on utilizing more critical information in the input data. The specific steps are as follows:
[0099] (1) First, use MLP to analyze the state vector S t and O t Perform feature extraction to generate a fixed-length state feature vector, and then perform feature fusion to obtain a fixed-length feature vector e of n+1 i , i = 1,...,n+1, where n represents the number of obstacles in the environment;
[0100] (2) The obtained eigenvector e i As the input of the second layer MLP. i Input into the multi-layer perceptron φ f and φ a In the above equation, we obtain the paired human-computer interaction features f i and the attention score a of each obstacle i , where the attention score refers to the possibility that obstacles will interfere with the quadruped robot;
[0101] f i =φ f (e i ,w f ),i=1,...,n+1 (5)
[0102] a i =φ a (e i ,w a ),i=1,...,n+1 (6)
[0103] (3) Using the Softmax class to obtain the attention score a i Normalized and compared with the human-computer interaction feature f i Linear combination obtains environmental obstacle features C t , as shown in formula (7):
[0104]
[0105] (4) The environmental obstacle feature C t With the quadruped robot features S t Perform feature fusion to obtain feature H t , the feature H t Input into the DQN network to obtain the best action of the quadruped robot at the next moment.
[0106] The step S5 includes the following steps: The specific process of the action selection strategy in step S5 is as follows: The ε-greedy exploration strategy cannot help the quadruped robot to explore the optimal action well in the early stage of training due to the small number of samples. The present invention adopts the upper-confidence-bound (UCB) as the exploration strategy of the neural network; the confidence interval is used to measure the confidence level of a random variable distribution. The larger the confidence interval, the greater the uncertainty factor of the variable. The UCB strategy uses the confidence level to achieve a balance between development and exploration, as shown in formula (8):
[0107] a t = argmax(Q t (a)+U t (a)) (8)
[0108] generally Where N t (a) represents the number of times action a is selected, lnt represents the logarithm of the total number of actions, and c is a weight. As training progresses, when the number of times the current action is sampled is very low, N t (a) remains unchanged, while lnt is increasing, U t (a) As the value becomes larger, the uncertainty becomes higher and the probability of the corresponding action being executed becomes greater; vice versa.
[0109] The local path planning algorithm based on artificial potential field mentioned in step S6 includes the following steps:
[0110] The potential field method was first proposed by Khatib, who regarded the movement of a manipulator or mobile robot in an environment as moving in an abstract artificial force field: the target point exerts a gravitational force on the robot, and the obstacle exerts a repulsive force on the robot. Finally, based on the idea of artificial potential field, the movement around the quadruped robot is virtualized, and the obstacle exerts a "repulsive force" on it, and the target exerts a "gravitational force" on it. The gravitational and repulsive potential field functions are shown in formula (9) and formula (10) respectively:
[0111]
[0112]
[0113] Where: φ and η are the gain coefficients of attraction and repulsion respectively;
[0114] ρ0 is the distance at which the obstacle can affect the quadruped robot;
[0115] ρ g is the Euclidean distance from the target point to the quadruped robot;
[0116] ρ is the minimum distance from the obstacle influence area to the robot.
[0117] The negative gradient of the potential field function is the corresponding attraction and repulsion function, which are expressed as formula (11) and formula (12) respectively:
[0118]
[0119]
[0120] The total force on the robot is F = F att +F rep , which determines the robot's walking path, such as Figure 3 shown.
[0121] In step S7, the algorithm model of the present invention is as follows Figure 4 As shown, the process of performing an action includes the following steps:
[0122] Step S7.1: Execute the selected action a t , and calculate the reward value reward according to the reward function t , reaching a new state statet t+1 ;
[0123] Step S7.2: Set state t 、a t 、reward t 、state t+1 Composition experience set <state t ,a t ,reward t ,state t+1 >Store in the memory pool; since the capacity of the experience pool playback pool is L, when the number of experience sets exceeds its capacity, the earliest experience set is deleted;
[0124] Step S7.3: Randomly sample small batches of random samples from the experience replay pool D for training, and calculate the target value y based on the target value network and the experience set i i , the calculation method is as follows, as shown in formula (13):
[0125]
[0126] Step S7.4: Update the weights θ of the estimation network using gradient descent via back-propagation;
[0127] Step S7.5: Update the weight θ' of the target value network every C steps so that θ' = θ;
[0128] Step S7.6: When the quadruped robot reaches the target position or collides with an obstacle, the path planning ends;
[0129] Step S7.7: Repeat the training step.
[0130] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A DRL-based quadruped robot path planning method, characterized in that: The steps include: Step S1, pre-scan the environment through the RGB-D camera of the quadruped robot, model the motion environment based on the grid method to obtain an environment map, and represent the quadruped robot, obstacles, and target positions through grid coordinates to obtain an initial state; Step S2, decomposing the quadruped robot motion environment into a series of grid units with binary information, thereby dividing the grids occupied by obstacles and the grids that can be freely passed; Step S3: Modeling based on the Markov decision process and initializing basic parameters, specifically including the following steps: Step S3.1: Model the motion environment of the quadruped robot based on the Markov decision process, and its MDP is defined as follows: (1) Single agent: quadruped robot; (2) Action space: The quadruped robot moves along the blank grid, moving up, down, left, and right. Its action space can be expressed as A = {0, 1, 2, 3, 4, 5, 6, 7}, where 0 represents east, 1 represents southeast, 2 represents south, 3 represents southwest, 4 represents west, 5 represents northwest, 6 represents north, and 7 represents northeast. The direction is coded clockwise. (3) State space: includes the state information of the quadruped robot and the state information of the obstacle at time t. The state information of the quadruped robot at time t is defined as S t ={(x, y), θ / 2π, d obj , d aim }, where (x, y) represents the coordinates of the quadruped robot in the current map, θ / 2π represents its orientation, and d obj and d aim Represent the distances to the nearest obstacle and the target position respectively. The state of the ith obstacle observed at time t is represented by O i ={p x , p y , v x , v y , r}, respectively representing the position of the obstacle [p x , p y ], speed [v x , v y ] and size radius r; (4) Reward function: The agent evaluates the quality of actions through feedback from the environment and selects the action with the largest reward value after learning. When the quadruped robot reaches the target point or obstacle, a fixed reward value is given and the path planning ends. When the quadruped robot is in other states, the closer the robot is to the target point, the greater the reward value it receives in each step of movement. On the contrary, the closer the robot is to the obstacle, the negative reward it receives in each step of movement. The sum of the two reward values is taken as the final reward obtained by the quadruped robot after executing an action, and is calculated using formula (2): The reward value function of the quadruped robot when performing an action is shown in formula (3): If the quadruped robot reaches the target point, the reward value is 200; if the minimum distance between the quadruped robot and the obstacle is less than the set value, it means that there is a collision with the obstacle, and the reward value is -200. Under these two conditions, the quadruped robot will stop training. Otherwise, the reward value at this time consists of two parts: a negative reward value for the distance information between the quadruped robot and the nearest obstacle, and a positive reward value for the distance information between the quadruped robot and the target point. Step S3.2: Initialize the basic parameters of the deep reinforcement learning model. The basic parameters include: reinforcement learning learning rate α∈(0,1), reward discount factor γ∈(0,1), greed factor ε, experience replay pool capacity L, target value network weight update step C, estimated value network random parameter θ, target value network parameter θ', number of iterations N, and the update expression of the Q value function is shown in formula (4): Q(s t ,a)=Q(s t ,a t )+α(reward+γmaxQ(s t+1 ,a t+1 )-Q(s t ,a t )) (4) Step S3.3: randomly generate the coordinates of the starting point and the target point, and ensure that there are no obstacles at the starting point and the target point; Step S4: Introduce the attention mechanism to optimize the neural network model and establish a DQN network; Step S5: taking the extracted state features and target positions as the input of the network, and performing exploration actions according to the confidence interval upper bound strategy; Step S6: Use the artificial potential field algorithm to continuously detect dynamic obstacles in the environment and avoid them in real time; Step S7: Execute the action to obtain the current reward value, and continuously update the weight through the target value network to obtain the best expected reward and realize the training of the estimated value network; Step S8: Repeat steps S4, S5 and S6 to determine an optimal global path.
2. A DRL-based quadruped robot path planning method as claimed in claim 1, characterized in that: The specific process of step S1 is as follows: before path planning, the environmental image obtained by the quadruped robot is segmented: based on the grid method, its motion environment is defined as a 20*20 grid map. If an obstacle is found in the grid, it is defined as the obstacle position; if a target point is found in the grid, it is defined as the target position.
3. A DRL-based quadruped robot path planning method as claimed in claim 1, characterized in that: The specific process of step S2 is as follows: The grid map takes each grid as the basic unit, including two states: if there is an obstacle in the grid, it is defined as an obstacle grid, otherwise it is a free grid; the environment map is composed of grid map i The composition is described as follows: Map = {map i ,map i =0 or 1, i is an integer} (1) Among them, map i =0 means the grid is a free grid, map i =1 indicates that the grid is an obstacle grid.
4. A DRL-based quadruped robot path planning method as claimed in claim 1, characterized in that: Step S4 specifically includes the following steps: Step S4.1: Design a fully convolutional neural network model based on DQN, which can retain the original spatial information of the image to the maximum extent. The network model consists of 4 convolutional layers of 3*3 spatial size and 1 special convolutional layer of 1*1. The linear rectifier unit is used as the activation function between the layers. The final output of the convolutional layer is input into the Softmax function. Step S4.2: In the robot path planning problem, the optimal solution to the problem is obtained by selecting the moving direction with the highest value. Introducing the attention mechanism in the network can make full use of the key local information of the features. It selects part of the input in a structured way, reduces the dimension of the data, and reduces the amount of calculation. At the same time, it can make the neural network more focused on using more critical information in the input data. The specific steps are as follows: (1) First, use MLP to analyze the state vector S t and O t Perform feature extraction to generate a fixed-length state feature vector, and then perform feature fusion to obtain a fixed-length feature vector e of n+1 i , i = 1,...,n+1, where n represents the number of obstacles in the environment; (2) The obtained eigenvector e i As the input of the second layer MLP, e i Input into the multi-layer perceptron φ f and φ a In the above equation, we obtain the paired human-computer interaction features f i and the attention score a of each obstacle i , where the attention score refers to the possibility that obstacles will interfere with the quadruped robot; f i =φ f (e i ,w f ),i=1,...,n+1 (5) am i φ a (e i ,w a ),i01,...,n+1 (6) (3) Using the Softmax class to obtain the attention score a i Normalized and compared with the human-computer interaction feature f i Linear combination obtains environmental obstacle features C t , as shown in formula (7): (4) The environmental obstacle feature C t With the quadruped robot features S t Perform feature fusion to obtain feature H t , the feature H t Input into the DQN network to obtain the best action of the quadruped robot at the next moment.
5. A DRL-based quadruped robot path planning method as claimed in claim 1, characterized in that: The specific process of the action selection strategy in step S5 is as follows: the upper bound of the confidence interval is used as the exploration strategy of the neural network. The confidence interval is used to measure the confidence level of a random variable distribution. The larger the confidence interval, the greater the uncertainty factor of the variable. The UCB strategy uses the confidence level to achieve a balance between development and exploration, as shown in formula (8): Where Nt(a) represents the number of times action a is selected, lnt represents the logarithm of the total number of actions, and c is a weight. As training progresses, when the number of times the current action is sampled is very low, Nt(a) remains unchanged, while lnt increases, and U t (a) As the value becomes larger, the uncertainty becomes higher and the probability of the corresponding action being executed becomes greater; vice versa.
6. A DRL-based quadruped robot path planning method as claimed in claim 1, characterized in that: The real-time obstacle avoidance process of the artificial potential field algorithm in step S6 is as follows: the movement around the quadruped robot is virtualized, obstacles will generate a "repulsive force" on it, and the target will generate a "gravitational force" on it; the "gravitational force" and "repulsive force" potential field functions are shown in formula (9) and formula (10) respectively: in: η are the gain coefficients of attraction and repulsion respectively; ρ0 is the distance at which the obstacle can affect the quadruped robot; ρ g is the Euclidean distance from the target point to the quadruped robot; ρ is the minimum distance from the obstacle influence area to the robot; The negative gradient of the potential field function is the corresponding attraction and repulsion function, which are expressed as formula (11) and formula (12) respectively: The total force on the robot is F = F att +F rep , which determines the robot's walking path.
7. A DRL-based quadruped robot path planning method as claimed in claim 1, characterized in that: Step S7 includes the following steps: Step S7.1: Execute the selected action a t , and calculate the reward value reward according to the reward function t , reaching a new state statet t+1 ; Step S7.2: Set state t 、a t 、reward t 、state t+1 Composition experience set <state t ,a t ,reward t ,state t+1 >Store in the memory pool; since the capacity of the experience pool playback pool is L, when the number of experience sets exceeds its capacity, the earliest experience set is deleted; Step S7.3: Randomly sample small batches of random samples from the experience replay pool D for training, and calculate the target value y based on the target value network and the experience set i i , the calculation method is as follows, as shown in formula (13): Step S7.4: Update the weights θ of the estimation network using gradient descent via back-propagation; Step S7.5: Update the weight θ' of the target value network every C steps so that θ' = θ; Step S7.6: When the quadruped robot reaches the target position or collides with an obstacle, the path planning ends; Step S7.7: Repeat the training step.
Citation Information
Patent Citations
Method for identifying a named entity based on policy value network and tree search
CN110209770A
Unmanned aerial vehicle base station enhanced network optimization method for narrow-band Internet of Things
CN110809274A
Deep reinforcement learning target tracking method based on parametric space noise network
CN111508000A
Unmanned aerial vehicle with laser radar automatic obstacle avoidance system
CN112612294A
Face continuous expression recognition method based on time sequence attention mechanism
CN112766172A
