Vehicle trajectory planning method, electronic device and computer-readable storage medium
By introducing vehicle geometric constraints and heuristic cost functions into trajectory planning, combined with post-processing of B-spline curves, the problem of uneven trajectories and possible collisions generated by the RRT algorithm is solved, and safer and more efficient vehicle trajectory planning is achieved.
Patent Information
- Application Number
- CN202011588772.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-12-29
AI Technical Summary
Existing trajectory planning algorithms such as RRT use suboptimal metric functions and slow sampling strategies when generating trajectories, resulting in unsmooth trajectories and possible collisions with obstacles. Vehicle geometric constraints are not considered, affecting the safety and service life of the vehicle.
A method based on heuristic search of random trees is used to generate new nodes by establishing vehicle geometric constraints, introducing a heuristic cost function to filter parent nodes, and perform trajectory post-processing to prune and smooth the trajectory. B-spline curves are used to fit the path to ensure the trajectory. Smoothness and safety.
Effectively reduce path nodes, improve running speed and quality, generate executable trajectories suitable for vehicle characteristics, and ensure the safety and smooth driving of vehicles in complex environments.
Smart Images

Figure CN112683290B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of autonomous driving, and in particular relates to a vehicle trajectory planning method. Background Art
[0002] Trajectory Planning mainly refers to considering actual temporary or moving obstacles, speed, and dynamic constraints, and trying to plan trajectories according to the planned path. The core of trajectory planning is to solve the problem of how the vehicle should move. The input of trajectory planning includes topological maps, obstacles and predicted trajectories of obstacles, the status of traffic lights, and other information such as positioning navigation and vehicle status. The output of trajectory planning is a trajectory, which is a function of time to position, that is, the vehicle is at a specific position at a specific time. The goal of trajectory planning is to calculate a safe and comfortable trajectory for unmanned vehicles to complete the predetermined driving tasks.
[0003] The Rapidly Expanding Random Tree (RRT) algorithm is applied to trajectory planning. The RRT algorithm avoids modeling the space by performing collision detection on the sampling points in the state space, and can effectively solve the path planning problems in high-dimensional space and complex constraints. The characteristics of this method are that it can quickly and effectively search high-dimensional space, and through random sampling points in the state space, it directs the search to the blank area, thereby finding a planned path from the starting point to the target point, which is suitable for solving path planning in complex and dynamic environments.
[0004] Disadvantages of existing path planning technology:
[0005] (1) The metric function used by the RRT algorithm is the proximity rule, and the generated trajectory is not optimal;
[0006] (1) Since the sampling strategy adopts uniform sampling, the algorithm converges slowly and consumes a lot of useless node computing time;
[0007] (2) The trajectories generated by the RRT algorithm are all interconnected by leaf nodes, which are not smooth and cannot be executed by the vehicle. The geometric constraints of the vehicle body are not considered, so the vehicle may collide with obstacles when it is located at the node. Summary of the invention
[0008] In order to solve the technical problems mentioned in the above background technology, the present invention proposes a vehicle trajectory planning method, an electronic device and a computer-readable storage medium.
[0009] In order to achieve the above technical objectives, the technical solution of the present invention is:
[0010] A vehicle trajectory planning method based on heuristic search random tree includes the following steps:
[0011] (1) Establish the geometric constraints of the vehicle body and use them to generate new nodes of the trajectory random tree;
[0012] (2) Introduce a heuristic cost function to determine the parent node of the new node;
[0013] (3) Post-process the trajectory nodes obtained based on steps (1)-(2), prune the trajectory nodes and smooth the trajectory.
[0014] Furthermore, the specific process of step (1) is as follows:
[0015] (1a) Simplify the vehicle outline into a rectangular frame and determine the area around the vehicle;
[0016] (1b) Randomly generate a new node;
[0017] (1c) Draw a circle with the new node in step (1b) as the center and half the diagonal of the rectangle in step (1a) as the radius;
[0018] (1d) Determine whether the circle obtained in step (1c) intersects with the vehicle surrounding area; if so, return to step (1b) to randomly generate a new node; if not, use the current new node as a branch node of the trajectory random tree.
[0019] Furthermore, in step (2), first, a specific area is constructed with the new node as the center and the artificially set step value as the radius. Some nodes with uneven distribution and a distance from the new node less than the step value are distributed in the specific area; secondly, the cost function value of each node in the specific area is calculated respectively; finally, the node with the smallest cost function is selected as the parent node of the new node.
[0020] Furthermore, the cost function H is as follows:
[0021] H=s+g+f
[0022]
[0023]
[0024]
[0025] Among them, (x new ,y new ) is the coordinate of the new node, (x qs ,y qs ) is the coordinate of the starting node, (x qg ,y qg ) is the coordinate of the target node, (x i ,y i) are the coordinates of a node in a specific area.
[0026] Furthermore, in step (3), the process of pruning trajectory nodes is as follows:
[0027] Generate a valid path node set TS from the starting point to the end point through steps (1)-(2), then start from the root node and connect with the subsequent nodes in the set TS in sequence, and determine whether the line between the current node and the next node collides with the obstacle space. If so, determine whether the current node and the next node have no intersection with the root node respectively. If so, delete the current node from the set TS, and so on, until the line between the next node and the root node collides with the obstacle space. At this time, the current node is used as the new root node; repeat the above process until it is connected to the target node.
[0028] Furthermore, in step (3), a B-spline curve is used for trajectory smoothing.
[0029] Furthermore, the B-spline curve adopts a quasi-uniform B-spline curve.
[0030] An electronic device for vehicle trajectory planning comprises a processor and a memory, wherein the memory stores execution instructions of the processor, and the processor is configured to execute the execution instructions to implement the above-mentioned vehicle trajectory planning method.
[0031] A computer-readable storage medium is used to store a program, and the program is executed to implement the above-mentioned vehicle trajectory planning method.
[0032] The beneficial effects brought by adopting the above technical solution are:
[0033] (1) The present invention introduces a heuristic function in a specific small adjustable area, establishes a new cost function, effectively reduces path nodes, and improves operation speed and quality;
[0034] (2) The present invention considers the geometric constraints of the vehicle body and first establishes constraint conditions to select new node positions to ensure the safety of the vehicle in a complex environment;
[0035] (3) The present invention uses a post-processing method to simplify and smooth the trajectory to generate an executable trajectory suitable for vehicle characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of the overall method of the present invention;
[0037] Figure 2 It is a schematic diagram of geometric constraints in the present invention;
[0038] Figure 3 It is a schematic diagram of the heuristic function in the present invention;
[0039] Figure 4 This is the effect diagram of the traditional RRT algorithm;
[0040] Figure 5 This is the effect diagram of the RRT algorithm considering the vehicle body geometry constraints;
[0041] Figure 6 This is a simulation comparison diagram of the RRT algorithm considering the vehicle body geometry constraints and the random tree algorithm based on heuristic search;
[0042] Figure 7 This is the effect diagram of post-processing based on the heuristic search random tree algorithm. DETAILED DESCRIPTION
[0043] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.
[0044] The present invention designs a vehicle trajectory planning method based on heuristic search random tree, such as Figure 1 As shown, the steps are as follows:
[0045] Step 1: Establish the geometric constraints of the vehicle body and use the geometric constraints to generate new nodes of the trajectory random tree.
[0046] According to the description of the basic principle of RRT, a new node is obtained by extending a distance from the qnear node to the qrand node, but the new node generated by this method may cause the vehicle located at the node to collide with the surrounding environment, thereby planning a path that does not meet the characteristics of the vehicle. In order to improve this defect, the present invention adopts geometric constraints. Figure 2 As shown, the vehicle is simplified to a black rectangular border, the black origin represents the new node, and the black area represents the surrounding environment. The process is as follows:
[0047] 1a. Simplify the vehicle outline into a rectangular frame and determine the area around the vehicle;
[0048] 1b. Randomly generate a new node;
[0049] 1c. Draw a circle with the new node in step 1b as the center and half the diagonal of the rectangle border in step 1a as the radius;
[0050] 1d. Determine whether the circle obtained in step 1c intersects with the vehicle's surrounding area; if so, return to step 1b to randomly generate a new node; if not, use the current new node as a branch node of the trajectory random tree.
[0051] Step 2: Introduce a heuristic cost function to determine the parent node of the new node.
[0052] The traditional RRT algorithm is to find the node with the shortest distance to the randomly sampled node qrand as qnear, and then connect the new node to the qnear node. This measurement method is simple and determines the efficiency of the algorithm and whether the node selection is appropriate. It is the most important part of the RRT algorithm optimization. However, since the algorithm converges slowly and does not meet the real-time requirements of the vehicle, the present invention redesigns the measurement method, introduces the concept of heuristic function, and screens the nodes connected to the new node by calculating the cost function of each node in a specific area. The feasibility and correctness of the new measurement function are effectively verified in the experiment. In order to better demonstrate the logic and principle of the new measurement function, the principle of the new measurement method is described in the form of a tree branch node diagram, such as Figure 3 As shown, we can clearly see the tree branches and the connecting lines between them. First, we construct a specific area with the new node as the center and the manually set step value as the radius. There will be some unevenly distributed nodes in the specific area whose distance from the new node is less than the step value; secondly, we calculate the cost function value of each node in the specific area; finally, we select the node with the smallest cost function as the parent node of the new node. The cost function is as follows:
[0053] H=s+g+f
[0054]
[0055]
[0056]
[0057] Among them, (x new ,y new ) is the coordinate of the new node, (x qs ,y qs ) is the coordinate of the starting node, (x qg ,y qg ) is the coordinate of the target node, (x i ,y i ) are the coordinates of a node in a specific area.
[0058] Compared with the traditional RRT algorithm that uses the node with the smallest distance to the new node as the parent node, the improved measurement method of the present invention is more convergent. It utilizes the fast convergence speed of the heuristic function and integrates its advantages well into the basic RRT algorithm, making the new node more greedy when selecting a parent node.
[0059] Step 3: Post-process the trajectory nodes obtained based on steps 1-2, prune the trajectory nodes and smooth the trajectory.
[0060] Since the basic RRT path planning algorithm adopts a uniform random sampling strategy and the path is composed of multiple nodes, the trajectory it generates is not smooth, jittery, and has sharp angles. In particular, in a complex environment with a large number of irregular obstacles, RRT will generate multiple turning points and useless nodes. For vehicles with non-complete constraints, it is difficult to track this path, and it will greatly reduce the service life of the vehicle and reduce the safety of the vehicle. Therefore, the present invention proposes an efficient post-processing method for this situation, thereby satisfying the vehicle motion constraints and utilizing the advantages of the RRT algorithm.
[0061] To trim a track node:
[0062] Generate a valid path node set TS from the starting position to the end position through steps 1-2, and then connect with the subsequent nodes in the set TS in sequence starting from the root node, and determine whether the connection between the current node and the next node collides with the obstacle space. If so, determine whether the current node and the next node have no intersection with the root node respectively. If so, delete the current node from the set TS, and so on, until the connection between the next node and the root node collides with the obstacle space. At this time, the current node is used as the new root node; repeat the above process until it is connected to the target node.
[0063] Bessel smoothing function:
[0064] Bezier curves (B-spline curves) have the advantages of flexibility, continuity and straight-line preservation. There are many types of B-spline curves, including uniform B-spline, quasi-uniform B-spline, segmented Bezier curve and non-uniform B-spline. Since the quasi-uniform B-spline curve passes through the endpoints, the present invention uses the quasi-uniform B-spline curve to fit the pruned path nodes to generate an executable trajectory that meets the vehicle motion constraints.
[0065] The present invention also intends to protect an electronic device for vehicle trajectory planning, including a processor and a memory, wherein the memory stores execution instructions of the processor, and the processor is configured to execute the execution instructions to implement the above-mentioned vehicle trajectory planning method.
[0066] The present invention also intends to protect a computer-readable storage medium for storing a program and executing the program to implement the above-mentioned vehicle trajectory planning method.
[0067] In order to verify the feasibility of the present invention, the effect diagrams of the traditional RRT (rapidly expanding random tree search) and the present invention are compared. Figure 4 As shown in the figure, the dashed border represents the size of the vehicle, the black area represents the surrounding environment of the vehicle, and the black solid line represents the trajectory. It can be clearly seen that when the vehicle is driving along the path planned by the basic RRT algorithm, due to the geometric characteristics of the vehicle body, it will collide with the surrounding environment and the path is not smooth. Figure 4 The black arrows in the middle are the path nodes where the vehicle collides with the surrounding environment.
[0068] From the perspective of vehicle safety, the RRT algorithm that considers the vehicle body geometry constraints better meets the vehicle motion constraint requirements and can better meet the requirements of vehicle safety, such as Figure 5 shown.
[0069] Under the condition of considering the body geometry constraints, the improved RRT (with body constraints added) and the heuristic search random tree algorithm ( Figure 6 The step value of a specific area in the simulation experiment was set to 150) for comparison. Figure 6 As shown in the figure, the black dotted trajectory is the result planned by the improved RRT algorithm, and the black solid trajectory is generated by the heuristic search random tree algorithm. Although neither the dotted trajectory nor the solid trajectory collides with the surrounding environment, it can be clearly seen that the dotted path length is much longer than the solid trajectory, and there are multiple sharp path nodes in the dotted trajectory. Since the heuristic search random tree introduces a heuristic function, it is significantly better than the RRT algorithm that only considers the shortest distance when selecting nodes. It is for this reason that the trajectory generated by the heuristic search random tree is better than the RRT.
[0070] like Figure 7 As shown in the figure, the black dotted line is the trajectory generated by the heuristic search random tree; the motion trajectory composed of the black solid line and the arc is post-processed based on the heuristic search random tree. Figure 7 It can be clearly seen that the trajectory after post-processing method is smoother and the path distance is shortened.
[0071] The embodiments are only for illustrating the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.
Claims
1. A vehicle trajectory planning method based on heuristic search random tree, characterized in that: The following steps are involved: (1) Establish the geometric constraints of the vehicle body and use them to generate new nodes of the trajectory random tree; (2) Introduce a heuristic cost function to determine the parent node of the new node; (3) post-processing the trajectory nodes obtained based on steps (1)-(2), pruning the trajectory nodes and smoothing the trajectory; The specific process of step (1) is as follows: (1a) Simplify the vehicle outline into a rectangular frame and determine the area around the vehicle; (1b) Randomly generate a new node; (1c) Draw a circle with the new node in step (1b) as the center and half the diagonal of the rectangle in step (1a) as the radius; (1d) Determine whether the circle obtained in step (1c) intersects with the area surrounding the vehicle; if so, return to step (1b) to randomly generate a new node; if not, use the current new node as a branch node of the trajectory random tree; In step (2), first, a specific area is constructed with the new node as the center and the step value set manually as the radius. Some nodes with uneven distribution and a distance from the new node less than the step value are distributed in the specific area. Secondly, the cost function value of each node in the specific area is calculated respectively. Finally, the node with the smallest cost function is selected as the parent node of the new node. The cost function H is as follows: H=s+g+f Among them, (x new ,y new ) is the coordinate of the new node, (x qs ,y qs ) is the coordinate of the starting node, (x qg ,y qg ) is the coordinate of the target node, (x i ,y i ) are the coordinates of a node in a specific area.
2. The vehicle trajectory planning method based on heuristic search random tree according to claim 1 is characterized in that: In step (3), the process of pruning trajectory nodes is as follows: Generate a valid path node set TS from the starting point to the end point through steps (1)-(2), then start from the root node and connect with the subsequent nodes in the set TS in sequence, and determine whether the line between the current node and the next node collides with the obstacle space. If so, determine whether the current node and the next node have no intersection with the root node respectively. If so, delete the current node from the set TS, and so on, until the line between the next node and the root node collides with the obstacle space. At this time, the current node is used as the new root node; repeat the above process until it is connected to the target node.
3. The vehicle trajectory planning method based on heuristic search random tree according to claim 1 is characterized in that: In step (3), the B-spline curve is used for trajectory smoothing.
4. The vehicle trajectory planning method based on heuristic search random tree according to claim 3 is characterized in that: The B-spline curve adopts a quasi-uniform B-spline curve.
5. An electronic device for vehicle trajectory planning, characterized in that: It comprises a processor and a memory, wherein the memory stores execution instructions of the processor, and the processor is configured to execute the execution instructions to implement the vehicle trajectory planning method according to any one of claims 1 to 4.
6. A computer-readable storage medium for storing a program, characterized in that: Execute the program to implement the vehicle trajectory planning method described in any one of claims 1-4.
