Track planning method and device, equipment and medium
By modeling obstacle constraints, obtaining a comprehensive obstacle avoidance constraint vector and inputting it into the trajectory planning model, the problem of insufficient obstacle constraint processing in the existing technology is solved, the accuracy and safety of trajectory planning are improved, and the requirements for training data quality are reduced.
Patent Information
- Application Number
- CN202510896589.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-03
AI Technical Summary
Existing data-driven trajectory planning methods have shortcomings in dealing with obstacle constraints. They cannot directly consider obstacle constraints, resulting in degraded model performance and have high requirements on the quality of training data.
By modeling obstacle constraints, the comprehensive obstacle avoidance constraint vector of the obstacle is obtained and input into the trajectory planning model to provide obvious obstacle constraint information to improve the model's obstacle avoidance behavior learning ability.
It improves the accuracy and safety of trajectory planning, reduces the requirements for training data quality, and enhances the adaptability and feasibility of the model.
Smart Images

Figure CN120742886A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of trajectory planning technology, and in particular to a trajectory planning method, apparatus, device, and medium. Background Art
[0002] In autonomous driving tasks, there's a growing trend toward using large, end-to-end models, or a combination of multiple models, for decision-making and planning. This data-driven approach to decision-making and planning offers the advantage of capturing complex patterns and relationships by learning and analyzing large amounts of data. Faced with complex and changing situations, models can draw on existing knowledge and experience to flexibly assess and make decisions based on new circumstances, demonstrating strong adaptability. However, this approach also has drawbacks: model-based decision-making and planning methods require large amounts of high-quality data for training and validation. If the data is biased, noisy, or incomplete, it can degrade model performance, compromising the accuracy of decision-making and planning.
[0003] Furthermore, a major drawback of data-driven decision-making and planning methods is their inability to directly consider obstacle constraints. Current solutions for handling obstacle constraints fall into two main categories: 1. Implicit modeling, which involves no modeling and instead relies solely on a large amount of trajectory data that meets the constraints, allowing the model to learn the obstacle avoidance behavior. This method relies on training data; good training data can effectively learn the behavior, but poor training data makes it difficult to learn. 2. Post-processing: The planned trajectory output by the model is filtered through collision detection, and only those trajectories that meet the obstacle constraints are considered. This essentially eliminates the need to consider obstacle constraints in the model.
[0004] In view of this, this application is hereby filed. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a trajectory planning method, device, equipment and medium. First, obstacle constraints are modeled to obtain a comprehensive obstacle avoidance constraint vector of the obstacle, and then the comprehensive obstacle avoidance constraint vector is input into the model to obtain the vehicle trajectory. By providing the model with obvious obstacle constraint information, it helps the model to better learn obstacle avoidance behavior, thereby improving model performance, that is, improving the trajectory planning effect, ensuring the safe driving of the vehicle, and reducing the requirements for the quality of training data.
[0006] In a first aspect, an embodiment of the present disclosure provides a trajectory planning method, the method comprising:
[0007] Determining a comprehensive obstacle avoidance constraint vector for the obstacle based on a decision result of the decision module on the obstacle and the position of the obstacle;
[0008] The comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle are input into a trained trajectory planning model to obtain the ego vehicle trajectory.
[0009] In a second aspect, an embodiment of the present disclosure further provides a trajectory planning device, the device comprising:
[0010] a determination module, configured to determine a comprehensive obstacle avoidance constraint vector of the obstacle based on the decision result of the decision module on the obstacle and the position of the obstacle;
[0011] The planning module is used to input the comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle into the trained trajectory planning model to obtain the ego vehicle trajectory.
[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the trajectory planning method as described above.
[0013] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the trajectory planning method described above when executed by a processor.
[0014] A trajectory planning method provided by an embodiment of the present disclosure first models obstacle constraints to obtain a comprehensive obstacle avoidance constraint vector for the obstacle. The comprehensive obstacle avoidance constraint vector is then input into the model to obtain the ego-vehicle trajectory. By providing the model with clear obstacle constraint information, the model is helped to better learn obstacle avoidance behavior, thereby improving model performance, that is, improving the trajectory planning effect, ensuring the safe driving of the ego-vehicle, and reducing the requirements for the quality of training data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0016] Figure 1 is a flow chart of a trajectory planning method in an embodiment of the present disclosure;
[0017] Figure 2 This is a schematic diagram of an obstacle avoidance method in an embodiment of the present disclosure. Figure 1 ;
[0018] Figure 3 This is a schematic diagram of an obstacle avoidance method in an embodiment of the present disclosure. Figure 2 ;
[0019] Figure 4 is a schematic diagram of an obstacle avoidance constraint vector in an embodiment of the present disclosure;
[0020] Figure 5 Schematic diagram of the structure of a trajectory planning model in an embodiment of the present disclosure;
[0021] Figure 6 Schematic diagram of the structure of a trajectory planning device in an embodiment of the present disclosure;
[0022] Figure 7 Schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0024] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0026] Figure 1 This is a flow chart of a trajectory planning method in an embodiment of the present disclosure. This method can be executed by a trajectory planning device, which can be implemented in software and / or hardware, and can be configured in an electronic device. Figure 1 As shown, the method may specifically include the following steps:
[0027] S110 , determining a comprehensive obstacle avoidance constraint vector of the obstacle based on a decision result of the decision module on the obstacle and the position of the obstacle.
[0028] The decision module will give different decision results for each obstacle so that the planning module can plan a reasonable passage path. The decision results specifically include: a first probability of bypassing the left side of the obstacle and a second probability of bypassing the right side of the obstacle. Figure 2 The schematic diagram of the scene in which the vehicle 200 is bypassing the left side of the obstacle 210 is shown, and Figure 3The diagram shows a scene in which the vehicle 200 is circling the right side of the obstacle 210.
[0029] Exemplarily, determining a comprehensive obstacle avoidance constraint vector for the obstacle based on a decision result of the decision module on the obstacle and the position of the obstacle includes:
[0030] Based on the obstacle's position, an initial obstacle avoidance constraint vector is determined. This initial obstacle avoidance constraint vector indicates the positional relationship that the planned trajectory should maintain with the obstacle, aiming to prevent collision. Based on the decision module's decision regarding the obstacle, different initial obstacle avoidance constraint vectors are weighted to obtain a comprehensive obstacle avoidance constraint vector. This aims to reflect the decision module's decision regarding the obstacle in the obstacle avoidance constraint vector. For example, if the decision indicates that the vehicle should yield to the left of the obstacle (i.e., the first probability of yielding to the left of the obstacle is greater than the second probability of yielding to the right), a larger weight is assigned to the obstacle avoidance constraint vector indicating that the planned trajectory should be to the left of the obstacle, while a smaller weight is assigned to the obstacle avoidance constraint vector indicating that the planned trajectory should be to the right of the obstacle. This generates information indicating that the planned trajectory is more likely to be to the left of the obstacle. By constructing a comprehensive obstacle avoidance constraint vector with a clear bias and using it as model input, the model can better learn obstacle avoidance behaviors, thereby improving model performance, namely, improving trajectory planning effectiveness, ensuring safe driving of the ego vehicle, and reducing the requirements for training data quality.
[0031] Furthermore, according to the position of the obstacle, the initial obstacle avoidance constraint vector is determined, including: determining the left and right borders of the four sides of the rectangular border of the obstacle, and determining two starting points on the straight lines where the left and right borders are located respectively; starting from any starting point, determining two initial obstacle avoidance constraint vectors in different directions along the direction perpendicular to the corresponding straight line and away from the obstacle body. Figure 4 As shown, the initial obstacle avoidance constraint vector indicating that the planned trajectory is located on the left side of the obstacle 410 can be any one of a1, a2 and a3, and the initial obstacle avoidance constraint vector indicating that the planned trajectory is located on the right side of the obstacle can be any one of a4, a5 and a6.
[0032] The decision module's decision result on the obstacle includes: a first probability of circling the left side of the obstacle and a second probability of circling the right side of the obstacle. Based on the decision module's decision result on the obstacle and the two initial obstacle avoidance constraint vectors in different directions, a comprehensive obstacle avoidance constraint vector is determined, including: multiplying the first probability by the initial obstacle avoidance constraint vector with the constraint direction being the left side of the obstacle to obtain a first result; multiplying the second probability by the initial obstacle avoidance constraint vector with the constraint direction being the right side of the obstacle to obtain a second result; and adding the first and second results to obtain the comprehensive obstacle avoidance constraint vector. For example, the first probability of bypassing the obstacle from the left side is 0.8, and the second probability of bypassing the obstacle from the right side is 0.2. The initial obstacle avoidance constraint vector with the constraint direction to the left side of the obstacle is (-1, 0), and the initial obstacle avoidance constraint vector with the constraint direction to the right side of the obstacle is (1, 0). Then, 0.8×(-1, 0)=(-0.8, 0), 0.2×(1, 0)=(0.2, 0), and then (-0.8, 0)+(0.2, 0)=(-0.6, 0), that is, the comprehensive obstacle avoidance constraint vector is (-0.6, 0).
[0033] S120: Input the comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle into a trained trajectory planning model to obtain the ego vehicle trajectory.
[0034] The state vector of the vehicle includes information such as the speed, position, acceleration, and heading angle of the vehicle in the recent period (e.g., the last 3-5 seconds).
[0035] By inputting the comprehensive obstacle avoidance constraint vector as input to the trained trajectory planning model, the model can better learn obstacle avoidance behavior, thereby quickly planning a reasonable path and improving model performance.
[0036] In some implementations, the trajectory planning model is based on an attention mechanism. Its core concept is to enable the model to automatically focus on key components and ignore less important components when processing information, thereby improving efficiency and accuracy. The implementation of the attention mechanism typically follows the "Query-Key-Value" (QKV) framework, and its learning essence is to calculate the weight distribution of each element in the input sequence.
[0037] like Figure 5 As shown, the trajectory planning model specifically includes a first eigenvector calculation module 510 , a second eigenvector calculation module 520 , a third eigenvector calculation module 530 , a fourth eigenvector calculation module 540 and a fully connected module 550 .
[0038] The comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle are input into the trained trajectory planning model to obtain the ego vehicle trajectory, including: inputting the comprehensive obstacle avoidance constraint vector A′ into the first feature vector calculation module 510, and calculating the comprehensive obstacle avoidance constraint vector A′ and the first weight vector W by the first feature vector calculation module 510. k The product of the first eigenvector K is obtained; the comprehensive obstacle avoidance constraint vector A′ is input to the second eigenvector calculation module 520, and the comprehensive obstacle avoidance constraint vector A′ and the second weight vector W are calculated by the second eigenvector calculation module 520. v The product of the state vector T of the vehicle is obtained to obtain the second eigenvector V; the state vector T of the vehicle is input to the third eigenvector calculation module 530, and the state vector T of the vehicle and the third weight vector W are calculated by the third eigenvector calculation module 530 q The product of the first eigenvector K, the second eigenvector V and the third eigenvector Q is obtained; the first eigenvector K, the second eigenvector V and the third eigenvector Q are input to the fourth eigenvector calculation module 540, and the output vector O is calculated by the fourth eigenvector calculation module 540 according to the calculation formula of the attention mechanism; the output vector O is input to the fully connected module 550 to obtain the vehicle trajectory. k , the second weight vector W v , the third weight vector W q And the calculation parameters of the fully connected module are obtained through training.
[0039] Furthermore, the first weight vector W k , the second weight vector W v , the third weight vector W q The calculation parameters of the fully connected module are obtained by training based on multiple sample pairs in the following way:
[0040] Among them, a single sample pair includes a state vector of the sample ego vehicle, a true trajectory value, and a sample obstacle avoidance constraint vector; for each sample pair, the sample obstacle avoidance constraint vector is input into a first eigenvector calculation module, and the first eigenvector calculation module calculates the product of the sample obstacle avoidance constraint vector and the first initial vector to obtain a first eigenvector; the sample obstacle avoidance constraint vector is input into a second eigenvector calculation module, and the second eigenvector calculation module calculates the product of the sample obstacle avoidance constraint vector and the second initial vector to obtain a second eigenvector; the state vector of the sample ego vehicle is input into a third eigenvector calculation module, and the third eigenvector calculation module calculates the product of the state vector of the sample ego vehicle and the third initial vector to obtain a third eigenvector; The first eigenvector, the second eigenvector, and the third eigenvector are input into the fourth eigenvector calculation module, and the prediction vector is calculated by the fourth eigenvector calculation module according to the attention mechanism; the prediction vector is input into the fully connected module to obtain a predicted trajectory; the loss data between the predicted trajectory and the true value of the trajectory is calculated; according to the loss data, the first initial vector, the second initial vector, the third initial vector, and the calculation parameters in the fully connected module are adjusted until the convergence condition is met; wherein, the first initial vector when the convergence condition is met is determined as the first weight vector, the second initial vector when the convergence condition is met is determined as the second weight vector, and the third initial vector when the convergence condition is met is determined as the third weight vector.
[0041] The loss data includes: L2 distance loss, obstacle avoidance constraint violation loss, and obstacle avoidance distance loss. The smaller the difference between the predicted trajectory and the true trajectory, the smaller the L2 distance loss. The more obstacle avoidance constraints the predicted trajectory violates, the greater the obstacle avoidance constraint violation loss. The closer the predicted trajectory is to the obstacle, the greater the obstacle avoidance distance loss. Calculating loss data from multiple dimensions helps the driving model plan more effective trajectories. For example, maintaining a safe distance from obstacles, avoiding collisions with obstacles, and preventing the vehicle from making large turns or accelerating are all indicators used to measure the quality of trajectory performance.
[0042] Exemplarily, the obstacle avoidance constraint violation loss is determined by the following first calculation formula:
[0043]
[0044] Where L1 represents the obstacle avoidance constraint violation loss, m represents the number of rows of the sample obstacle avoidance constraint vector, k represents the penalty order, and A i Represents the element of row i in the sample obstacle avoidance constraint vector A, B i Indicates the distance that needs to be maintained between the vehicle and the obstacle at the i-th trajectory point, X i Represents the position of the i-th trajectory point on the predicted trajectory; if all constraint vectors satisfy Ai X i ≤B i , then the obstacle avoidance constraint violation loss is 0, otherwise a linear or quadratic penalty is imposed on the violated constraint.
[0045] The obstacle avoidance distance loss is determined by the following second calculation formula:
[0046]
[0047] dist_real = A·Xb
[0048] Where L2 represents the obstacle avoidance distance loss, W represents the weight, dist_real represents the difference between the distance between the predicted trajectory and the obstacle and the expected distance b, affect_ref is a preset value, X represents the predicted trajectory, and A represents the sample obstacle avoidance constraint vector. The closer the distance between the predicted trajectory and the obstacle, the greater the obstacle avoidance distance loss, which drives the model to adjust parameters to increase the distance between the predicted trajectory and the obstacle.
[0049] In summary, the trajectory planning method provided in this embodiment models the obstacle avoidance constraints of obstacles in the form of AX <= B, where A represents the obstacle avoidance constraint vector, X represents the trajectory, and B represents the desired distance. The obstacle avoidance constraint vectors modeled in this way are stable and the number is controllable. For static obstacles, their obstacle avoidance constraint vectors remain unchanged throughout the prediction time. For dynamic obstacles, their obstacle avoidance constraint vectors need to be adjusted in real time based on the obstacle position. The trajectory of the ego vehicle and the obstacle avoidance constraint vector are then interacted, specifically by extracting features through an attention mechanism, where Q in the attention mechanism is derived from the ego vehicle trajectory, and K and V are derived from the obstacle avoidance constraint vector.
[0050] The trajectory planning method provided in this embodiment explicitly models the obstacles and determines the comprehensive obstacle avoidance constraint vector before determining the planned trajectory through the planning model. The comprehensive obstacle avoidance constraint vector is used as the input of the planning model, which can help the model understand the obstacle avoidance behavior to a great extent. It is equivalent to providing the "prior knowledge" in trajectory planning to the model through modeling, so that the data-driven model has a stronger understanding ability, reduces the quality and quantity requirements of sample data, enhances feasibility, and reduces the amount of calculation and memory usage, because the explicit modeling scheme provided in this application is very simple and the data volume is small.
[0051] Figure 6 FIG. 1 is a schematic diagram of the structure of a trajectory planning device in an embodiment of the present disclosure. Figure 6 As shown: the device includes: a determination module 610 and a planning module 620.
[0052] A determination module 610 is configured to determine a comprehensive obstacle avoidance constraint vector for the obstacle based on the decision result of the decision module on the obstacle and the position of the obstacle;
[0053] The planning module 620 is configured to input the comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle into a trained trajectory planning model to obtain the ego vehicle trajectory.
[0054] Furthermore, the trained trajectory planning model includes a first eigenvector calculation module, a second eigenvector calculation module, a third eigenvector calculation module, a fourth eigenvector calculation module and a fully connected module; the planning module 620 is specifically used to: input the comprehensive obstacle avoidance constraint vector into the first eigenvector calculation module, calculate the product of the comprehensive obstacle avoidance constraint vector and the first weight vector through the first eigenvector calculation module to obtain the first eigenvector; input the comprehensive obstacle avoidance constraint vector into the second eigenvector calculation module, calculate the product of the comprehensive obstacle avoidance constraint vector and the second weight vector through the second eigenvector calculation module to obtain the second The state vector of the ego vehicle is input into the third eigenvector calculation module, and the product of the state vector of the ego vehicle and the third weight vector is calculated by the third eigenvector calculation module to obtain the third eigenvector; the first eigenvector, the second eigenvector and the third eigenvector are input into the fourth eigenvector calculation module, and the output vector is calculated according to the attention mechanism by the fourth eigenvector calculation module; the output vector is input into the fully connected module to obtain the trajectory of the ego vehicle; wherein, the calculation parameters of the first weight vector, the second weight vector, the third weight vector and the fully connected module are obtained through training.
[0055] Furthermore, the first weight vector, the second weight vector, the third weight vector, and the calculation parameters of the fully connected module are obtained by training according to multiple sample pairs in the following manner:
[0056] Among them, a single sample pair includes a state vector of the sample ego vehicle, a true trajectory value, and a sample obstacle avoidance constraint vector; for each sample pair, the sample obstacle avoidance constraint vector is input into a first eigenvector calculation module, and the first eigenvector calculation module calculates the product of the sample obstacle avoidance constraint vector and the first initial vector to obtain a first eigenvector; the sample obstacle avoidance constraint vector is input into a second eigenvector calculation module, and the second eigenvector calculation module calculates the product of the sample obstacle avoidance constraint vector and the second initial vector to obtain a second eigenvector; the state vector of the sample ego vehicle is input into a third eigenvector calculation module, and the third eigenvector calculation module calculates the product of the state vector of the sample ego vehicle and the third initial vector to obtain a third eigenvector; The first eigenvector, the second eigenvector, and the third eigenvector are input into the fourth eigenvector calculation module, and the prediction vector is calculated by the fourth eigenvector calculation module according to the attention mechanism; the prediction vector is input into the fully connected module to obtain a predicted trajectory; the loss data between the predicted trajectory and the true value of the trajectory is calculated; according to the loss data, the first initial vector, the second initial vector, the third initial vector, and the calculation parameters in the fully connected module are adjusted until the convergence condition is met; wherein, the first initial vector when the convergence condition is met is determined as the first weight vector, the second initial vector when the convergence condition is met is determined as the second weight vector, and the third initial vector when the convergence condition is met is determined as the third weight vector.
[0057] Furthermore, the determination module 610 includes a first determination unit, which is used to determine the left and right borders of the four sides of the rectangular border of the obstacle, and to determine two starting points on the straight lines where the left and right borders are respectively located; a second determination unit, which is used to determine two initial obstacle avoidance constraint vectors in two different directions along a direction perpendicular to the corresponding straight line and away from the obstacle body, taking any of the starting points as the starting point; and a third determination unit, which is used to determine the comprehensive obstacle avoidance constraint vector based on the decision result of the decision module on the obstacle and the two initial obstacle avoidance constraint vectors in different directions.
[0058] Furthermore, the decision module's decision results for the obstacle include: a first probability of bypassing the obstacle from the left side and a second probability of bypassing the obstacle from the right side; the third determination unit is specifically used to: multiply the first probability by the initial obstacle avoidance constraint vector of the corresponding direction to obtain a first result; multiply the second probability by the initial obstacle avoidance constraint vector of the corresponding direction to obtain a second result; add the first result and the second result to obtain the comprehensive obstacle avoidance constraint vector.
[0059] The trajectory planning device provided in the embodiment of the present disclosure can execute the steps of the trajectory planning method provided in the embodiment of the method of the present disclosure, and the execution steps and beneficial effects are not repeated here.
[0060] Figure 7This is a schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 7 , which shows a structural diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure. Figure 7 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0061] like Figure 7 As shown, the electronic device 500 may include a processing device 501, a ROM 502, a RAM 503, a bus 504, an input / output (I / O) interface 505, an input device 506, an output device 507, a storage device 508, and a communication device 509. The processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501 can perform various appropriate actions and processes to implement the method of the embodiment described in the present disclosure according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0062] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the trajectory planning method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0063] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0064] The computer-readable medium may be included in the electronic device, or may exist independently and not incorporated into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: determine a comprehensive obstacle avoidance constraint vector for the obstacle based on the decision module's decision regarding the obstacle and the obstacle's location; and input the comprehensive obstacle avoidance constraint vector and the ego-vehicle's state vector into a trained trajectory planning model to obtain the ego-vehicle trajectory.
[0065] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0066] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection according to one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0067] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
Claims
1. A trajectory planning method, characterized in that: The method comprises: Determining a comprehensive obstacle avoidance constraint vector for the obstacle based on a decision result of the decision module on the obstacle and the position of the obstacle; The comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle are input into a trained trajectory planning model to obtain the ego vehicle trajectory.
2. The method according to claim 1, characterized in that The trained trajectory planning model includes a first eigenvector calculation module, a second eigenvector calculation module, a third eigenvector calculation module, a fourth eigenvector calculation module and a fully connected module; The comprehensive obstacle avoidance constraint vector and the ego vehicle state vector are input into the trained trajectory planning model to obtain the ego vehicle trajectory, including: Inputting the comprehensive obstacle avoidance constraint vector into the first eigenvector calculation module, and calculating the product of the comprehensive obstacle avoidance constraint vector and the first weight vector by the first eigenvector calculation module to obtain a first eigenvector; Inputting the comprehensive obstacle avoidance constraint vector into the second eigenvector calculation module, and calculating the product of the comprehensive obstacle avoidance constraint vector and the second weight vector by the second eigenvector calculation module to obtain a second eigenvector; Inputting the state vector of the vehicle into the third eigenvector calculation module, and calculating the product of the state vector of the vehicle and the third weight vector by the third eigenvector calculation module to obtain a third eigenvector; Inputting the first eigenvector, the second eigenvector, and the third eigenvector into the fourth eigenvector calculation module, and calculating an output vector by the fourth eigenvector calculation module according to the attention mechanism; Inputting the output vector into the fully connected module to obtain the vehicle trajectory; The first weight vector, the second weight vector, the third weight vector and the calculation parameters of the fully connected module are obtained through training.
3. The method according to claim 2, characterized in that The first weight vector, the second weight vector, the third weight vector, and the calculation parameters of the fully connected module are obtained by training based on multiple sample pairs in the following manner: Among them, a single sample pair includes the state vector of the sample vehicle, the true value of the trajectory, and the sample obstacle avoidance constraint vector; For each sample pair, the sample obstacle avoidance constraint vector is input into the first eigenvector calculation module, and the first eigenvector calculation module calculates the product of the sample obstacle avoidance constraint vector and the first initial vector to obtain the first eigenvector; Inputting the sample obstacle avoidance constraint vector into the second eigenvector calculation module, and calculating the product of the sample obstacle avoidance constraint vector and the second initial vector by the second eigenvector calculation module to obtain the second eigenvector; Inputting the state vector of the sample ego vehicle into the third eigenvector calculation module, and calculating the product of the state vector of the sample ego vehicle and the third initial vector by the third eigenvector calculation module to obtain a third eigenvector; Input the first eigenvector, the second eigenvector, and the third eigenvector into a fourth eigenvector calculation module, and calculate the prediction vector using the attention mechanism through the fourth eigenvector calculation module; Input the prediction vector into the fully connected module to obtain the predicted trajectory; Calculate the loss data between the predicted trajectory and the true value of the trajectory; The first initial vector, the second initial vector, the third initial vector and the calculation parameters in the fully connected module are adjusted according to the loss data until the convergence condition is met; wherein the first initial vector when the convergence condition is met is determined as the first weight vector, the second initial vector when the convergence condition is met is determined as the second weight vector, and the third initial vector when the convergence condition is met is determined as the third weight vector.
4. The method according to claim 3, characterized in that The loss data includes: L2 distance loss, obstacle avoidance constraint violation loss and obstacle avoidance distance loss; The smaller the difference between the predicted trajectory and the true trajectory, the smaller the L2 distance loss; If the predicted trajectory violates more obstacle avoidance constraints, the obstacle avoidance constraint violation loss will be greater; The closer the distance between the predicted trajectory and the obstacle is, the greater the obstacle avoidance distance loss is.
5. The method according to claim 4, characterized in that The obstacle avoidance constraint violation loss is determined by the following first calculation formula: Where L1 represents the obstacle avoidance constraint violation loss, m represents the number of rows of the sample obstacle avoidance constraint vector, k represents the penalty order, and A i Represents the element of row i in the sample obstacle avoidance constraint vector, B i Indicates the distance that needs to be maintained between the vehicle and the obstacle, X i Represents the position of the i-th trajectory point on the predicted trajectory; The obstacle avoidance distance loss is determined by the following second calculation formula: dist_real = A·Xb Wherein, L2 represents the obstacle avoidance distance loss, W represents the weight, dist_real represents the difference between the distance between the predicted trajectory and the obstacle and the expected distance b, affect_ref is a preset value, X represents the predicted trajectory, and A represents the sample obstacle avoidance constraint vector.
6. The method according to claim 1, characterized in that The determining of the comprehensive obstacle avoidance constraint vector of the obstacle based on the decision result of the decision module on the obstacle and the position of the obstacle includes: Determine a left border and a right border among the four sides of the rectangular border of the obstacle, and determine two starting points on the straight lines where the left border and the right border are located respectively; Taking any of the starting points as a starting point, determine two initial obstacle avoidance constraint vectors in different directions along a direction perpendicular to the corresponding straight line and away from the obstacle body; The comprehensive obstacle avoidance constraint vector is determined according to the decision result of the decision module on the obstacle and the initial obstacle avoidance constraint vectors in two different directions.
7. The method according to claim 6, characterized in that The decision result of the decision module on the obstacle includes: a first probability of going around the left side of the obstacle and a second probability of going around the right side of the obstacle; The step of determining a comprehensive obstacle avoidance constraint vector based on the obstacle decision result of the decision module and the initial obstacle avoidance constraint vectors in two different directions includes: Multiplying the first probability by the initial obstacle avoidance constraint vector in the corresponding direction to obtain a first result; Multiplying the second probability by the initial obstacle avoidance constraint vector in the corresponding direction to obtain a second result; The first result and the second result are added to obtain the comprehensive obstacle avoidance constraint vector.
8. A trajectory planning device, characterized in that: include: a determination module, configured to determine a comprehensive obstacle avoidance constraint vector of the obstacle based on the decision result of the decision module on the obstacle and the position of the obstacle; The planning module is used to input the comprehensive obstacle avoidance constraint vector and the state vector of the ego vehicle into the trained trajectory planning model to obtain the ego vehicle trajectory.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.