Transform-based vehicle lane changing trajectory planning method

By combining the Transformer model of quintic polynomials and fifth-order Bezier curves, the adaptability and multi-objective optimization problems of existing trajectory planning methods in complex traffic scenarios are solved, safe and comfortable lane change trajectory planning is achieved, and the robustness and efficiency of autonomous driving are improved.

CN120735784APending Publication Date: 2025-10-03BEIHANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510552940.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Existing lane-changing trajectory planning methods lack adaptability in complex traffic scenarios, have difficulty in effectively utilizing scene data, and lack multi-objective collaborative optimization, resulting in insufficient comprehensive consideration of safety, comfort, and other aspects in the planning results.

Method used

A Transformer-based method is adopted, combining quintic polynomial curves and fifth-order Bezier curves, and a set of candidate trajectories is generated through Monte Carlo sampling. The Transformer model is used to extract high-dimensional features for similarity retrieval. Combined with the constraints of single-vehicle motion and vehicle-to-vehicle interaction, a multi-objective evaluation function is constructed to select the optimal trajectory.

Benefits of technology

It improves the robustness and adaptability of lane change trajectory planning, enhances lane change safety and road traffic operation efficiency, and ensures trajectory smoothness and passenger comfort.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120735784A_ABST
    Figure CN120735784A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle lane changing trajectory planning method based on Transform for lane changing trajectory planning of an automatic driving vehicle, and belongs to the technical field of automatic driving trajectory optimization. Aiming at the problems of insufficient curve adaptability, low scene feature matching efficiency, difficulty in multi-target collaborative optimization and the like of a traditional single lane changing track, firstly, a corresponding actual lane changing track is generated based on a quintic polynomial curve and a five-order Bezier curve, and curve parameters are disturbed through Monte Carlo sampling; and expanding the diversity of the two lane changing trajectory curves, and generating a diversified basic candidate trajectory set. Secondly, extracting high-dimensional features of a scene by using a Transform model, and comparing feature vectors of an actual lane changing trajectory with feature vectors of basic candidate trajectories to obtain a high-correlation updated trajectory candidate set; and then, carrying out dynamic constraint and collision avoidance constraint on the track boundary of the updated candidate track set, and generating a final candidate track set meeting vehicle motion characteristics and safety requirements. And finally, constructing a multi-target dynamic evaluation function, dynamically adjusting weights of traffic efficiency, safety, comfort and smoothness, comparing the final candidate track set with an evaluation function value of an actual lane changing track, and outputting a global optimal lane changing track of the automatic driving vehicle in the current lane changing environment. According to the method, the robustness, the safety and the adaptability of the lane changing track are remarkably improved, complex traffic scenes can be effectively dealt with, and the driving efficiency of the automatic driving vehicle and the comfort of passengers are optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle lane-changing trajectory optimization in an autonomous driving environment, and specifically to a vehicle lane-changing trajectory planning method based on a Transformer. Background Art

[0002] With the rapid development of intelligent driving technology, vehicle lane change trajectory planning, as a core component of autonomous driving systems, affects vehicle driving safety, traffic efficiency, and passenger comfort. Existing lane change trajectory planning methods are mostly based on a single model, such as polynomial curves, Bezier curves, or spline curves, and generate candidate trajectories through preset constraints. However, such methods have significant limitations: first, a single model is difficult to adapt to complex and changing traffic scenarios, resulting in insufficient trajectory adaptability; second, traditional methods rely on fixed parameter sampling when generating candidate trajectories, lack effective utilization of scene data, and have difficulty balancing scene diversity and trajectory feasibility; in addition, existing evaluation systems often focus on a single objective and ignore multi-objective collaborative optimization, resulting in a lack of comprehensive consideration of multiple dimensions such as safety and comfort in the planning results.

[0003] In recent years, data-driven trajectory planning methods have gradually emerged, using machine learning models to extract scene features and optimize trajectory generation. However, existing methods still face challenges in feature representation and matching similar trajectories. On the one hand, traditional feature extraction methods have difficulty capturing complex interactions; on the other hand, the trajectory matching process lacks sufficient consideration of dynamic obstacles and vehicle kinematic constraints, which can easily lead to collision risks or violations of dynamic constraints. For example, while Monte Carlo sampling-based methods can generate diverse trajectories, they lack deep correlation with scene features, resulting in low computational efficiency. Furthermore, rule-based evaluation functions often have difficulty dynamically adjusting weights and cannot adapt to the changing priorities of different driving scenarios.

[0004] To address these issues, a lane-changing trajectory planning method that integrates multiple trajectory curves with data-driven technology is urgently needed to improve the robustness and adaptability of the planning results. This invention, based on two lane-changing trajectory curves, uses a Transformer model for efficient scene feature matching and trajectory screening. Finally, it selects the optimal trajectory through a multi-objective dynamic evaluation function, thereby improving lane-changing safety and enhancing road traffic efficiency. Summary of the Invention

[0005] This paper aims to address the challenges of traditional single-curve trajectory models, including insufficient adaptability, inefficient scene feature matching, and difficulties in multi-objective collaborative optimization. By proposing a Transformer-based vehicle lane-changing trajectory planning method, this method fuses a quintic polynomial trajectory curve with a fifth-order Bezier trajectory curve, combining data-driven and rule-based approaches to achieve efficient, safe, and comfortable lane-changing trajectory planning in complex traffic scenarios.

[0006] The specific implementation steps of this method are as follows:

[0007] Step 1: Use on-board sensors and roadside sensors to obtain the vehicle state, target lane state, and road topology information when the lane change occurs. Establish a plane rectangular coordinate system with the vehicle's lane change starting position as the origin and the vehicle's forward direction as the positive direction of the Y-axis. Plan the vehicle's lane change trajectory based on a fifth-order polynomial curve and a fifth-order Bezier curve, and obtain the vehicle's actual lane change trajectory.

[0008] Step 11: Initialize the quintic polynomial trajectory curve

