Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a local trajectory planning method, a system and a device, and the proposed planning framework can not only improve the comfort of the vehicle in the driving process, but also ensure the vehicle to quickly respond to the change of a traffic scene, thereby realizing environment self-adaptive re-planning.
In order to achieve the above object, the present invention adopts a technical solution that a local trajectory planning method includes the following steps:
s100, obtaining the perception information of the vehicle to the external environment and the current pose,
s200, generating an optimal path based on the perception information and the current pose;
s300, adding a speed attribute to the optimal path of S200 based on the sensing information and the current pose of S100, adopting an override mode or a waiting mode according to the interaction condition of the optimal path and the barrier, acquiring safe running speeds in the override mode and the waiting mode based on a uniform acceleration motion model, and regenerating the optimal path according to S200 if the safe running speed along the optimal path cannot be acquired; when the speed is generated, the error between the actual speed of the vehicle and the expected speed of the track is used as a compensation item and added to the calculation process;
s400, fusing the optimal path of S200 and the safe speed of S300 to generate a vehicle running track, and enabling the vehicle to run in a monitoring state; and enters a state retention mode.
S200, generating a candidate path group by adopting an end point state sampling method, and selecting an optimal path from the candidate paths, wherein the method specifically comprises the following steps:
s201, the longitudinal deviation S of the planned distance on a reference line and the current speed of the vehicle form a linear function, a reference point R can be obtained, and different transverse deviation d is formed at the position of the reference point RiDifferent target states G can be obtained by samplingiSolving for GiPose in cartesian coordinates;
s202, obtain the initial pose I ═ x from the vehicle(init),y(init),θ(init),κ(init)) To GiParameter curve Path ofi(ii) a Generating diversified paths to obtain a path group to be selected;
s203, considering static and low-speed obstacles, judging whether each path collides with the obstacle or not to obtain the collision risk of each path, comprehensively considering the maximum curvature of the path and the transverse offset from the reference line, calculating the collision risk, the maximum curvature and the transverse offset loss from the reference line, and then performing weighted summation, wherein the path with the minimum loss is the optimal path.
In S300, a feasible interval of acceleration in the interaction process of each obstacle is obtained according to the information of the dynamic obstacles on the optimal path, the feasible interval of the final acceleration is the intersection of the feasible intervals of the acceleration generated in the interaction process of each dynamic obstacle, the feasible interval of the acceleration is obtained, the optimal acceleration is found from the feasible intervals, and the speed curve of the vehicle is calculated according to the uniform acceleration motion model by adopting the optimal acceleration.
S300 specifically comprises the following steps:
s301, obtaining a feasible interval of acceleration in the interaction process of each obstacle according to the dynamic obstacle information, obtaining collision points of the vehicle and the dynamic obstacles, and enabling the vehicle to enter an overrunning mode or a waiting mode at the collision points;
acquiring a feasible acceleration interval under an overtaking mode and a waiting mode when the vehicle encounters each dynamic obstacle based on the information of each dynamic obstacle and the information of the collision point;
and calculating the loss of any acceleration in the acceleration interval according to the expected acceleration corresponding to the current acceleration of the vehicle, the current acceleration and the boundary of the acceleration interval, wherein the acceleration with the minimum loss is the optimal acceleration, and obtaining the speed curve of the vehicle by utilizing a uniform acceleration motion model according to the optimal acceleration.
When the vehicle is in a monitoring state driving and state maintaining mode, judging whether the current speed curve meets the conditions of an overtaking mode or a waiting mode in real time, and if not, giving an alarm; and calculating the distance between the current position of the vehicle and the optimal track target point in real time, and when the distance is smaller than a set threshold value, replanning a new optimal path.
A local track planning system comprises a control module, a path planning module, a speed generation module, a safety monitoring module and a driving monitoring module, wherein the path planning module generates a path according to information provided by a vehicle-mounted sensing system; the speed generation module adds a speed attribute to the generated path; the speed generation module acquires the generated path and barrier information and inputs the path and barrier information into the speed generation module at the same time, the safe driving speed is determined according to the interaction condition of the optimal path and the barrier, if the safe speed for driving along the path cannot be obtained, a path planning instruction is generated, and if the safe speed is obtained, the path and the speed are combined to complete the generation of the track; the safety monitoring module is used for judging whether the vehicle is in a dangerous state or not; the driving monitoring module is used for judging whether the target point of the planned path is reached; the safety monitoring module and the driving monitoring module also store and output the track of the vehicle, namely output the optimal path; and the control module generates corresponding behaviors according to the optimal path so that the vehicle starts to run along the optimal path.
The speed generation module comprises a speed generation unit and a low-pass filtering unit, the speed generation unit can continuously update the speed attribute of the track at the frequency of 0.5 Hz, and the low-pass filtering unit is used for acquiring the error between the actual speed of the vehicle and the expected speed of the track and feeding the error back to the speed generation unit.
The safety monitoring module continuously updates the current state of the vehicle and the barrier information given by the sensing module at the frequency of 10 Hz, judges the safety of the vehicle according to the current track, and generates and sends a corresponding signal if an emergency situation occurs when the vehicle continuously runs along the current track;
the driving monitoring module receives the current pose of the vehicle at the same frequency of 10 Hz, judges whether the vehicle is to reach a target point of the track according to the stored current track, and generates and sends a corresponding signal if the vehicle reaches the target point.
A computer device comprises one or more processors and a memory, wherein the memory is used for storing computer executable programs, the processors read part or all of the computer executable programs from the memory and execute the computer executable programs, and when the processors execute part or all of the computer executable programs, the local trajectory planning method can be realized.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, is capable of implementing the local trajectory planning method according to the invention.
Compared with the prior art, the invention has at least the following beneficial effects:
the method of the invention obtains the generated path and barrier information and determines the safe driving speed according to the interaction condition of the planned path and barrier, if the safe speed for driving along the path can not be obtained, a continuous and smooth speed curve is formed, if the safe speed is obtained, the path and the speed are combined with the planning method provided by the invention, thus not only improving the comfort of the vehicle in the driving process, but also ensuring the vehicle to quickly respond to the change of a traffic scene; meanwhile, a large amount of waste of computing resources caused by frequent re-planning can be avoided, and the computing load of a computer when the automatic driving system runs is reduced;
the system of the invention completely decouples the path planning and the speed generation and operates as two independent modules, and the delay of the path planning does not cause the delay of the whole system; even the path planning algorithm with larger time overhead does not influence the real-time performance of the whole system; on the other hand, the current planning system is particularly serious in the consumption of computing resources in a mode of updating the track at a fixed frequency, but the planning system does not need to update the path at the fixed frequency, so that the expenditure of the computing resources is reduced to a great extent, and the computing load of a computer when the automatic driving system runs is reduced.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings.
The speed generation module acquires the generated path and barrier information and inputs the path and barrier information into 'speed generation', determines a safe driving speed according to the interaction condition of the planned path and the barrier, generates a 'path planning' instruction if the safe speed for driving along the path cannot be obtained, and combines the path and the speed if the safe speed is obtained, so that the generation and planning process of the finished track can be divided into three layers: the first layer is path planning, the second layer is speed generation, and the third layer is planning scheduling; the path planning layer generates the most basic driving path, and the speed generation layer adds speed to the generated path to ensure the dynamic performance of the vehicle; and the planning and scheduling layer adaptively schedules the modules of the first two layers according to the environment and the vehicle running state.
The operation flow of the framework is as shown in fig. 1, after the automatic driving system receives an instruction for starting planning, the system generates a path in a path planning module by using an endpoint state sampling path planning algorithm based on five-time spline interpolation on the basis of the obstacle information provided by the sensing module, and the path satisfies G2And (3) continuous. The next step is to append a speed attribute to the generated path. And simultaneously inputting the generated path and the obstacle information into a speed planning module, and determining the safe driving speed according to the interaction condition of the planned path and the obstacle. And if the safe speed of driving along the path cannot be found, generating a re-path planning instruction, and triggering the path planning module to re-plan the path. Otherwise, combining the path with the speed to complete the generation of the track, and inputting the track into a vehicle state monitoring layer; the vehicle state monitoring layer comprises two parts, namely a safety monitoring module and a driving monitoring module, wherein the safety monitoring module is used for judging whether the vehicle is in a dangerous state, and the driving monitoring module is used for judging whether the vehicle reaches a target point of a planned path; the safety monitoring module and the driving monitoring module store the track generated by the speed generating module and then input the track into the control module. The control module generates corresponding behaviors according to the track, so that the vehicle starts to run along the track; the first cycle of programming is now complete and the next cycle of programming is not the second cycle but is to enter a state retention mode.
In the state maintaining mode, a path planning module does not plan a new path unless receiving a path re-planning instruction, the speed generating module comprises a speed generating unit and a low-pass filtering unit, and the speed generating unit continuously updates the speed attribute of the track at the frequency of 0.5 Hz; during the updating process, an error may exist between the actual speed of the vehicle and the expected speed of the track, and the error is fed back to the speed generating unit after passing through a low-pass filtering unit, and becomes one of the factors for updating the speed attribute. If the "speed generation" module cannot find a suitable speed attribute for the next path, the "speed generation" module is triggered to perform re-path planning. In addition, the safety monitoring module can continuously update the current state of the vehicle and the obstacle information given by the sensing module at the frequency of 10 Hz, and judge the safety of the vehicle according to the current track. Once the safety monitoring module considers that an emergency situation occurs when the vehicle continues to travel along the current track, the safety monitoring module sends a signal to the speed generation module to prompt the speed generation module to adjust the speed attribute of the current track so as to avoid danger. And the running monitoring module receives the current pose of the vehicle at the same frequency of 10 Hz and judges whether the vehicle is to reach a target point of the track according to the stored current track. If the vehicle reaches the target point, the "driving monitoring" module will send a signal to the "path planning" module to make it enter the next cycle of planning. The above process is repeated until the driving task of the automatic driving system is completed.
Through the process, the vehicle can always run from the starting point to the end point along the path generated by the planning algorithm, and the comfort in the running process is guaranteed. And in the process, the track speed attribute is continuously changed, so that the agility of the vehicle in a dynamic environment is realized. The reason for updating the speed attribute of the track at a low frequency of 0.5 hz is to reduce the consumption of computing resources on one hand and to avoid the problem that the control module is difficult to track the speed due to too frequent track updates on the other hand. Meanwhile, the safety monitoring module is updated at a high frequency of 10 Hz, so that the problem of untimely response to an emergency condition caused by too low updating frequency of the track speed is effectively solved. The method ensures that the automatic driving system can respond to emergency within 0.1 second time lag and exceeds the response speed of human beings, thereby effectively improving the agility of the system.
Besides the comfort and agility of vehicle running, the system of the invention has other advantages, and the time overhead of planning algorithm is one of the research difficulties. However, the system of the invention solves the problem, and the system operates as two independent modules through complete decoupling of path planning and speed generation, and the delay of the path planning does not cause the delay of the whole system; even the path planning algorithm with larger time overhead does not influence the real-time performance of the whole system; on the other hand, the current planning system is particularly serious in the consumption of computing resources in a mode of updating the track at a fixed frequency, but the planning system does not need to update the path at the fixed frequency, so that the expenditure of the computing resources is reduced to a great extent, and the computing load of a computer when the automatic driving system runs is reduced.
In addition, since the system is less likely to re-plan during travel along a planned route, it is difficult for a vehicle to appear during travel because the route does not satisfy G3The problem of understeer or lateral deviation overshoot occurs due to continuity, and on the other hand, the dynamic response of the vehicle mainly depends on speed generation, so that a planned and generated path is not tightly coupled with a sensing module, errors generated by the sensing module firstly influence the running speed of the vehicle, and the curvature change rate of the vehicle is not directly discontinuous.
When the system generates the speed, the error between the actual speed of the vehicle and the expected speed of the track is used as a compensation item to be added into the calculation process, and through the feedback of the compensation, the system can still better track the track even if the speed attribute of the track is updated at the frequency of 0.5 Hz; in conclusion, the system provided by the invention can better solve the problems existing in the current planning framework.
Each module in the framework is further described below:
a path planning module: firstly, generating a path to be selected by adopting an end point state sampling method, then selecting an optimal path, and calculating a corresponding point C of the optimal path on a reference line according to the current pose I of the vehicle after obtaining the reference line by global navigation as shown in FIG. 2;
then, the longitudinal deviation s of the planned distance on the reference line is a linear function of the current speed of the vehicle, so that a reference point R can be obtained, and different transverse deviation d is formed at the position of the reference point RiDifferent target states G can be obtained by samplingi;
Then, the solution G is obtainediPose in Cartesian coordinates, pose (x) of reference point R in Cartesian coordinates(r),y(r),θ(r),κ(r)) May be provided by reference lines each of which represents the x-coordinate, y-coordinate, orientation and curvature of R, respectively.
Thus, G can be calculated by the following expression
iPose in Cartesian coordinates
Next, the initial pose I ═ x of the vehicle is obtained(init),y(init),θ(init),κ(init)) To GiParameter curve Path ofi. In order to ensure the curvature continuity between adjacent planning periods, quintic splines are adopted to form a parameter curve PathiDescription is given of { x(s), y(s) }, the expression is as follows:
wherein s isfThe arc length of the parametric curve is usually calculated by using the chord length as an estimate of the arc length; at this time, the unknown parameter, Path, in expression 2 is obtainediCan be uniquely determined; while the saidThe known parameters can be calculated by the boundary constraint condition of the parameter curve, and the expression is as follows:
substituting the expression 3 into the expression 2 can calculate the unknown parameters therein to obtain the final generation Path Pathi. Different GiDifferent Path can be obtainediThereby generating diverse paths, i.e., resulting sets of paths.
Next, optimal path selection is carried out; in the process, only static and low-speed obstacles are considered, whether each path collides with the obstacle or not is judged, so that the collision risk of each path is obtained, in addition, the maximum curvature of the path and the transverse offset from a reference line are the other two factors needing to be considered, the losses of the three factors are calculated and subjected to weighted summation, and the path with the minimum loss is the optimal path; so far, the function of the path generation module is completed.
For the speed generation module, assuming that the vehicle makes a uniform speed change movement in the next period of time, the key point of the speed generation is to obtain a proper acceleration, and the method for solving the problem is as follows:
and obtaining a feasible interval of the acceleration according to the dynamic obstacle information, and finding the optimal acceleration from the feasible interval.
When the vehicle runs along the optimal path, a feasible acceleration interval exists in the interaction process of the vehicle and each dynamic obstacle, and the feasible final acceleration interval is the intersection of the feasible acceleration intervals generated in the interaction process of each dynamic obstacle;
as an alternative example, the speed planning time period of the present invention is 2 s.
The calculation method of the feasible interval of each acceleration is as follows: first, the collision point of the vehicle with the dynamic obstacle is calculated, as shown in fig. 3 and 4, both the vehicle and the dynamic obstacle are described by rectangular frames; only judging whether two rectangular frames are sent or notWhether collision occurs can be judged by overlapping, and the judgment method of rectangular frame overlapping adopts the separation axis theorem; obtaining a vehicle collision point cp(ego)Collision point cp with obstacle(obs)Thereafter, the behavior pattern of the host vehicle can be divided into two types. The first is to override, i.e. to cross the collision point before the dynamic obstacle, as shown in fig. 3, and the second is to wait, i.e. to reach the collision point after the dynamic obstacle, as shown in fig. 4. Both behaviour modes ensure the safety of the vehicle.
For the override mode, the vehicle must travel to meet two conditions; the first condition is that the vehicle reaches the collision point cp(ego)While, the dynamic obstacle is away from the collision point cp(obs)There is also a safety distance distsafeThat is, the position is shown by the frame of the first scenario in fig. 3; the second condition is when the dynamic obstacle reaches cp(obs)When the vehicle has exceeded cp(ego)Safe distance distsafeThat is, the position is shown by the second frame in the scene two of fig. 3; safe distance distsafeThe calculation expression is as follows, and the calculation expression is related to the current speed of the vehicle and the speed of the dynamic obstacle:
wherein, dist1And dist2For a set distance constant, vobsAs the speed of the obstacle, acc(obs)Maximum acceleration of the obstacle, vegoAs the vehicle speed, acc(ego)Coef is a set parameter for the maximum acceleration of the vehicle, epsilon is a step function, the expression is divided into two terms, the first term shows that when the vehicle is emergently braked, the obstacle is emergently braked, and after the vehicle is finally stopped, the distance between the two terms is dist1The second term is the distance to the obstacle that is desired to be maintained during travel.
Subsequently, for each acceleration acc of the vehicle, it is determined whether the above-described two conditions are satisfied when running at that acceleration. For condition one, vehicle-to-cp can be solved by a variable acceleration motion formula(ego)Time overhead t and velocity v ofegoAnd calculating dist according to expression 4safeFinally, calculating the movement of the barrier in the time t, and judging whether the movement exceeds the position of the frame I or not, wherein if the movement does not exceed the position of the frame I, the acc meets the condition I; for condition two, the obstacle to cp can be calculated(obs)Then the final position and final speed v of the vehicle moving with acc during the time t are calculatedego(ii) a Dist is calculated according to expression 4safeJudging whether the final position of the vehicle exceeds cp(ego)Distance distsafe(ii) a If so, the acc satisfies condition two, and if both conditions are satisfied, the acc is feasible.
For the waiting mode, there are also two conditions, the first being when the dynamic obstacle reaches cp(obs)While, vehicle is away from cp(ego)There is also a safety distance distsafeThat is, the position is shown by the frame two in the scene one of fig. 4; the second condition is that the vehicle reaches cp(ego)When the dynamic obstacle exceeds the collision point cp(obs)Safe distance distsafeThat is, the position is shown by the frame of # two in the scenario of fig. 4. In this mode, the safe distance distsafeThe calculation expression is as follows:
where the meaning of the variables is the same as in expression 4 and Sgn is a sign function. The meaning of this expression is also consistent with expression 4. The following process is basically the same as the description in the overtaking behavior mode, whether the acceleration meets two conditions is judged, if yes, the acceleration is considered to be feasible, and then a feasible acceleration interval is obtained.
The next step is to select an optimal acceleration that takes into account a number of factors, including the desired acceleration a for the current speed(exp)(preset), current acceleration a(cur)And the boundary of the acceleration interval; the loss calculation of any acceleration a in the interval comprises a and a(exp)A distance from a(cur)And with an acceleration intervalThe reciprocal of the boundary distance, and the acceleration with the minimum loss is the optimal acceleration; after the optimal acceleration is obtained, the velocity curve can be naturally calculated.
The safety monitoring module and the driving monitoring module are relatively simple to realize; the safety monitoring module continuously judges whether the current speed curve can meet the conditions of the aforementioned overtaking mode or waiting mode, and if not, an alarm is given. The driving monitoring module calculates the distance between the current position of the vehicle and the optimal track target point, and sends a replanning signal once the distance is smaller than a threshold value.
Optionally, the present invention further provides a computer device, including but not limited to one or more processors and a memory, where the memory is used to store a computer-executable program, the processor reads a part or all of the computer-executable program from the memory and executes the computer-executable program, the processor can implement a part of or all of the steps of the local trajectory planning method according to the present invention when executing the part or all of the computer-executable program, and the memory can also be used to store vehicle-mounted sensor information, road information, and map information.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, is capable of implementing the local trajectory planning method according to the invention.
The computer equipment can be an onboard computer, a notebook computer, a tablet computer, a desktop computer, a mobile phone or a workstation.
The invention also provides an output device for outputting the prediction result, wherein the output device is connected with the output end of the processor, and the output device is a display or a printer.
The processor may be a Central Processing Unit (CPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or an off-the-shelf programmable gate array (FPGA).
The memory of the invention can be an internal storage unit of a vehicle-mounted computer, a notebook computer, a tablet computer, a desktop computer, a mobile phone or a workstation, such as a memory and a hard disk; external memory units such as removable hard disks, flash memory cards may also be used.
Computer-readable storage media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. The computer-readable storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a Solid State Drive (SSD), or an optical disc. The Random Access Memory may include a resistive Random Access Memory (ReRAM) and a Dynamic Random Access Memory (DRAM).