Trajectory planning method, computer device, readable storage medium and motor vehicle
By combining a neural network with a trajectory planning method that combines vehicle yaw angular velocity and vehicle speed, the problem of insufficient vehicle kinematic characteristics in existing technologies is solved, a softer trajectory planning is achieved, and the comfort and safety of autonomous driving are improved.
Patent Information
- Application Number
- CN202211696418.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-12-28
AI Technical Summary
Existing autonomous driving trajectory planning methods cannot effectively guarantee the vehicle's kinematic characteristics, resulting in discontinuous path curvature and uneven speed curve, causing problems such as vehicle steering wheel jitter and sudden acceleration and deceleration.
A neural network is used in combination with the vehicle's yaw rate and speed. Through the conversion between Cartesian coordinate system and Frenet coordinate system, trajectory planning is optimized to construct a trajectory that conforms to the vehicle's kinematic characteristics. The neural network parameters are optimized through gradient back propagation.
It improves the comfort and safety of drivers and passengers, avoids the problems of discontinuous path curvature and uneven speed curve, and enhances the softness and adaptability of the trajectory.
Smart Images

Figure CN115930985B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a trajectory planning method, computer equipment, a readable storage medium, and a motor vehicle. Background Art
[0002] In recent years, autonomous driving technology has developed rapidly. Autonomous driving technology can generally be divided into three components: the perception module, the decision-making and planning module, and the control module. The perception module obtains information about the vehicle's surrounding environment, extracts effective features, and transmits them to the decision-making and planning module. Based on the information obtained by the perception module, the decision-making and planning module generates a local trajectory that meets the global objective and sends it to the control module. The control module controls the vehicle's speed and front wheel steering angle to track the planned trajectory, thereby achieving vehicle driving. It can be seen that the results of trajectory planning directly affect the trajectory tracking of the control module. If the trajectory planned by the decision-making and planning module is unreasonable, it will cause problems such as vehicle steering wheel jitter caused by discontinuous curvature of the planned path and sudden acceleration and deceleration of the vehicle caused by an uneven speed curve. In existing technologies, autonomous driving trajectory planning is divided into path planning and speed planning, which are solved separately and then combined, affecting the coupling relationship between the vehicle's front wheel steering angle and vehicle speed. Existing three-dimensional solution methods are computationally complex. Existing local trajectory planning methods, such as those based on curve interpolation and function optimization, use curve types such as polynomial curves, spline curves, and Bezier curves. However, none of them can fully guarantee the high-order differentiability of their curvature and the zero curvature at the initial point. Therefore, they cannot ensure that the planned trajectory satisfies the kinematic characteristics of the vehicle. Summary of the Invention
[0003] To solve the aforementioned problems, the present invention provides a trajectory planning method, in which the planned trajectory conforms to the kinematic and dynamic characteristics of the vehicle, ensuring the vehicle's driving safety while improving comfort.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] A trajectory planning method for planning a driving trajectory during automatic driving of a vehicle comprises the following steps:
[0006] The target point for planning the driving trajectory is selected based on the information of the surrounding vehicles; the driving trajectory is planned based on the status of the selected target point and the current status of the vehicle.
[0007] Optionally, planning a driving trajectory based on the state of the selected target point and the current state of the vehicle includes the following steps:
[0008] Input road information, the current state of the ego vehicle, and the state of the target point into the neural network. Road information includes the polynomial coefficients of the left and right lane lines. The current state of the ego vehicle includes the normalized current speed, the lateral offset between the current position of the ego vehicle and the lane centerline, and the angle between the line connecting the current and previous positions of the ego vehicle and the current body of the vehicle. The state of the target point includes the position of the target point, the speed of the target point, and the yaw angle of the target point.
[0009] The neural network outputs the following parameters: first weighting coefficient α1, first mean μ1, first variance σ1, second mean μ2, second variance σ2, lateral scaling coefficient a, and lateral offset coefficient b, where the first variance σ1 and the second variance σ2 are scaled by the Sigmoid function;
[0010] The second weighting coefficient α2 is obtained based on the first weighting coefficient α1 and the yaw angle of the target point. The yaw rate function and the speed function of the vehicle are obtained based on the parameters output by the neural network. The second weighting coefficient α2 is:
[0011]
[0012] in, is the yaw angle of the target point;
[0013] The yaw rate function of the vehicle is:
[0014]
[0015] The velocity function of the vehicle is:
[0016]
[0017] Where t is time, t∈[0,n], v goal is the speed of the target point, v current is the current speed of the vehicle;
[0018] The yaw rate function of the ego vehicle is discretized uniformly into m points in the time interval [0, n] seconds. The approximate yaw angle change of the ego vehicle at the corresponding moment of each point is calculated according to the following formula:
[0019]
[0020] Calculate the approximate displacement r of the vehicle at each point at the corresponding moment according to the following formula: i :
[0021]
[0022] Based on the approximate value of the yaw angle change of the vehicle and displacement approximation ri , calculate the coordinates of each point in m points (x i ,y i ), and get the driving trajectory:
[0023]
[0024] Among them, x current is the x-axis coordinate of the current position of the vehicle, y current is the y-axis coordinate of the vehicle's current position.
[0025] Optionally, the neural network has at least two hidden layers, and the number of neurons in each hidden layer is 256; the hidden layer adopts a ReLU nonlinear activation function, and the output layer of the neural network adopts a Tanh nonlinear activation function.
[0026] Optionally, the polynomial for the left lane line is:
[0027]
[0028] Among them, lan Coeffs left is the coefficient of the polynomial of the left lane line, and q is the degree of the polynomial of the left lane line;
[0029] The polynomial for the right lane line is:
[0030]
[0031] Among them, lan Coeffs right are the coefficients of the polynomial of the right lane line, and the degree of the polynomial of the right lane line is equal to that of the left lane line.
[0032] Optionally, the ego vehicle obtains vehicle information in the detection area around the ego vehicle. When there is no vehicle in front of the ego vehicle lane, the ego vehicle cruises and the state of the target point is:
[0033]
[0034] Among them, (x goal ,y goal ) is the position of the target point, y lanCenter is the polynomial of the lane centerline; is the yaw angle of the target point, n·v current The current speed of the vehicle is the position after it travels along the center line of the lane for n seconds;
[0035] When there is a vehicle in front of the vehicle, the left lane marking is not an edge lane marking, and there are no vehicles in the left lane or behind the vehicle in the detection area, the vehicle changes lanes to the left. When the right lane marking is not an edge lane marking, and there are no vehicles in the right lane or behind the vehicle in the detection area, the vehicle changes lanes to the right. After the vehicle changes lanes to the left or right, the status of the target point is:
[0036]
[0037] Among them, w lane is the road width;
[0038] When there is a vehicle in front of the ego vehicle's lane, or the left lane marking is an edge lane marking and there is a vehicle in front of or behind the right lane in the detection area, or the right lane marking is an edge lane marking and there is a vehicle in front of or behind the left lane in the detection area, and the ego vehicle follows the vehicle in front of it, the target point status is:
[0039]
[0040] Among them, v obstacel_vehicle is the speed of the vehicle in front of the vehicle.
[0041] Compared to existing technologies that construct trajectories using x, y or s, l, the technical solution provided by this invention uses the vehicle's own yaw rate and speed to construct trajectories. This constructed trajectory better adapts to the vehicle's kinematic characteristics, making the trajectory smoother and avoiding steering wheel jitter caused by discontinuous curvature in the planned path, as well as sudden acceleration and deceleration caused by an uneven speed curve, thereby improving driver and passenger comfort. Furthermore, this invention optimizes the coupling between the vehicle's yaw rate function and the vehicle's speed function through a neural network, ensuring the coupling between the vehicle's yaw rate and speed, preventing sudden steering turns at high speeds. This not only ensures driver and passenger safety, but also enhances their comfort from another perspective.
[0042] Optionally, the trajectory planning method further includes training a neural network, and the training of the neural network includes the following steps:
[0043] The position of the target point is used as the label position, and the first loss function loss1 is obtained by the mean square error
[0044] loss1=(x n -x goal ) 2 +(y n -y goal ) 2
[0045] Among them, x n is the x-axis coordinate of each point after being uniformly discretized into m points in the time interval [0,n] seconds,n is the y-axis coordinate of each point after being uniformly discretized into m points in the time interval [0,n] seconds;
[0046] When the vehicle is cruising or following the vehicle ahead, the y-axis coordinate corresponding to the x-axis coordinate of each point is calculated using the lane centerline polynomial, and the corresponding y-axis coordinate is used as the y-direction label;
[0047] When the vehicle changes lanes to the left, the first half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate, and the corresponding y-axis coordinate is used as the y-direction label. The second half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate and add the lane width as the y-direction label.
[0048] When the vehicle changes lanes to the right, the first half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate, and the corresponding y-axis coordinate is used as the y-axis label. The second half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate and subtract the lane width as the y-axis label.
[0049] The mean square error between the y-axis coordinate and the y-direction label of each point is used as the second loss function loss2
[0050]
[0051] in, The y-direction label for each point;
[0052] The third loss function loss3 is calculated according to the following formula
[0053]
[0054] in, is the approximate value of the yaw angle change of the ego vehicle corresponding to time 0 after being uniformly discretized into m points in the time interval [0,n] seconds. θ0 is the angle between the current and previous position points of the ego vehicle and the current body of the vehicle.
[0055] The weighted sum of the first loss function, the second loss function, and the third loss function is used as the loss function to optimize the neural network parameters:
[0056]
[0057] Among them, W1 is the weight of the first loss function, W2 is the weight of the second loss function, and W3 is the weight of the third loss function.
[0058] Optionally, when training the neural network, gradient backpropagation is used to optimize the parameters of the neural network.
[0059] The present invention has the following beneficial effects:
[0060] The technical solution provided by the present invention constructs a trajectory from the vehicle's yaw angular velocity and speed, and constructs a loss function in a Cartesian coordinate system for constraint, thereby enhancing adaptability to lane lines and avoiding sudden lane changes. At the same time, by continuously optimizing and training the parameters of the neural network, the planned route not only meets safety requirements, but also becomes increasingly comfortable as the usage time increases.
[0061] At the same time, the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.
[0062] Furthermore, the present invention further provides a motor vehicle having an automatic driving function, wherein when the motor vehicle operates the automatic driving function, the automatic driving trajectory of the motor vehicle is planned by using any one of the trajectory planning methods described above;
[0063] or the motor vehicle has the aforementioned computer device;
[0064] Or the motor vehicle has the aforementioned computer-readable storage medium, and when the computer program is executed by a processor, any one of the aforementioned trajectory planning methods is implemented.
[0065] These features and advantages of the present invention will be further disclosed in the following detailed description and accompanying drawings. The preferred embodiments and means of the present invention will be fully illustrated in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. Furthermore, although multiple features, elements, and components may be present in each of the following text and accompanying drawings, they may be labeled with different symbols or numbers for convenience, but all represent components with the same or similar structure or function. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The present invention will be further described below in conjunction with the accompanying drawings:
[0067] Figure 1 is a schematic diagram of a target point in an embodiment of the present invention;
[0068] Figure 2 is a schematic diagram of a neural network in an embodiment of the present invention;
[0069] Figure 3 Schematic diagram of trajectory solution in an embodiment of the present invention. DETAILED DESCRIPTION
[0070] The following is an explanation and description of the technical solutions of the embodiments of the present invention in conjunction with the drawings of the embodiments of the present invention. However, the following embodiments are only preferred embodiments of the present invention and are not exhaustive. Based on the embodiments in the implementation manner, other embodiments obtained by those skilled in the art without creative work are all within the scope of protection of the present invention.
[0071] Reference in this specification to "one embodiment," "an example," or "an example" means that a particular feature, structure, or characteristic described in connection with the embodiment itself can be included in at least one embodiment of the present patent disclosure. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment.
[0072] Example:
[0073] This embodiment provides a trajectory planning method for planning a driving trajectory during autonomous driving. The driving trajectory is constructed using the vehicle's own yaw angular velocity and speed. The method is particularly suitable for trajectory planning for cruising on straight roads, curves, following a vehicle, and changing lanes left or right.
[0074] The trajectory planning method provided in this embodiment includes the following steps:
[0075] The target points for planning the driving trajectory are selected based on the information of surrounding vehicles, and the driving trajectory is planned based on the status of the selected target points and the current status of the vehicle.
[0076] Specifically, the information of surrounding vehicles includes road information, which specifically includes the polynomial of the left lane line and its polynomial coefficients and the polynomial of the right lane line and its polynomial coefficients. In other embodiments, it is also necessary to obtain a judgment flag isEdge indicating whether it is an edge lane line. left 、isEdge right Among them, the polynomial of the left lane line is:
[0077]
[0078] Among them, lan Coeffs left is the coefficient of the polynomial of the left lane line, and q is the degree of the polynomial of the left lane line;
[0079] The polynomial for the right lane line is:
[0080]
[0081] Among them, lan Coeffs rightare the coefficients of the polynomial for the right lane marking. The degree of the polynomial for the right lane marking is equal to that for the left lane marking. In this embodiment, the polynomials for the left and right lane markings are preferably quintic polynomials. Therefore, in this embodiment, q = 5. In other embodiments, the coefficients of the polynomials can be flexibly selected by those skilled in the art based on actual circumstances and are not limited here.
[0082] The polynomial for the lane centerline is obtained based on the coefficients of the polynomials for the left lane line and the right lane line. Since the polynomials for the left lane line and the right lane line are both 5th-degree polynomials, the polynomial for the lane centerline is also 5th-degree:
[0083]
[0084] The vehicle then uses vision or radar to obtain information about vehicles in the detection area surrounding it, and stores their position and speed information. In this embodiment, the detection area is defined as the nearest vehicles within 80 meters to the left, front, and right of the vehicle, and within 15 meters to the left, rear, and right of the vehicle. In other embodiments, the detection area can be calibrated by those skilled in the art during vehicle adjustments, and this is not a limitation here.
[0085] According to the relationship between the Cartesian coordinate system and the Frenet coordinate system, solve the function of their mutual conversion, including the function of transforming the point coordinates in the Cartesian space to the point coordinates in the Frenet space:
[0086] (s,l)=CartesionToFrenet(x,y)
[0087] And the function of converting the point coordinates in Frenet space to the point coordinates in Cartesian space:
[0088] (x,y)=CartesionToFrenet(s,l)
[0089] The Cartesian coordinate system contains the curvature information of the lane line, but in planning, it is impossible to constrain the trajectory curve by directly expressing the change law of the curvature. The trajectory planned in the Frenet coordinate system can constrain the curvature, but it eliminates the curvature information of the lane line. When converted to the Cartesian coordinate system after optimization, the original curvature constraint may be destroyed. Therefore, this embodiment generates a trajectory through the change law of the vehicle's yaw angular velocity and the change law of the vehicle speed. The function parameters are solved by constraining the trajectory in Cartesian space and taking the position in Cartesian coordinates as the optimization target. The constructed trajectory is more adapted to the kinematic characteristics of the vehicle, making the trajectory softer.
[0090] like Figure 1As shown in the figure, different judgments are made for vehicle 1 based on the conditions of different vehicles in the detection area, and the state of the target point is obtained based on the judgments made. The state of the target point includes the position of the target point, the speed of the target point, and the yaw angle of the target point. The specific states of the target point under different judgments are as follows:
[0091] When there is no vehicle ahead in the lane of ego vehicle 1, ego vehicle 1 cruises. The position after n seconds of driving along the centerline of the lane at the current speed of ego vehicle 1 is used as the target position, and the tangent direction of the lane centerline at this point is used as the target yaw angle. The target speed is the minimum of 1.01 times the current speed of ego vehicle 1 and the set maximum speed. The state of the target point at this time is:
[0092]
[0093] Among them, (x goal ,y goal ) is the position of the target point, is the yaw angle of the target point, v goal is the speed of the target point, v current is the current speed of vehicle 1, and n is the time to select the target point. As mentioned above, in this embodiment, the position after 3 seconds is preferably used as the target point, so n = 3. Furthermore, since the polynomials for the left and right lane markings are both 5th-degree polynomials, the polynomial for the lane centerline is also 5th-degree, i.e., q = 5.
[0094] When there is a vehicle in front of the lane of ego vehicle 1, the left lane line is not an edge lane line, and there are no obstructed vehicles in front and behind the left lane in the detection area, ego vehicle 1 changes lanes to the left; when the right lane line is not an edge lane line, and there are no obstructed vehicles in front and behind the right lane in the detection area, the vehicle changes lanes to the right. In this embodiment, when there is a vehicle in front of the lane of ego vehicle 1 and the distance between ego vehicle 1 and the front vehicle is less than or equal to 50 meters, the above judgment is enabled. In other embodiments, the distance between ego vehicle 1 and the front vehicle can be flexibly selected by those skilled in the art and is not limited here. After the vehicle changes lanes to the left or right, the position after driving along the center line of the lane at the current speed for n seconds is offset to the left or right by one lane width as the target position, and the tangent direction of the lane center line at this point is used as the target yaw angle, and the current vehicle speed is used as the target vehicle speed. The state of the target point at this time is:
[0095]
[0096] Among them, w lane is the road width.
[0097] When there is a vehicle in front of the lane of ego vehicle 1, or the left lane line is an edge lane line and there is an obstacle vehicle 2 in front of or behind the right lane in the detection area, or the right lane line is an edge lane line and there is an obstacle vehicle 3 in front of or behind the left lane in the detection area, ego vehicle 1 follows the vehicle in front of ego vehicle 1. In this embodiment, when there is a vehicle in front of the lane of ego vehicle 1 and the distance between ego vehicle 1 and the front vehicle is less than or equal to 50 meters, the above judgment is enabled, so that ego vehicle 1 follows the vehicle in front of ego vehicle 1. The position of the vehicle in front of ego vehicle 1 after traveling along the center line of the lane at its current speed for n seconds minus 35m along the center line of the lane is used as the target position, and the tangent direction of the center line of the lane at this point is used as the target yaw angle, and 0.99 times the speed of the obstacle vehicle is used as the target speed. The state of the target point at this time is:
[0098]
[0099] Among them, v obstacel_vehicle is the speed of the vehicle in front of vehicle 1.
[0100] In this embodiment, those skilled in the art should anticipate that, when making the above judgments based on surrounding vehicles, the following preferences are preferred: 1.01 times the current speed of vehicle 1 when cruising, 0.99 times the speed of the obstacle vehicle when following the vehicle ahead of vehicle 1, and the position along the lane centerline minus 35 meters when following the vehicle ahead of vehicle 1. Other numerical values of the aforementioned physical quantities, determined by those skilled in the art based on actual conditions when calibrating the vehicle, can also solve the problem addressed by this embodiment, conform to the inventive concept of this embodiment, and achieve the same technical effects as this embodiment.
[0101] Then the aforementioned road information, the current state of the vehicle 1, and the state of the target point are input into the neural network. Figure 2 As shown, in this embodiment, the neural network has at least two hidden layers, each containing 256 neurons. The hidden layers use the ReLU nonlinear activation function, and the output layer of the neural network uses the Tanh nonlinear activation function. Neural networks are those generally used in the art and will not be described in detail here. This embodiment uses a neural network to couple and optimize the vehicle's yaw rate function and speed function, ensuring the coupling between the vehicle's yaw rate and speed, preventing sudden steering at high speeds. This not only ensures driver and passenger safety, but also enhances their comfort from another perspective.
[0102] The current state of vehicle 1 includes the normalized current speed, the lateral offset between vehicle 1's current position and the lane centerline, and the angle between the line connecting vehicle 1's current and previous positions and the current vehicle body. The neural network outputs the following parameters: first weighting coefficient α1, first mean μ1, first variance σ1, second mean μ2, second variance σ2, lateral scaling coefficient a, and lateral offset coefficient b. The first variance σ1 and the second variance σ2 are scaled using a Sigmoid function.
[0103] The second weighting coefficient α2 is obtained based on the first weighting coefficient α1 and the yaw angle of the target point. The yaw rate function of vehicle 1 and the speed function of vehicle 1 are obtained based on the parameters output by the neural network. The second weighting coefficient α2 is:
[0104]
[0105] The yaw rate function of vehicle 1 is:
[0106]
[0107] The velocity function of vehicle 1 is:
[0108]
[0109] Here, t is time, t∈[0,n], and the position after 3 seconds is preferably used as the position of the target point, so n=3.
[0110] The yaw rate function of vehicle 1 is discretized into m points uniformly in the time interval [0,3] seconds. The yaw angle change of vehicle 1 at the corresponding moment of each point is calculated according to the following formula:
[0111]
[0112] Calculate the approximate displacement r of vehicle 1 at each point at the corresponding moment according to the following formula: i :
[0113]
[0114] In this embodiment, the time interval [0, 3] seconds is evenly discretized into 30 points. Therefore, specifically in this embodiment,
[0115] The approximate value of the yaw angle change of vehicle 1 at the corresponding moment of each point for:
[0116]
[0117] The approximate displacement value R of vehicle 1 at the corresponding moment of each point i for:
[0118]
[0119] Based on the approximate value of the yaw angle change of vehicle 1 and displacement approximation R i , calculate the coordinates of each point in m points (X i ,y i ), and the driving trajectory is obtained. The coordinate system is established based on the body of the vehicle, so x current =0,y current =0, The time 0 mentioned above and below refers to the origin of the coordinates. The trajectory planning is as follows Figure 3 It should be noted that in this embodiment Figure 3 , is only a schematic diagram of the trajectory solution from time 0 to the next time. The points at each time are smoothly connected to form the trajectory planned by the trajectory method provided in this embodiment.
[0120]
[0121] Where m = 30, x current is the x-axis coordinate of the current position of vehicle 1, y current is the y-axis coordinate of the current position of vehicle 1.
[0122] Prior art methods for autonomous driving trajectory planning generally rely on curve interpolation and function optimization, using curve types such as polynomials, splines, and Bezier curves. However, these methods cannot fully guarantee the high-order differentiability of their curvature or the zero curvature of their initial points. Therefore, the planned trajectory cannot guarantee that it satisfies the vehicle's kinematic characteristics. The trajectory planning method provided in this embodiment, compared to prior art methods that construct trajectories using x, y or s, l, uses the vehicle's own yaw rate and speed to construct a trajectory. This constructed trajectory better adapts to the vehicle's kinematic characteristics, making the trajectory smoother and avoiding steering wheel vibration caused by discontinuous curvature in the planned path, as well as sudden acceleration and deceleration caused by an uneven velocity curve, thereby improving driver and passenger comfort.
[0123] To continuously improve the rationality of autonomous driving trajectory planning and enhance the driver and passenger experience, the trajectory planning method provided in this embodiment also includes training the neural network. It should be noted that the steps involved in training the neural network are only enabled during network training and are not enabled during trajectory planning.
[0124] Training a neural network involves the following steps:
[0125] The position of the target point is used as the label position, and the first loss function loss1 is obtained by the mean square error
[0126] loss1=(x n -x goal ) 2 +(y n -y goal ) 2
[0127] Among them, x n is the x-axis coordinate of each point after being uniformly discretized into m points in the time interval [0,n] seconds, n is the y-axis coordinate of each point after being uniformly discretized into m points in the time interval [0,n] seconds.
[0128] Since n is 3 in this embodiment and is evenly discretized into 30 points in the time interval [0,3] seconds, specifically in this embodiment,
[0129] loss1=(x 30 -x goal ) 2 +(y 30 -y goal ) 2
[0130] Then calculate the second loss function loss2. Due to the different states of the target points, the calculation of the second loss function loss2 is also different, as follows:
[0131] When the vehicle is cruising or following the vehicle ahead, the y-axis coordinate corresponding to the x-axis coordinate of each point is calculated using the lane centerline polynomial, and the corresponding y-axis coordinate is used as the y-direction label;
[0132] When the vehicle changes lanes to the left, the first half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point, and the corresponding y-axis coordinate is used as the y-axis label. The second half is calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point, and the lane width is added as the y-axis label. The mean square error between the y-axis coordinate of each point and the y-axis label is calculated.
[0133] When the vehicle changes lanes to the right, the first half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate, and the corresponding y-axis coordinate is used as the y-axis label. The second half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate and subtract the lane width as the y-axis label.
[0134] The mean square error between the y-axis coordinate and the y-direction label of each point is used as the second loss function loss2
[0135]
[0136] in, is the y-axis label of each point. Specifically in this embodiment:
[0137] The third loss function loss3 is calculated according to the following formula
[0138]
[0139] in, is the approximate value of the yaw angle change of the ego vehicle at time 0 after being uniformly discretized into m points in the time interval [0,n] seconds, and θ0 is the angle between the line connecting the current and previous position points of the ego vehicle and the current body.
[0140] The weighted sum of the first loss function, the second loss function, and the third loss function is used as the loss function, and the gradient back propagation is used to optimize the parameters of the neural network:
[0141]
[0142] Specifically in this embodiment, w1 takes a value of 0.1, w2 takes a value of 0.2, and w3 takes a value of 0.7:
[0143] loss=0.1loss1+0.2loss2+0.7loss3
[0144] While constructing the trajectory from the vehicle's yaw rate and speed, a loss function is constructed in the Cartesian coordinate system for constraint, enhancing adaptability to lane lines and avoiding sudden lane changes. At the same time, by continuously optimizing and training the parameters of the neural network, the planned route not only meets safety requirements, but also becomes increasingly comfortable as time goes by.
[0145] At the same time, this embodiment also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned trajectory planning method.
[0146] It will be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can implement the method of any of the above-mentioned embodiments when executed. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0147] Furthermore, this embodiment further provides a motor vehicle having an automatic driving function. When the motor vehicle provided by this embodiment operates the automatic driving function, the automatic driving trajectory of the vehicle is planned using the aforementioned trajectory planning method.
[0148] or the motor vehicle has the aforementioned computer equipment;
[0149] Or the motor vehicle has the aforementioned computer-readable storage medium, and the aforementioned trajectory planning method is implemented when the computer program is executed by the processor.
[0150] The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modifications that do not deviate from the functional and structural principles of the present invention are intended to be included within the scope of the claims.
Claims
1. A trajectory planning method for planning a driving trajectory during automatic vehicle driving, characterized in that: The trajectory planning method includes the following steps: selecting a target point for planning a driving trajectory based on information about surrounding vehicles; planning a driving trajectory based on the state of the selected target point and the current state of the vehicle; planning a driving trajectory based on the state of the selected target point and the current state of the vehicle includes the following steps: Input road information, the current state of the ego vehicle, and the state of the target point into the neural network. Road information includes the polynomial coefficients of the left and right lane lines. The current state of the ego vehicle includes the normalized current speed, the lateral offset between the current position of the ego vehicle and the lane centerline, and the angle between the line connecting the current and previous positions of the ego vehicle and the current body of the vehicle. The state of the target point includes the position of the target point, the speed of the target point, and the yaw angle of the target point. The neural network outputs the following parameters: first weighting coefficient α1, first mean μ1, first variance σ1, second mean μ2, second variance σ2, lateral scaling coefficient a, and lateral offset coefficient b, where the first variance σ1 and the second variance σ2 are scaled by the Sigmoid function; The second weighting coefficient α2 is obtained based on the first weighting coefficient α1 and the yaw angle of the target point. The yaw rate function and the speed function of the vehicle are obtained based on the parameters output by the neural network. The second weighting coefficient α2 is: in, is the yaw angle of the target point; The yaw rate function of the vehicle is: The velocity function of the vehicle is: Where t is time, t∈[0,n], v goal is the speed of the target point, v current is the current speed of the vehicle; The yaw rate function of the ego vehicle is discretized uniformly into m points in the time interval [0, n] seconds. The approximate yaw angle change of the ego vehicle at the corresponding moment of each point is calculated according to the following formula: Calculate the approximate displacement r of the vehicle at each point at the corresponding moment according to the following formula: i : Based on the approximate value of the yaw angle change of the vehicle and displacement approximation r i , calculate the coordinates of each point in m points (x i ,y i ), and get the driving trajectory: Among them, x current is the x-axis coordinate of the current position of the vehicle, y current is the y-axis coordinate of the vehicle's current position.
2. The trajectory planning method according to claim 1, characterized in that: The neural network has at least two hidden layers, and the number of neurons in each hidden layer is 256; the hidden layer adopts the ReLU nonlinear activation function, and the output layer of the neural network adopts the Tanh nonlinear activation function.
3. The trajectory planning method according to claim 1, characterized in that: The polynomial for the left lane line is: Among them, lan Coeffs left is the coefficient of the polynomial of the left lane line, and q is the degree of the polynomial of the left lane line; The polynomial for the right lane line is: Among them, lan Coeffs right are the coefficients of the polynomial of the right lane line, and the degree of the polynomial of the right lane line is equal to that of the left lane line.
4. The trajectory planning method according to claim 3, characterized in that: The ego vehicle obtains vehicle information in the detection area around it. When there is no vehicle in front of the ego vehicle lane, the ego vehicle cruises and the state of the target point is: Among them, (x goal ,y goal ) is the position of the target point, y lanCenter is the polynomial of the lane centerline; is the yaw angle of the target point, n·v current The current speed of the vehicle is the position after it travels along the center line of the lane for n seconds; When there is a vehicle in front of the vehicle, the left lane marking is not an edge lane marking, and there are no vehicles in the left lane or behind the vehicle in the detection area, the vehicle changes lanes to the left. When the right lane marking is not an edge lane marking, and there are no vehicles in the right lane or behind the vehicle in the detection area, the vehicle changes lanes to the right. After the vehicle changes lanes to the left or right, the status of the target point is: Among them, w lane is the road width; When there is a vehicle in front of the ego vehicle's lane, or the left lane marking is an edge lane marking and there is a vehicle in front of or behind the right lane in the detection area, or the right lane marking is an edge lane marking and there is a vehicle in front of or behind the left lane in the detection area, and the ego vehicle follows the vehicle in front of it, the target point status is: Among them, v obstacel_vehicle is the speed of the vehicle in front of the vehicle.
5. The trajectory planning method according to claim 4, characterized in that: The trajectory planning method further includes training the neural network, and the training of the neural network includes the following steps: The position of the target point is used as the label position, and the first loss function loss1 is obtained by the mean square error loss1=(x n -x goal ) 2 +(and n -and goal ) 2 Among them, x n is the x-axis coordinate of each point after being uniformly discretized into m points in the time interval [0,n] seconds, n is the y-axis coordinate of each point after being uniformly discretized into m points in the time interval [0,n] seconds; When the vehicle is cruising or following the vehicle ahead, the y-axis coordinate corresponding to the x-axis coordinate of each point is calculated using the lane centerline polynomial, and the corresponding y-axis coordinate is used as the y-direction label; When the vehicle changes lanes to the left, the first half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate, and the corresponding y-axis coordinate is used as the y-direction label. The second half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate and add the lane width as the y-direction label. When the vehicle changes lanes to the right, the first half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate, and the corresponding y-axis coordinate is used as the y-axis label. The second half of the m points are calculated using the lane centerline polynomial to calculate the corresponding y-axis coordinate of each point's x-axis coordinate and subtract the lane width as the y-axis label. The mean square error between the y-axis coordinate and the y-direction label of each point is used as the second loss function loss2 in, The y-direction label for each point; The third loss function loss3 is calculated according to the following formula in, is the approximate value of the yaw angle change of the ego vehicle corresponding to time 0 after being uniformly discretized into m points in the time interval [0,n] seconds. θ0 is the angle between the current and previous position points of the ego vehicle and the current body of the vehicle. The weighted sum of the first loss function, the second loss function, and the third loss function is used as the loss function to optimize the neural network parameters: Among them, W1 is the weight of the first loss function, W2 is the weight of the second loss function, and W3 is the weight of the third loss function.
6. The trajectory planning method according to claim 5, characterized in that: When training a neural network, gradient backpropagation is used to optimize the parameters of the neural network.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the trajectory planning method according to any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the trajectory planning method according to any one of claims 1 to 6 is implemented.
9. A motor vehicle, characterized in that: The motor vehicle has an automatic driving function, and when the motor vehicle operates the automatic driving function, the automatic driving trajectory of the vehicle is planned by the trajectory planning method according to any one of claims 1 to 6; or the motor vehicle has the computer device according to claim 7; Or the motor vehicle has the computer-readable storage medium according to claim 8, and when the computer program is executed by a processor, the trajectory planning method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Anti-collision path planning and control method and system for tracking autonomous vehicles
CN112937606A