[0009] Since the vehicle often uses a five-point constraint lane-changing trajectory when changing lanes, in order to ensure the smoothness of the trajectory, the lane-changing trajectory equation is as follows:

[0010] y(x)=a0+a1x+a2x 2 +a3x 3 +a4x 4 +a5x 5

[0011] Among them, x is the longitudinal displacement, a0=0, and the five unknown coefficients {a1, a2, a3, a4, a5} are obtained by the equations of the five key points of the trajectory and the direction change rate of the trajectory. Zero at the start and end points (i.e. )Sure;

[0012] The equations for the five key points are as follows: Starting point: (x0, y0) = (0, 0), the starting point of the lane change, usually (0, 0); 1 / 4 trajectory point: Represents the initial transition stage of lane change. Midpoint: Halfway through the lane change process, 3 / 4 track points: Represents the adjustment phase at the end of lane change. End point: (x4,y4)=(x f ,y(x f )), which is the end point of the lane change. f is the longitudinal coordinate of the lane change endpoint.

[0013] Step 12: Initialize the fifth-order Bezier trajectory curve

[0014] The lane-changing trajectory equation determined by the six control points {P0, P1, P2, P3, P4, P5} is as follows:

[0015] t is a parameter

[0016] in, x∈[0,x f], the six control points are: the starting point of lane change P0 = (0,0), P1, P2, P3, P4 and the end point of lane change P5 = (x f ,y(x f )), P x,q 、P y,q are the horizontal and vertical coordinates of the control point, q∈{0,1,2,3,4,5};

[0017] The longitudinal distribution constraint and curvature continuity constraint of the fifth-order Bezier curve are: Longitudinal distribution constraint: the longitudinal spacing between adjacent control points Δx≤x f / 5, that is q∈{0,1,2,3,4,5}; Curvature continuity constraint: the second-order derivative is zero at the starting and end points, that is,

[0018] Step 13 Actual lane change trajectory

[0019] Based on the above two lane-changing trajectory curves, the actual lane-changing trajectories under different curve modeling are obtained respectively.

[0020] In step 2, based on the fifth-order polynomial curve and the fifth-order Bezier curve, the parameters of the two curves are extracted respectively through Monte Carlo sampling to generate two corresponding basic candidate trajectory sets.

[0021] For the quintic polynomial curve, Monte Carlo sampling was used to uniformly extract 1000 sets of parameters by randomly perturbing the y values ​​{y1, y2, y3} of three key points along the trajectory. For the fifth-order Bezier curve, Monte Carlo sampling was used to randomly perturb the longitudinal offsets of the intermediate control points {P1, P2, P3, P4}, generating 1000 sets of parameter combinations. The trajectories formed by these 1000 parameter combinations were used as the candidate trajectories for the two corresponding curves.

[0022] In step 3, the Transformer model is used to extract high-dimensional features of each trajectory parameter from the actual lane-changing trajectory and the basic candidate trajectory set. Efficient feature vector similarity retrieval is performed to find trajectories in the basic candidate set that are similar to the actual lane-changing trajectory. The updated candidate trajectory set is then output and generated.

[0023] Step 31 Data preprocessing

[0024] To extract high-dimensional features of different trajectory parameters and ensure that all features can be effectively extracted, first, the input features are filtered to retain only important and representative features to avoid redundant information affecting model performance. The parameters that should be input for all trajectories are speed v, acceleration s, and the longitudinal coordinate x of the lane change endpoint. fIn addition, for the fifth-order polynomial curve, the input data should also include the parameters {a1, a2, a3, a4, a5} and the y coordinates of the three key points of the trajectory process; for the fifth-order Bezier curve, the input data should also include the coordinates of the control points {P1, P2, P3, P4};

[0025] Therefore, for a fifth-degree polynomial curve, the input vector r i It can be written as {v,s,x f ,a1,a2,a3,a4,a5,y1,y2,y3}; For the fifth-order Bezier curve, the input vector r i It can be written as {v,s,x f ,P 1x ,P 2x ,P 3x ,P 4x ,P 1y ,P 2y ,P 3y ,P 4y};

[0026] Secondly, for the actual lane-changing trajectory, determine the type of curve it uses, and according to the input vector form described previously, mark the relevant parameters with asterisks* and then write out the corresponding input vector.

[0027] Step 32 Input feature transformation

[0028] The Transformer module structure includes a linear transformation layer, a 4-layer encoder consisting of 8 attention heads in each layer (the hidden layer dimension is 128), and an embedded similarity retrieval layer. The activation function is GELU. A quintic polynomial curve set is formed for the quintic polynomial curve basic candidate trajectory set, and a quintic Bezier curve set is formed for the quintic Bezier curve basic candidate trajectory set. The actual lane change trajectory is added to the corresponding curve set according to the curve type. The input vectors generated by the different curve set categories in step (1) are respectively passed through the linear transformation layer, and the linear mapping function is used to transform the input vector into a 128-dimensional vector and store it in different curve sets. The linear mapping function is expressed as follows:

[0029] F i =W linear ·r i +b

[0030] Among them, F i ∈R 128 The 128-dimensional vector after linear mapping is also called the embedding vector, r i is the input vector, W linear ∈R 128x11 is the weight matrix of the linear transformation, usually initialized randomly using normal distribution or uniform distribution, b∈R 128is the bias term, which is usually initialized to 0;

[0031] Step 33 Feature pooling output

[0032] Embed the vector F of all trajectories in the set of quintic polynomial curves and the set of quintic Bezier curves i After inputting the Transformer encoder, a sequence output F is obtained feature , the formula is as follows:

[0033] [F1,F2,...,F n ]<Encoder function>F feature =[h1,h2,…,h n ]

[0034] Among them, F i ∈R 128 , h i is the 128-dimensional feature vector of the i-th position, h i ∈R 128 , n is the length of the input sequence;

[0035] Afterwards, the sequence is output to F according to the source of different curve sets. feature Divide into corresponding eigenvectors. Use the eigenvector set {F hisfive} represents the semantic information of lane-changing trajectories generated based on the set of quintic polynomial curves, and uses the feature vector set {F hisbez} represents the semantic information of lane-changing trajectories generated based on the fifth-order Bezier curve set. Then, the star-marked * items are selected from each curve set, i.e., the actual lane-changing trajectories corresponding to each curve, and F is used to represent the semantic information of lane-changing trajectories generated based on the fifth-order Bezier curve set. turefive 、F turebez Representing the semantic information of the actual lane-changing trajectory;

[0036] Step 34: Similar scene matching and updated candidate trajectory set generation

[0037] Calculate and compare eigenvectors F in the feature space turefive 、F turebez With the feature vector set {F hisfive}、{F hisbez The Mahalanobis distance of each eigenvector in}. The eigenvector set {F hisfive}、{F hisbez} collectively referred to as F pred , the eigenvector F turefive 、F turebez Collectively referred to as F ture To facilitate the subsequent formula expression, the Mahalanobis distance formula is as follows:

[0038]

[0039] Among them, Σ is the covariance matrix of the basic candidate trajectory features, which is used to eliminate dimensional differences;

[0040] According to the Mahalanobis distance comparison results, the top 200 smaller curve sets in each curve set are selected as similar trajectories and used as the update candidate trajectory set.

[0041] In step 4, based on the updated candidate trajectory set generated in step 3, the final candidate trajectory set is generated by considering the motion characteristics of a single vehicle and the vehicle-to-vehicle interaction during the lane change process.

[0042] Step 41 Cycling motion feature constraints

[0043] The characteristics of bicycle motion use initial and terminal hard constraints and dynamic soft constraints:

[0044] The starting point position and heading angle constraint x(0)=0,

[0045] End position and heading angle constraints:

[0046] Lateral acceleration constraint:

[0047] Yaw rate constraint:

[0048] Among them, x is the longitudinal coordinate of the lane-changing vehicle, y is the lateral coordinate of the lane-changing vehicle, is the slope of the path (the tangent of the heading angle, dimensionless), is the derivative of the path slope, s y is the lateral acceleration, g is the acceleration due to gravity, is the yaw rate, i.e., the rotation rate of the vehicle around the axis perpendicular to the ground, v x is the longitudinal speed of the lane-changing vehicle;

[0049] Step 42: Vehicle-to-vehicle interaction constraints

[0050] The interaction with the vehicle in the target lane is mainly reflected in the collision avoidance constraint. The static obstacle of the vehicle in the target lane can be calculated and its bounding box constructed. The following constraints are used to ensure that the lane-changing vehicle maintains a safe distance from the obstacle:

[0051]

[0052] Among them, y(x) is the lateral coordinate of the lane-changing vehicle at position x, (x j ,y j ) is the position of the obstacle vehicle on the target lane, j is the number of the obstacle vehicle, L v 、W v is the length and width of the lane-changing vehicle, Δd safe =0.5m.

[0053] Step 5: Considering objectives such as traffic efficiency, safety, comfort, and smoothness, define evaluation indicators and assign weights to the indicators respectively to establish a multi-objective evaluation function.

[0054] Step 51: Define evaluation metrics

[0055] Evaluation indicators are defined by comprehensively considering the traffic efficiency, safety, comfort, and smoothness of the vehicle during lane changing. Among them, traffic efficiency is characterized by the length of the trajectory. The shorter the trajectory length, the shorter the time it takes for the vehicle to change lanes, and the shorter the impact on the surrounding normally moving vehicles. Safety is characterized by the maximum curvature of the vehicle's lane changing trajectory during the lane changing process. The smaller the maximum curvature of the vehicle's lane changing trajectory, the smaller the impact on the speed of surrounding vehicles. Comfort is characterized by the variance of the curvature change of the entire trajectory. The smaller the variance, the smaller the curvature fluctuation amplitude of the trajectory, the smaller the lateral acceleration, and the better the passenger riding experience. Smoothness is characterized by the phase angle change rate of the entire trajectory. The smaller the change rate, the smoother the trajectory and the better the stability. The formula for the evaluation indicator is as follows:

[0056] Traffic efficiency: track length Normalized to

[0057] Safety: Maximum curvature Normalized to

[0058] Comfort: Curvature variation

[0059] Smoothness: Phase angle change rate Δφ=|φ end -φ start |;

[0060] Among them, κ ref is the reference value of curvature, κ(x) is the curvature corresponding to the ordinate x on the lane-changing trajectory, is the average value of the curvature over the entire trajectory, φ end is the phase angle of the lane-changing trajectory end point, φ start is the phase angle of the starting point of the lane-changing trajectory;

[0061] Step 52: Construct evaluation function

[0062] Construct the evaluation function J according to step 51:

[0063] minJ=ω1L norm +ω2κ norm +ω3D(κ)+ω4Δφ

[0064] The dynamic weight adjustment rule is: when facing a congestion scene (vehicle speed vx <10m / s), ω1=0.2(efficiency), ω2=0.4(safety), ω3=0.3(comfort), ω4=0.1(smoothness); When facing high-speed scenes (vehicle speed v x ≥20m / s), ω1=0.4, ω2=0.3, ω3=0.2, ω4=0.

[0065] Step 6: Based on the evaluation function, calculate the evaluation function J values ​​of the actual lane-changing trajectory and the two final candidate trajectory sets. Then, sort the J values ​​of the final candidate trajectory sets in ascending order by curve category. Select the top ten trajectories in the final candidate trajectory sets for each of the two curves. Compare the J values ​​of the top ten trajectories in the final candidate trajectory sets for the two curves with the J values ​​of the actual lane-changing trajectory. Select the trajectory with the smallest evaluation function value as the optimal lane-changing trajectory for the two curves. Finally, select the trajectory with the smallest J value among the optimal lane-changing trajectories for the two curves as the global optimal lane-changing trajectory.

[0066] Step 61 outputs the final trajectory of each curve

[0067] Calculate the evaluation function J value of the actual lane-changing trajectory, denoted as J0, sort the trajectories in the two final candidate trajectory sets, calculate the performance index J value of the 200 trajectories generated under each lane-changing curve modeling, and sort them in ascending order to obtain the top ten trajectories. If the number of remaining valid trajectories after sorting is less than 5, the system will start the constraint relaxation strategy: gradually relax the safety distance Δd safe The limit is reduced by 0.1m each time, with the lowest limit being 0.3m, and the top ten candidate trajectories in the final candidate trajectory set are regenerated accordingly;

[0068] Step 62 outputs the global optimal trajectory

[0069] Compare the J values ​​of the top ten trajectories in the final candidate trajectory set of the two curves with the actual lane-changing trajectory, and select the trajectory with the smallest J value as the optimal lane-changing trajectory under each curve, which are denoted as T five* 、T bezier* , and output its parameters With {P1 * ,P2 * ,P3 * ,P4 * Compare the optimal trajectory T five* 、T bezier* The J value is selected, the minimum value is selected, and its parameter value is output to obtain the global optimal trajectory. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is a block diagram of the overall idea of ​​the present invention;

[0071] Figure 2a It is a schematic diagram of a quintic polynomial curve;

[0072] Figure 2b This is a schematic diagram of the lane-changing trajectory of a fifth-order Bezier curve;

[0073] Figure 3 It is a schematic diagram of lane change trajectory selection; DETAILED DESCRIPTION

[0074] The present invention is described in detail below with reference to the accompanying drawings and embodiments. It should be understood that this example is only used to illustrate the present invention and is not intended to limit the scope of the present invention. The overall idea of ​​the vehicle lane change trajectory planning method based on Transformer provided by the present invention is as follows: Figure 1 As shown, the specific implementation method includes the following steps:

[0075] Step 1: Use on-board sensors and roadside sensors to obtain the vehicle state, target lane state, and road topology information when the lane change occurs. Establish a plane rectangular coordinate system with the vehicle's lane change starting position as the origin and the vehicle's forward direction as the positive direction of the Y-axis. Plan the vehicle's lane change trajectory based on a fifth-order polynomial curve and a fifth-order Bezier curve, and obtain the vehicle's actual lane change trajectory.

[0076] Step 11: Initialize the quintic polynomial trajectory curve

[0077] Since the vehicle often uses a five-point constraint lane-changing trajectory when changing lanes, in order to ensure the smoothness of the trajectory, the lane-changing trajectory equation is as follows:

[0078] y(x)=a0+a1x+a2x 2 +a3x 3 +a4x 4 +a5x 5

[0079] Among them, x is the longitudinal displacement, a0=0, and the five unknown coefficients {a1, a2, a3, a4, a5} are obtained by the equations of the five key points of the trajectory and the direction change rate of the trajectory. Zero at the start and end points (i.e. )Sure;

[0080] The equations for the five key points are as follows: Starting point: (x0, y0) = (0, 0), the starting point of the lane change, usually (0, 0); 1 / 4 trajectory point: Represents the initial transition stage of lane change. Midpoint: Halfway through the lane change process, 3 / 4 track points: Represents the adjustment phase at the end of lane change. End point: (x4,y4)=(x f ,y(x f)), which is the end point of the lane change. f is the longitudinal coordinate of the lane change endpoint.

[0081] Step 12: Initialize the fifth-order Bezier trajectory curve

[0082] The lane-changing trajectory equation determined by the six control points {P0, P1, P2, P3, P4, P5} is as follows:

[0083] t is a parameter

[0084] in, x∈[0,x f ], the six control points are: the starting point of lane change P0 = (0,0), P1, P2, P3, P4 and the end point of lane change P5 = (x f ,y(x f )), P x,q 、P y,q are the horizontal and vertical coordinates of the control point, q∈{0,1,2,3,4,5};

[0085] The longitudinal distribution constraint and curvature continuity constraint of the fifth-order Bezier curve are: Longitudinal distribution constraint: the longitudinal spacing between adjacent control points Δx≤x f / 5, that is q∈{0,1,2,3,4,5}; Curvature continuity constraint: the second-order derivative is zero at the starting and end points, that is,

[0086] Step 13 Actual lane change trajectory

[0087] Based on the above two lane-changing trajectory curves, the actual lane-changing trajectories under different curve modeling are obtained respectively.

[0088] In step 2, based on the fifth-order polynomial curve and the fifth-order Bezier curve, the parameters of the two curves are extracted respectively through Monte Carlo sampling to generate two corresponding basic candidate trajectory sets.

[0089] For the quintic polynomial curve, Monte Carlo sampling was used to uniformly extract 1000 sets of parameters by randomly perturbing the y values ​​{y1, y2, y3} of three key points along the trajectory. For the fifth-order Bezier curve, Monte Carlo sampling was used to randomly perturb the longitudinal offsets of the intermediate control points {P1, P2, P3, P4}, generating 1000 sets of parameter combinations. The trajectories formed by these 1000 parameter combinations were used as the candidate trajectories for the two corresponding curves.

[0090] In step 3, the Transformer model is used to extract high-dimensional features of each trajectory parameter from the actual lane-changing trajectory and the basic candidate trajectory set. Efficient feature vector similarity retrieval is performed to find trajectories in the basic candidate set that are similar to the actual lane-changing trajectory. The updated candidate trajectory set is then output and generated.

[0091] Step 31 Data preprocessing

[0092] To extract high-dimensional features of different trajectory parameters and ensure that all features can be effectively extracted, first, the input features are filtered to retain only important and representative features to avoid redundant information affecting model performance. The parameters that should be input for all trajectories are speed v, acceleration s, and the longitudinal coordinate x of the lane change endpoint. f In addition, for the fifth-order polynomial curve, the input data should also include the parameters {a1, a2, a3, a4, a5} and the y coordinates of the three key points of the trajectory process; for the fifth-order Bezier curve, the input data should also include the coordinates of the control points {P1, P2, P3, P4};

[0093] Therefore, for a fifth-degree polynomial curve, the input vector r i It can be written as {v,s,x f ,a1,a2,a3,a4,a5,y1,y2,y3}; For the fifth-order Bezier curve, the input vector r i It can be written as {v,s,x f ,P 1x ,P 2x ,P 3x ,P 4x ,P 1y ,P 2y ,P 3y ,P 4y};

[0094] Secondly, for the actual lane-changing trajectory, determine the type of curve it uses, and according to the input vector form described previously, mark the relevant parameters with asterisks* and then write out the corresponding input vector.

[0095] Step 32 Input feature transformation

[0096] The Transformer module structure includes a linear transformation layer, a 4-layer encoder consisting of 8 attention heads in each layer (the hidden layer dimension is 128), and an embedded similarity retrieval layer. The activation function is GELU. A quintic polynomial curve set is formed for the quintic polynomial curve basic candidate trajectory set, and a quintic Bezier curve set is formed for the quintic Bezier curve basic candidate trajectory set. The actual lane change trajectory is added to the corresponding curve set according to the curve type. The input vectors generated by the different curve set categories in step (1) are respectively passed through the linear transformation layer, and the linear mapping function is used to transform the input vector into a 128-dimensional vector and store it in different curve sets. The linear mapping function is expressed as follows:

[0097] F i =W linear ·r i +b

[0098] Among them, F i ∈R 128 The 128-dimensional vector after linear mapping is also called the embedding vector, r i is the input vector, W linear ∈R 128x11 is the weight matrix of the linear transformation, usually initialized randomly using normal distribution or uniform distribution, b∈R 128 is the bias term, which is usually initialized to 0;

[0099] Step 33 Feature pooling output

[0100] Embed the vector F of all trajectories in the set of quintic polynomial curves and the set of quintic Bezier curves i After inputting the Transformer encoder, a sequence output F is obtained feature , the formula is as follows:

[0101] [F1,F2,...,F n ]<Encoder function>F feature =[h1,h2,…,h n ]

[0102] Among them, F i ∈R 128 , h i is the 128-dimensional feature vector of the i-th position, h i ∈R 128 , n is the length of the input sequence;

[0103] Afterwards, the sequence is output to F according to the source of different curve sets. feature Divide into corresponding eigenvectors. Use the eigenvector set {F hisfive} represents the semantic information of lane-changing trajectories generated based on the set of quintic polynomial curves, and uses the feature vector set {Fhisbez} represents the semantic information of lane-changing trajectories generated based on the fifth-order Bezier curve set. Then, the star-marked * items are selected from each curve set, i.e., the actual lane-changing trajectories corresponding to each curve, and F is used to represent the semantic information of lane-changing trajectories generated based on the fifth-order Bezier curve set. turefive 、F turebez Representing the semantic information of the actual lane-changing trajectory;

[0104] Step 34: Similar scene matching and updated candidate trajectory set generation

[0105] Calculate and compare eigenvectors F in the feature space turefive 、F turebez With the feature vector set {F hisfive}、{F hisbez The Mahalanobis distance of each eigenvector in}. The eigenvector set {F hisfive}、{F hisbez} collectively referred to as F pred , the eigenvector F turefive 、F turebez Collectively referred to as F ture To facilitate the subsequent formula expression, the Mahalanobis distance formula is as follows:

[0106]

[0107] Among them, Σ is the covariance matrix of the basic candidate trajectory features, which is used to eliminate dimensional differences;

[0108] According to the Mahalanobis distance comparison results, the top 200 smaller curve sets in each curve set are selected as similar trajectories and used as the update candidate trajectory set.

[0109] In step 4, based on the updated candidate trajectory set generated in step 3, the final candidate trajectory set is generated by considering the motion characteristics of a single vehicle and the vehicle-to-vehicle interaction during the lane change process.

[0110] Step 41 Cycling motion feature constraints

[0111] The characteristics of bicycle motion use initial and terminal hard constraints and dynamic soft constraints:

[0112] The starting point position and heading angle constraint x(0)=0,

[0113] End position and heading angle constraints:

[0114] Lateral acceleration constraint:

[0115] Yaw rate constraint:

[0116] Among them, x is the longitudinal coordinate of the lane-changing vehicle, y is the lateral coordinate of the lane-changing vehicle, is the slope of the path (the tangent of the heading angle, dimensionless), is the derivative of the path slope, s y is the lateral acceleration, g is the acceleration due to gravity, is the yaw rate, i.e., the rotation rate of the vehicle around the axis perpendicular to the ground, v x is the longitudinal speed of the lane-changing vehicle;

[0117] Step 42: Vehicle-to-vehicle interaction constraints

[0118] The interaction with the vehicle in the target lane is mainly reflected in the collision avoidance constraint. The static obstacle of the vehicle in the target lane can be calculated and its bounding box constructed. The following constraints are used to ensure that the lane-changing vehicle maintains a safe distance from the obstacle:

[0119]

[0120] Among them, y(x) is the lateral coordinate of the lane-changing vehicle at position x, (x j ,y j ) is the position of the obstacle vehicle on the target lane, j is the number of the obstacle vehicle, L v 、W v is the length and width of the lane-changing vehicle, Δd safe =0.5m.

[0121] Step 5: Considering objectives such as traffic efficiency, safety, comfort, and smoothness, define evaluation indicators and assign weights to the indicators respectively to establish a multi-objective evaluation function.

[0122] Step 51: Define evaluation metrics

[0123] Evaluation indicators are defined by comprehensively considering the traffic efficiency, safety, comfort, and smoothness of the vehicle during lane changing. Among them, traffic efficiency is characterized by the length of the trajectory. The shorter the trajectory length, the shorter the time it takes for the vehicle to change lanes, and the shorter the impact on the surrounding normally moving vehicles. Safety is characterized by the maximum curvature of the vehicle's lane changing trajectory during the lane changing process. The smaller the maximum curvature of the vehicle's lane changing trajectory, the smaller the impact on the speed of surrounding vehicles. Comfort is characterized by the variance of the curvature change of the entire trajectory. The smaller the variance, the smaller the curvature fluctuation amplitude of the trajectory, the smaller the lateral acceleration, and the better the passenger riding experience. Smoothness is characterized by the phase angle change rate of the entire trajectory. The smaller the change rate, the smoother the trajectory and the better the stability. The formula for the evaluation indicator is as follows:

[0124] Traffic efficiency: track length Normalized to

[0125] Safety: Maximum curvature Normalized to

[0126] Comfort: Curvature variation

[0127] Smoothness: Phase angle change rate Δφ=|φ end -φ start |;

[0128] Among them, κ ref is the reference value of curvature, κ(x) is the curvature corresponding to the ordinate x on the lane-changing trajectory, is the average value of the curvature over the entire trajectory, φ end is the phase angle of the lane-changing trajectory end point, φ start is the phase angle of the starting point of the lane-changing trajectory;

[0129] Step 52: Construct evaluation function

[0130] Construct the evaluation function J according to step 51:

[0131] minJ=ω1L norm +ω2κ norm +ω3D(κ)+ω4Δφ

[0132] The dynamic weight adjustment rule is: when facing a congestion scene (vehicle speed v x <10m / s), ω1=0.2(efficiency), ω2=0.4(safety), ω3=0.3(comfort), ω4=0.1(smoothness); When facing high-speed scenes (vehicle speed v x ≥20m / s), ω1=0.4, ω2=0.3, ω3=0.2, ω4=0.

[0133] Step 6: Based on the evaluation function, calculate the evaluation function J values ​​of the actual lane-changing trajectory and the two final candidate trajectory sets. Then, sort the J values ​​of the final candidate trajectory sets in ascending order by curve category. Select the top ten trajectories in the final candidate trajectory sets for each of the two curves. Compare the J values ​​of the top ten trajectories in the final candidate trajectory sets for the two curves with the J values ​​of the actual lane-changing trajectory. Select the trajectory with the smallest evaluation function value as the optimal lane-changing trajectory for the two curves. Finally, select the trajectory with the smallest J value among the optimal lane-changing trajectories for the two curves as the global optimal lane-changing trajectory.

[0134] Step 61 outputs the final trajectory of each curve

[0135] Calculate the evaluation function J value of the actual lane-changing trajectory, denoted as J0, sort the trajectories in the two final candidate trajectory sets, calculate the performance index J value of the 200 trajectories generated under each lane-changing curve modeling, and sort them in ascending order to obtain the top ten trajectories. If the number of remaining valid trajectories after sorting is less than 5, the system will start the constraint relaxation strategy: gradually relax the safety distance Δdsafe The limit is reduced by 0.1m each time, with the lowest limit being 0.3m, and the top ten candidate trajectories in the final candidate trajectory set are regenerated accordingly;

[0136] Step 62 outputs the global optimal trajectory

[0137] Compare the J values ​​of the top ten trajectories in the final candidate trajectory set of the two curves with the actual lane-changing trajectory, and select the trajectory with the smallest J value as the optimal lane-changing trajectory under each curve, which are denoted as T five* 、T bezier* , and output its parameters With {P1 * ,P2 * ,P3 * ,P4 * Compare the optimal trajectory T five* 、T bezier* The J value is selected, the minimum value is selected, and its parameter value is output to obtain the global optimal trajectory.

[0138] The above steps describe the implementation process of the present invention in detail, but the present invention is not limited to the specific details of the above embodiments. Anything within the scope of the present invention should not be excluded from the scope of protection of the present invention.

Claims

1. A vehicle lane-changing trajectory planning method based on Transformer, characterized in that: The steps include: Step 1: Use onboard sensors and roadside sensors to obtain the vehicle state, target lane state, and road topology information at the time of the lane change. A rectangular coordinate system is established with the vehicle's lane change start position as the origin and the vehicle's forward direction as the positive y-axis. The vehicle's lane change trajectory is planned based on a quintic polynomial curve and a fifth-order Bezier curve, and the actual lane change trajectory is obtained. Step 2: Based on the two lane-changing trajectory curves in step 1, extract parameters of the two curves through Monte Carlo sampling to generate two corresponding basic candidate trajectory sets; Step 3: Based on the actual lane-changing trajectory generated in Step 1 and the basic candidate trajectory set generated in Step 2, the Transformer model is used to extract high-dimensional features of each trajectory parameter in the actual lane-changing trajectory and the basic candidate trajectory set. Efficient feature vector similarity retrieval is performed to find trajectories in the basic candidate set that are similar to the actual lane-changing trajectory. The updated candidate trajectory set is then output and generated. Step 4: Based on the updated candidate trajectory set generated in step 3, the single-vehicle motion characteristics and vehicle-to-vehicle motion interactions during the lane change process are considered. Maximum lateral acceleration and collision avoidance are used as critical conditions. Boundary constraints are applied to the updated candidate trajectory set to generate the final candidate trajectory set. Step 5: Considering objectives such as traffic efficiency, safety, comfort, and smoothness, define evaluation indicators and assign weights to each indicator to establish a multi-objective evaluation function; Step 6: Based on the final candidate trajectory set generated in step 4 and the evaluation function in step 5, calculate the evaluation function J values ​​of the actual lane-changing trajectory and the two final candidate trajectory sets. Sort the J values ​​of the final candidate trajectory sets in ascending order by curve category, select the top ten trajectories in the final candidate trajectory sets for each of the two curves, compare the J values ​​of the top ten trajectories in the final candidate trajectory sets for the two curves with the J values ​​of the actual lane-changing trajectory, and select the trajectory with the smallest evaluation function value as the optimal lane-changing trajectory for the two curves. Finally, select the trajectory with the smallest J value among the optimal lane-changing trajectories for the two curves as the global optimal lane-changing trajectory.

2. The method according to claim 1, wherein: In step 1, relevant information when the lane change occurs is obtained and the actual lane change trajectory is planned. The specific implementation steps are as follows: (1) Use onboard sensors and roadside sensors to obtain the vehicle state (speed v x , heading angle ψ, acceleration s), target lane vehicle status (position (x, y), speed v), road topology information (lane width w, lane change end point x f ); (2) Quintic polynomial curve: Since the lane-changing trajectory is often constrained by five points, in order to ensure the smoothness of the trajectory, the lane-changing trajectory equation is as follows: y(x)=a0+a1x+a2x 2 +a3x 3 +a4x 4 +a5x 5 Among them, x is the longitudinal displacement, a0=0, and the five unknown coefficients {a1, a2, a3, a4, a5} are obtained by the equations of the five key points of the trajectory and the direction change rate of the trajectory. Zero at the start and end points (i.e. )Sure; The equations for the five key points are as follows: Starting point: (x0, y0) = (0, 0), the starting point of the lane change, usually (0, 0); 1 / 4 trajectory point: Represents the initial transition stage of lane change. Midpoint: Halfway through the lane change process, 3 / 4 track points: Represents the adjustment phase at the end of lane change. End point: (x4,y4)=(x f ,y(x f )), which is the end point of the lane change. f is the longitudinal coordinate of the lane change endpoint. (3) Fifth-order Bezier curve: The lane-changing trajectory equation determined by the six control points {P0, P1, P2, P3, P4, P5} is as follows: in, x∈[0,x f ], the six control points are: the starting point of lane change P0 = (0,0), P1, P2, P3, P4 and the end point of lane change P5 = (x f ,y(x f )), P x,q 、P y,q are the horizontal and vertical coordinates of the control point, q∈{0,1,2,3,4,5}; The longitudinal distribution constraint and curvature continuity constraint of the fifth-order Bezier curve are: Longitudinal distribution constraint: the longitudinal spacing between adjacent control points Δx≤x f / 5, that is q∈{0,1,2,3,4,5}; Curvature continuity constraint: the second-order derivative is zero at the starting and end points, that is, (4) Based on the above two lane-changing trajectory curves, the actual lane-changing trajectories under different curve modeling are obtained respectively.

3. The method according to claim 1, wherein: In step 2, a basic candidate set of fifth-order polynomial curves and fifth-order Bezier curves is generated. The specific implementation steps are as follows: For the quintic polynomial curve, Monte Carlo sampling was used to uniformly extract 1000 sets of parameters by randomly perturbing the y values ​​{y1, y2, y3} of three key points along the trajectory. For the fifth-order Bezier curve, Monte Carlo sampling was used to randomly perturb the longitudinal offsets of the intermediate control points {P1, P2, P3, P4}, generating 1000 sets of parameter combinations. The trajectories formed by these 1000 parameter combinations were used as the candidate trajectories for the two corresponding curves.

4. The method according to claim 1, wherein: In step 3, the Transformer model extracts high-dimensional features from different trajectory parameters. The encoder processes the input sequence to obtain a feature representation of the vehicle's lane-changing trajectory. The Mahalanobis distance is then calculated in the feature space to quickly identify candidate base trajectories similar to the actual lane-changing trajectory and generate an updated set of candidate trajectories. Smaller Mahalanobis distance values ​​indicate greater similarity. The specific implementation steps are as follows: (1) Data preprocessing: To extract high-dimensional features of different trajectory parameters and ensure that all features can be effectively extracted. First, the input features are filtered to retain only important and representative features to avoid redundant information affecting model performance. The parameters that should be input for all trajectories are speed v, acceleration s, and the longitudinal coordinate x of the lane change endpoint. f In addition, for the fifth-order polynomial curve, the input data should also include the parameters {a1, a2, a3, a4, a5} and the y coordinates of the three key points of the trajectory process; for the fifth-order Bezier curve, the input data should also include the coordinates of the control points {P1, P2, P3, P4}; Therefore, for a fifth-degree polynomial curve, the input vector r i It can be written as {v,s,x f ,a1,a2,a3,a4,a5,y1,y2,y3}; For the fifth-order Bezier curve, the input vector r i It can be written as {v,s,x f ,P 1x ,P 2x ,P 3x ,P 4x ,P 1y ,P 2y ,P 3y ,P 4y }; Next, for the actual lane-changing trajectory, determine the curve type used and, based on the input vector format described previously, mark the relevant parameters with asterisks* and write out the corresponding input vector. (2) Input feature transformation: The Transformer module structure includes a linear transformation layer, a 4-layer encoder consisting of 8 attention heads in each layer (the hidden layer dimension is 128), and an embedded similarity retrieval layer. The activation function is GELU. A quintic polynomial curve set is formed for the quintic polynomial curve basic candidate trajectory set, and a quintic Bezier curve set is formed for the quintic Bezier curve basic candidate trajectory set. The actual lane change trajectory is added to the corresponding curve set according to the curve type. The input vectors generated by the different curve set categories in step (1) are respectively passed through the linear transformation layer, and the linear mapping function is used to transform the input vector into a 128-dimensional vector and store it in different curve sets. The linear mapping function is expressed as follows: F i =W linear ·r i +b Among them, F i ∈R 128 The 128-dimensional vector after linear mapping is also called the embedding vector, r i is the input vector, W linear ∈R 128x11 is the weight matrix of the linear transformation, usually initialized randomly using normal distribution or uniform distribution, b∈R 128 is the bias term, which is usually initialized to 0; (3) Feature pooling output: embedding vector F of all trajectories in the set of fifth-order polynomial curves and fifth-order Bezier curves i After inputting the Transformer encoder, a sequence output F is obtained feature , the formula is as follows: [F1,F2,...,F n <Encoder function>F feature =[h1,h2,…,h n ​ Among them, F i ∈R 128 , h i is the 128-dimensional feature vector of the i-th position, h i ∈R 128 , n is the length of the input sequence; Afterwards, the sequence is output to F according to the source of different curve sets. feature Divide into corresponding eigenvectors. Use the eigenvector set {F hisfive } represents the semantic information of lane-changing trajectories generated based on the set of quintic polynomial curves, and uses the feature vector set {F hisbez } represents the semantic information of lane-changing trajectories generated based on the fifth-order Bezier curve set. Then, the star-marked * items are selected from each curve set, i.e., the actual lane-changing trajectories corresponding to each curve, and F is used to represent the semantic information of lane-changing trajectories generated based on the fifth-order Bezier curve set. turefive 、F turebez Representing the semantic information of the actual lane-changing trajectory; (4) Similar scene matching and updated candidate trajectory set generation: Calculate and compare the feature vector F in the feature space turefive 、F turebez With the feature vector set {F hisfive }、{F hisbez The Mahalanobis distance of each eigenvector in}. The eigenvector set {F hisfive }、{F hisbez } collectively referred to as F pred , the eigenvector F turefive 、F turebez Collectively referred to as F ture To facilitate the subsequent formula expression, the Mahalanobis distance formula is as follows: Among them, Σ is the covariance matrix of the basic candidate trajectory features, which is used to eliminate dimensional differences; According to the Mahalanobis distance comparison results, the top 200 smaller curve sets in each curve set are selected as similar trajectories and used as the update candidate trajectory set.

5. The method according to claim 1, wherein: In step 4, the single-vehicle motion characteristics and vehicle-to-vehicle motion interactions during the lane change process are considered to generate the final candidate trajectory set. The specific implementation steps are as follows: (1) For the motion characteristics of a bicycle, initial and terminal hard constraints and dynamic soft constraints are adopted: Starting point position and heading angle constraints End position and heading angle constraints: Lateral acceleration constraint: Yaw rate constraint: Among them, x is the longitudinal coordinate of the lane-changing vehicle, y is the lateral coordinate of the lane-changing vehicle, is the slope of the path (the tangent of the heading angle, dimensionless), is the derivative of the path slope, s y is the lateral acceleration, g is the acceleration due to gravity, is the yaw rate, i.e., the rotation rate of the vehicle around the axis perpendicular to the ground, v x is the longitudinal speed of the lane-changing vehicle; (2) The interaction with the vehicle in the target lane is mainly reflected in the collision avoidance constraint. The static obstacle of the vehicle in the target lane can be calculated and its bounding box can be constructed. The following constraints are used to ensure that the lane-changing vehicle maintains a safe distance from the obstacle: Among them, y(x) is the lateral coordinate of the lane-changing vehicle at position x, (x j ,y j ) is the position of the obstacle vehicle on the target lane, j is the number of the obstacle vehicle, L v 、W v is the length and width of the lane-changing vehicle, Δd safe =0.5m.

6. The method according to claim 1, wherein: In step 5, the objectives of traffic efficiency, safety, comfort, smoothness, etc. are considered to establish a multi-objective evaluation function. The specific implementation steps are as follows: (1) Comprehensively consider the traffic efficiency, safety, comfort, and smoothness of the vehicle during lane changing, and define the evaluation indicators. Among them, traffic efficiency is characterized by the trajectory length. The shorter the trajectory length, the shorter the time it takes for the vehicle to change lanes, and the shorter the time it affects the surrounding normally moving vehicles; safety is characterized by the maximum curvature of the vehicle's lane changing trajectory during the lane changing process. The smaller the maximum curvature of the vehicle's lane changing trajectory, the smaller the impact on the speed of surrounding vehicles; comfort is characterized by the variance of the curvature change of the entire trajectory. The smaller the variance, the smaller the curvature fluctuation amplitude of the trajectory, the smaller the lateral acceleration, and the better the passenger riding experience; smoothness is characterized by the phase angle change rate of the entire trajectory. The smaller the change rate, the smoother the trajectory and the better the stability. The formula of the evaluation indicator is as follows: Traffic efficiency: track length Normalized to Safety: Maximum curvature Normalized to Comfort: Curvature variation Smoothness: Phase angle change rate Δφ=|φ end -φ start |; Among them, κ ref is the reference value of curvature, κ(x) is the curvature corresponding to the ordinate x on the lane-changing trajectory, is the average value of the curvature over the entire trajectory, φ end is the phase angle of the lane-changing trajectory end point, φ start is the phase angle of the starting point of the lane-changing trajectory; (2) According to the above, the evaluation function J can be obtained: minJ=ω1L norm +ω2k norm +ω3D(κ)+ω4Δφ The dynamic weight adjustment rule is: when facing a congestion scene (vehicle speed v x <10m / s), ω1=0.2(efficiency), ω2=0.4(safety), ω3=0.3(comfort), ω4=0.1(smoothness); When facing high-speed scenes (vehicle speed v x ≥20m / s), ω1=0.4, ω2=0.3, ω3=0.2, ω4=0.

7. The method according to claim 1, wherein: In step 6, based on the final candidate trajectory set generated in step 4 and the evaluation function in step 5, the trajectory with the smallest evaluation function value is selected as the global optimal lane change trajectory. The specific implementation steps are as follows: (1) Calculate the evaluation function J value of the actual lane-changing trajectory, denoted as J0, sort the trajectories in the two final candidate trajectory sets, calculate the performance index J value of the 200 trajectories generated under each lane-changing curve modeling, and sort them in ascending order to obtain the top ten trajectories. If the number of remaining valid trajectories after sorting is less than 5, the system will start the constraint relaxation strategy: gradually relax the safety distance Δd safe The limit is reduced by 0.1m each time, with the lowest limit being 0.3m, and the top ten candidate trajectories in the final candidate trajectory set are regenerated accordingly; (2) Compare the actual lane-changing trajectory of each curve with the J values ​​of the top ten trajectories in the final candidate trajectory set, and select the trajectory with the smallest J value as the optimal lane-changing trajectory under each curve, which are denoted as T five* 、T bezier* , and output its parameters With {P1 * ,P2 * ,P3 * ,P4 * }; (3) Comparison of the optimal trajectory T of two different lane-changing curves five* 、T bezier* The J value is selected, the minimum value is selected, and its parameter value is output to obtain the global optimal trajectory.

Citation Information

Cited By

  • Hybrid decision arbitration method and system based on automatic driving

    CN121246855A