Obstacle avoidance method and device based on preset cost function
By introducing a weight mechanism for dynamically adjusting the cost function in the obstacle avoidance solution, combining the preset cost function and target vehicle information, the problem of rigid cost mechanism in the existing obstacle avoidance solution is solved, and the success rate and dynamicity of obstacle avoidance are improved.
Patent Information
- Application Number
- CN202411924829.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-11
AI Technical Summary
The existing obstacle avoidance scheme calculation cost mechanism based on cost function cannot be adjusted dynamically or feedback to adjust the cost function, resulting in a high failure rate of obstacle avoidance.
An obstacle avoidance method based on a preset cost function is proposed. By dynamically adjusting the weight of the cost function based on the distance between the target vehicle and the vehicle, the preset interval and the target lane change probability, the optimal trajectory is determined to judge the obstacle avoidance direction.
It improves the success rate of obstacle avoidance, reduces the false trigger rate, and enhances the dynamicity and feedback ability of obstacle avoidance.
Smart Images

Figure CN119806140A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent driving technology, and in particular to an obstacle avoidance method and device based on a preset cost function. Background Art
[0002] The existing emergency obstacle avoidance strategy is to use Bezier curves or quintic polynomials for trajectory planning. Obstacle avoidance is performed if the planned trajectory meets the obstacle avoidance conditions. This solution does not consider the target's lane change intention. The number of splines is small during trajectory planning and the cost calculation mechanism is relatively rigid. There is no dynamic adjustment and feedback adjustment of the cost function, resulting in a high obstacle avoidance failure rate. Summary of the invention
[0003] The main purpose of the present application is to provide an obstacle avoidance method and device based on a preset cost function, aiming to solve the technical problem that the cost calculation mechanism of the existing obstacle avoidance scheme based on the cost function cannot dynamically adjust and feedback the adjusted cost function, resulting in a high obstacle avoidance failure rate.
[0004] To achieve the above objectives, the present application proposes an obstacle avoidance method based on a preset cost function, the obstacle avoidance method based on a preset cost function comprising:
[0005] According to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval, the lateral point scattering coordinates and the longitudinal point scattering coordinates are obtained;
[0006] A plurality of trajectories are obtained according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates and the longitudinal point-scattering coordinates;
[0007] Determine an optimal trajectory according to a preset cost function and the plurality of trajectories;
[0008] Determine whether the vehicle should avoid obstacles and the direction of obstacle avoidance according to the optimal trajectory.
[0009] In one embodiment, the step of determining the optimal trajectory according to the preset cost function and the plurality of trajectories includes:
[0010] Filtering the plurality of trajectories based on the screening condition to obtain a plurality of filtered trajectories;
[0011] Obtaining a preset cost function according to the cost and the weight corresponding to the cost, wherein the cost includes a first cost, a second cost, a third cost and a fourth cost;
[0012] An optimal trajectory is determined according to the preset cost function and the filtered multiple trajectories.
[0013] In one embodiment, before the step of determining the optimal trajectory according to the preset cost function and the filtered plurality of trajectories, the method further includes:
[0014] Determine a target lane change probability based on target vehicle information;
[0015] Get the distance between the target vehicle and the lane boundary;
[0016] If the longitudinal distance between the target vehicle and the host vehicle is greater than a first preset distance threshold, the weight corresponding to the second cost is increased, and the weight corresponding to the first cost is decreased;
[0017] If the longitudinal distance between the target vehicle and the host vehicle is less than a second preset distance threshold, the weight corresponding to the second cost is reduced, and the weight corresponding to the first cost is increased;
[0018] If the distance between the target vehicle and the lane boundary is less than a third preset distance threshold, increasing the weight corresponding to the fourth cost;
[0019] If the target lane-changing probability is greater than a preset probability, increasing the weight corresponding to the third cost;
[0020] Get the weight corresponding to the cost after the first adjustment;
[0021] It is determined that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the first adjustment.
[0022] In one embodiment, after the step of determining that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the first adjustment, the method further includes:
[0023] If it is detected that this is not the first time that the vehicle is avoiding an obstacle, the first historical obstacle avoidance failure rate, the second historical obstacle avoidance failure rate, and the third historical obstacle avoidance failure rate are obtained;
[0024] If the first historical obstacle avoidance failure rate is greater than a first preset failure rate, increasing the weight corresponding to the third cost;
[0025] If the second historical obstacle avoidance failure rate is greater than the second preset failure rate, increasing the weight corresponding to the fourth cost;
[0026] If the third historical obstacle avoidance failure rate is greater than a third preset failure rate, increasing the weight corresponding to the first cost;
[0027] Get the weight corresponding to the cost after the second adjustment;
[0028] The weight corresponding to the cost in the preset cost function is determined to be the weight corresponding to the cost after the second adjustment.
[0029] In one embodiment, the target vehicle information includes at least: the flashing time of the target vehicle turn signal, the distance between the target vehicle and the lane line, the lateral speed of the target vehicle, and the lateral acceleration of the target vehicle;
[0030] The step of determining the target lane change probability according to the target vehicle information comprises:
[0031] Determining a first target lane change probability according to the flashing time of the turn signal lamp of the target vehicle;
[0032] Determine a second target lane change probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle;
[0033] determining a third target lane change probability according to the target vehicle lateral acceleration;
[0034] Obtaining a maximum lane changing probability among the first target lane changing probability, the second target lane changing probability, and the third target lane changing probability;
[0035] The target lane changing probability is determined to be the maximum lane changing probability.
[0036] In one embodiment, the step of determining a first target lane change probability according to the flashing time of the turn signal lamp of the target vehicle comprises:
[0037] If the flashing time of the turn signal lamp of the target vehicle is greater than the preset flashing time threshold, confirming that the first target lane change probability is a first preset value;
[0038] If the flashing time of the turn signal lamp of the target vehicle is less than or equal to the preset flashing time threshold, the first target lane changing probability is confirmed to be a second preset value.
[0039] In one embodiment, the step of determining the second target lane change probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle comprises:
[0040] If the distance between the target vehicle and the lane line is less than or equal to a fourth preset distance threshold, confirming that the second target lane change probability is a first preset value;
[0041] If the distance between the target vehicle and the lane line is greater than or equal to a fifth preset distance threshold, confirming that the second target lane change probability is a second preset value;
[0042] If the lateral speed of the target vehicle is greater than or equal to a first preset speed threshold, confirming that the second target lane change probability is a first preset value;
[0043] If the lateral speed of the target vehicle is less than or equal to a second preset speed threshold, confirming that the second target lane change probability is a second preset value;
[0044] If the distance between the target vehicle and the lane line is greater than the fourth preset distance threshold and less than the fifth preset distance threshold, and the lateral speed of the target vehicle is greater than the second preset speed threshold and less than the first preset speed threshold;
[0045] Then, a fourth target lane change probability is obtained according to the distance between the target vehicle and the lane line, the fourth preset distance threshold and the fifth preset distance threshold;
[0046] and obtaining a fifth target lane change probability according to the target vehicle lateral speed, the first preset speed threshold, and the second preset speed threshold;
[0047] A second target lane changing probability is determined according to the fourth target lane changing probability and the fifth target lane changing probability.
[0048] In one embodiment, the step of determining a third target lane change probability according to the target vehicle lateral acceleration comprises:
[0049] Obtaining the lateral acceleration of the target vehicle at each moment within a preset time interval;
[0050] Obtaining lateral acceleration energy according to the lateral acceleration of the target vehicle at each moment within the preset time interval;
[0051] If the lateral acceleration energy is greater than or equal to the first energy threshold, determining the third target lane change probability to be a first preset value;
[0052] If the lateral acceleration energy is less than or equal to a second energy threshold, determining a third target lane change probability to be a second preset value;
[0053] If the lateral acceleration energy is greater than the second energy threshold and less than the first energy threshold, a third target lane change probability is determined according to the lateral acceleration energy, the first energy threshold and the second energy threshold.
[0054] In one embodiment, the step of obtaining a plurality of trajectories according to the lateral distance between the target vehicle and the host vehicle, the longitudinal distance between the target vehicle and the host vehicle, the lateral point-scattering coordinates, and the longitudinal point-scattering coordinates comprises:
[0055] A coordinate system is established according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates, and the longitudinal point-scattering coordinates;
[0056] Obtaining the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates and the second-order derivative of the end point coordinates according to the vehicle information, the lane line information and the coordinate system;
[0057] Obtaining a trajectory coefficient according to the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates, and the second-order derivative of the end point coordinates;
[0058] A plurality of trajectories are obtained according to the trajectory coefficients, the horizontal scattering point coordinates and the vertical scattering point coordinates.
[0059] In addition, to achieve the above-mentioned purpose, the present application also proposes an obstacle avoidance device based on a preset cost function, and the obstacle avoidance device based on a preset cost function includes:
[0060] A determination module, used for obtaining the lateral scattering point coordinates and the longitudinal scattering point coordinates according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval;
[0061] The determination module is further used to obtain a plurality of trajectories according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates and the longitudinal point-scattering coordinates;
[0062] The determination module is further used to determine the optimal trajectory according to a preset cost function and the plurality of trajectories;
[0063] The judgment module is used to judge whether the vehicle avoids obstacles and the direction of obstacle avoidance according to the optimal trajectory.
[0064] In addition, to achieve the above-mentioned purpose, the present application also proposes an obstacle avoidance device based on a preset cost function, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the obstacle avoidance method based on the preset cost function as described above.
[0065] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the obstacle avoidance method based on the preset cost function as described above are implemented.
[0066] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the obstacle avoidance method based on a preset cost function as described above.
[0067] One or more technical solutions proposed in this application obtain lateral point scattering coordinates and longitudinal point scattering coordinates according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval; obtain several trajectories according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point scattering coordinates and the longitudinal point scattering coordinates; determine the optimal trajectory according to the preset cost function and the several trajectories; and determine whether the vehicle avoids obstacles and the obstacle avoidance direction according to the optimal trajectory. Determining the optimal trajectory based on the preset cost function and thus determining the obstacle avoidance direction not only improves the obstacle avoidance success rate, but also reduces the false trigger rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0069] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0070] Figure 1 A flowchart diagram of the first embodiment of the obstacle avoidance method based on a preset cost function of the present application is provided;
[0071] Figure 2 This is a simplified schematic diagram of the vehicle coordinate system provided in the first embodiment of the obstacle avoidance method based on a preset cost function of the present application;
[0072] Figure 3 A flowchart diagram of a first implementation of the first embodiment of the obstacle avoidance method based on a preset cost function of the present application is provided;
[0073] Figure 4 A flowchart diagram of a second implementation of the first embodiment of the obstacle avoidance method based on a preset cost function of the present application;
[0074] Figure 5 A flowchart diagram of the second embodiment of the obstacle avoidance method based on a preset cost function of the present application is provided;
[0075] Figure 6 This is a schematic diagram of the module structure of an obstacle avoidance device based on a preset cost function according to an embodiment of the present application;
[0076] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the obstacle avoidance method based on a preset cost function in an embodiment of the present application.
[0077] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0078] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0079] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0080] The main solutions of the embodiments of this application are:
[0081] Since the existing emergency obstacle avoidance strategy adopts Bezier curves or quintic polynomials for trajectory planning, obstacle avoidance is performed if the planned trajectory meets the obstacle avoidance conditions. This scheme does not consider the target's lane change intention, the number of splines is small during trajectory planning, and the cost calculation mechanism is relatively rigid. There is no dynamic adjustment and feedback adjustment of the cost function, resulting in a high obstacle avoidance failure rate.
[0082] The present application provides a solution, which is based on a preset cost function and can dynamically allocate weights and feedback adjust the preset cost function to determine the obstacle avoidance direction, which not only improves the obstacle avoidance success rate, but also reduces the false trigger rate.
[0083] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an obstacle avoidance device based on a preset cost function, etc. The following takes an obstacle avoidance device based on a preset cost function as an example to illustrate this embodiment and the following embodiments.
[0084] Based on this, the embodiment of the present application provides an obstacle avoidance method based on a preset cost function, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the obstacle avoidance method based on a preset cost function of the present application.
[0085] In this embodiment, the obstacle avoidance method based on the preset cost function includes steps S10 to S40:
[0086] Step S10: Obtaining lateral point scattering coordinates and longitudinal point scattering coordinates according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval.
[0087] It should be noted that the lateral distance between the target vehicle and the host vehicle refers to the distance between the two vehicles at the same time perpendicular to the driving direction. If the driving direction of the vehicle is regarded as the longitudinal direction, then the lateral distance is the distance perpendicular to it. Usually, the host vehicle is used as the reference point to measure the distance of the target vehicle on the left or right relative to the host vehicle. For example, in a plane road scene, the host vehicle is driving along the center of the lane, and the target vehicle is in the adjacent lane. The distance between them perpendicular to the lane direction is the lateral distance.
[0088] In addition, the longitudinal distance between the target vehicle and the vehicle refers to the distance between the two vehicles in the direction of the vehicle's travel, and this distance is measured along the direction of the road. For example, on a highway, the vehicle is behind the vehicle in front, and the distance from the front of the vehicle to the rear of the vehicle in front is the longitudinal distance between the two vehicles.
[0089] It can be understood that the purpose of defining the lateral distance between the target vehicle and the host vehicle and the longitudinal distance between the target vehicle and the host vehicle is to subsequently obtain the lateral scattering coordinates and the longitudinal scattering coordinates, thereby establishing a vehicle coordinate system.
[0090] Specifically, the longitudinal distance between the target and the vehicle is defined as x0, and the lateral distance between the target and the vehicle is defined as y0.
[0091] Among them, the preset transverse interval and the preset longitudinal interval are both important parameters in the point scattering plan. For example, in the above text, the longitudinal distance between the target vehicle and the vehicle is defined as x0, the transverse distance between the target vehicle and the vehicle is defined as y0, the preset longitudinal interval is 5m, and the preset transverse interval is 4m. Then, a specific point scattering plan can be obtained: the longitudinal point scattering starts from x0-5 and is scattered at intervals of 5m until x0+30; the transverse point scattering starts from y0-4.0 and is scattered at intervals of 0.4m until y0+4.0. The transverse point scattering coordinates and the longitudinal point scattering coordinates can be obtained through the specific point scattering plan, which can be recorded as (x_pt, y_pt).
[0092] In addition, the point spreading scheme refers to the strategy of laying out or sampling "points" representing various information during the process of map construction, path planning or target detection of the vehicle driving environment. These "points" can be key location points in the map, reference points on the path, or feature points of target objects (such as other vehicles, pedestrians, obstacles), etc.
[0093] It can be understood that a vehicle coordinate system can also be established based on the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates, and the longitudinal point-scattering coordinates. Figure 2 , Figure 2 This is a simplified schematic diagram of the vehicle coordinate system provided in this embodiment.
[0094] In addition, the vehicle coordinate system is a local coordinate system established with the vehicle itself as the center. Usually, the center of mass of the vehicle (or a specified reference point, such as the center of the rear axle of the vehicle) is used as the origin of the coordinate system. The vehicle's forward direction is defined as the positive direction of the x-axis, and the left side of the vehicle is defined as the positive direction of the y-axis.
[0095] Step S20: obtaining a plurality of trajectories according to the lateral distance between the target vehicle and the host vehicle, the longitudinal distance between the target vehicle and the host vehicle, the lateral scattering coordinates and the longitudinal scattering coordinates.
[0096] It should be noted that the trajectory represents the movement path of the vehicle from the initial state to the target state within a certain time range. It not only contains the location information that the vehicle is going to reach, but also contains the speed and acceleration information of the vehicle at each moment. The multiple trajectories are obtained by using the quintic polynomial trajectory planning algorithm based on the vehicle coordinate system to describe the position change of the vehicle relative to itself.
[0097] Specifically, a coordinate system is established according to the lateral distance between the target vehicle and the vehicle of the host vehicle, the longitudinal distance between the target vehicle and the vehicle of the host vehicle, the lateral scattering coordinates and the longitudinal scattering coordinates; the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates and the second-order derivative of the end point coordinates are obtained according to the vehicle information of the host vehicle, the lane line information and the coordinate system; the trajectory coefficient is obtained according to the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates and the second-order derivative of the end point coordinates; and a number of trajectories are obtained according to the trajectory coefficients, the lateral scattering coordinates and the longitudinal scattering coordinates.
[0098] In a specific implementation, the following is established based on the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates, and the longitudinal point-scattering coordinates. Figure 2 The coordinate system shown; the vehicle information is known. To ensure the continuity of the vehicle's driving state, the curvature at the starting point of the trajectory must match the state of the vehicle, and according to the steering wheel angle φ of the vehicle steer , the vehicle wheelbase L, the vehicle speed v and the steering wheel and front wheel steering ratio ratio of the vehicle to obtain the starting point coordinate y(start), the first-order derivative of the starting point coordinate y(start)′ and the second-order derivative of the starting point coordinate y(start)″, as shown in the following equations 1, 2 and 3:
[0099] y(start)=0 (Formula 1)
[0100] y(start)′=0 (Formula 2)
[0101]
[0102] Given the coordinate system and lane line information, that is, the end point coordinate is known to be y_pt, the lane line heading angle at x_pt is known to be c1(x_pt), and the lane line curvature at x_pt is known to be c2(x_pt), then the end point coordinate y(end), the first-order derivative y(end)′ of the end point coordinate, and the second-order derivative y(end)″ of the end point coordinate can be obtained, as shown in the following equations 4, 5, and 6:
[0103] y(end)=y_pt (Formula 4)
[0104] y(end)′=c1(X pt ) (Formula 5)
[0105] y(end)″=2*c2(x_pt) (Formula 6)
[0106] Moreover, after obtaining the starting point coordinates y(start), the first-order derivative of the starting point coordinates y(start)′, the second-order derivative of the starting point coordinates y(start)″, the end point coordinates y(end), the first-order derivative of the end point coordinates y(end)′ and the second-order derivative of the end point coordinates y(end)″, the trajectory coefficients a0, a1, a2, a3, a4, a5 of different trajectories can be obtained based on them. It should be explained that the trajectory coefficients a0, a1, a2, a3, a4, a5 are not fixed values, and the trajectory coefficients usually have different values for different trajectories.
[0107] Then, the trajectory expression form is obtained according to the trajectory coefficient, the horizontal scattering point coordinates and the vertical scattering point coordinates, as shown in the following formula 7:
[0108] y=a5*x 5 +a4*x 4 +a3*x 3 +a2*x 2 +a1*x+a0(Formula 7)
[0109] Among them, a0, a1, a2, a3, a4, and a5 are polynomial coefficients respectively, x represents the horizontal coordinate of the vehicle coordinate system, and y represents the vertical coordinate of the vehicle coordinate system. Finally, several trajectories can be obtained according to the trajectory expression form.
[0110] In addition, the trajectory curvature is a geometric quantity used to measure the curvature of the trajectory. From a mathematical point of view, for a plane curve trajectory, the curvature of a point on the trajectory refers to the curvature of the curve at that point, which is equal to the rate at which the tangent direction of the curve changes at that point. Intuitively speaking, if the trajectory is a straight line, then its curvature is 0, because the straight line has no curvature; and the more curved the trajectory is, the greater its curvature value is.
[0111] The steering wheel angle refers to the angle that the steering wheel turns relative to its center position when the steering wheel is turned. This angle is a key parameter to measure the degree of steering of the vehicle. Usually, when the steering wheel is in the position for the vehicle to travel in a straight line, the angle is 0 degrees. When the steering wheel is turned to one side, the angle will increase accordingly. For example, turning the steering wheel to the left or right by a certain angle will make the vehicle turn.
[0112] The wheelbase of a vehicle refers to the distance from the center of the front axle to the center of the rear axle. It is a basic dimension parameter of a vehicle and has important significance in many aspects such as the design, performance and use of the vehicle. For example, for common cars, the wheelbase is generally between 2.5 meters and 3.0 meters; for large buses or trucks, the wheelbase may be longer.
[0113] The vehicle speed refers to the vehicle's own driving speed, which is a physical quantity that describes the distance traveled by the vehicle in a unit of time. It is usually expressed in kilometers per hour (km / h) or meters per second (m / s).
[0114] The steering wheel to front wheel steering ratio refers to the ratio of the steering wheel turning angle to the corresponding turning angle of the vehicle's front wheels. For example, if the steering wheel steering ratio is 18:1, it means that when the steering wheel turns 18 degrees, the front wheels turn 1 degree accordingly. It is an important parameter of the car's steering system, which is used to describe the relationship between the steering wheel operation and the actual steering action of the vehicle.
[0115] The lane heading angle refers to the angle between the tangent direction of the lane at a certain point and the reference direction (usually the direction of the geographic North Pole or the reference coordinate axis of the vehicle's travel direction). This angle can be used to describe the direction of the lane. For example, on a horizontal straight lane, the lane heading angle may be 0 degrees (assuming that the vehicle's travel direction is the positive direction of the reference coordinate axis); if it is a curved road, the lane heading angle will change as the lane curves.
[0116] Lane curvature is a physical quantity used to measure the degree of lane curvature. From a mathematical point of view, it indicates the degree to which a lane deviates from a straight line at a certain point. If the lane is a straight line, its curvature is 0; the higher the curvature of the lane, the greater the curvature. For example, for a circular curved lane, its curvature is a constant and equal to the inverse of the radius of the circle.
[0117] Step S30: determining an optimal trajectory according to a preset cost function and the plurality of trajectories.
[0118] It should be noted that the preset cost function consists of a cost and a weight corresponding to the cost. In this embodiment, the weight corresponding to the cost can be adjusted dynamically. The optimal trajectory is the best path selected from many possible trajectories according to a specific optimization goal under a series of constraints. It takes into account various factors, such as path length, safety, and smoothness, to achieve an optimal balance.
[0119] Specifically, the plurality of trajectories are filtered based on the screening conditions to obtain the filtered plurality of trajectories; a preset cost function is obtained according to the cost and the weight corresponding to the cost, the cost including a first cost, a second cost, a third cost and a fourth cost; and an optimal trajectory is determined according to the preset cost function and the filtered plurality of trajectories.
[0120] In a specific implementation, the screening conditions include: if the distance between any point in the trajectory and the target vehicle is less than a preset safety distance threshold, the trajectory is filtered; if any point in the trajectory exceeds the lane boundary, the trajectory is filtered; if the lateral acceleration of any point in the trajectory exceeds a preset safety acceleration threshold, the trajectory is filtered; if the curvature of any point in the trajectory exceeds a preset safety curvature threshold, the trajectory is filtered; thereby obtaining a number of filtered trajectories.
[0121] As mentioned above, the preset cost function C total By price C i The weight ω corresponding to the cost i The composition is shown in Formula 8 below:
[0122] C total =∑ω i *C i (Formula 8)
[0123] The first cost refers to the trajectory length cost, the second cost refers to the lateral acceleration square integral cost, the third cost refers to the obstacle distance square integral cost, and the fourth cost refers to the lane boundary distance square integral cost. The optimal trajectory can be determined based on the preset cost function and the filtered trajectories.
[0124] It can be understood that filtering by screening conditions ensures the safety of the trajectory and the feasibility of vehicle driving.
[0125] In a feasible implementation manner, specific reference may be made to Figure 3 , before step S30, steps A31 to A38 may also be included:
[0126] Step A31: Determine the target lane change probability according to the target vehicle information.
[0127] It should be noted that the target vehicle information at least includes the flashing time of the target vehicle's turn signal light, the distance between the target vehicle and the lane line, the target vehicle's lateral speed, and the target vehicle's lateral acceleration.
[0128] In addition, the target lane change probability refers to the probability of the target vehicle performing a lane change operation in a traffic scene. In this embodiment, the target lane change probability ranges from 0 to 100.
[0129] Step A32: Obtain the distance between the target vehicle and the lane boundary.
[0130] It should be noted that the distance between the target vehicle and the lane boundary refers to the vertical distance from a reference point on the target vehicle (such as the center line or edge of the vehicle) to the lane boundary on the road plane. This distance can intuitively reflect the position of the vehicle in the lane and is an important indicator for evaluating whether the vehicle's driving status is safe and complies with traffic regulations. For example, during normal driving, the vehicle should maintain a certain safe distance from the boundaries on both sides of the lane.
[0131] Step A33: If the longitudinal distance between the target vehicle and the host vehicle is greater than a first preset distance threshold, the weight corresponding to the second cost is increased, and the weight corresponding to the first cost is decreased.
[0132] It should be noted that this situation can be considered as the target is far away, so the integral cost weight of the square of the lateral acceleration is increased, the trajectory length cost weight is reduced, and the obstacle avoidance comfort is improved.
[0133] Step A34: If the longitudinal distance between the target vehicle and the host vehicle is less than a second preset distance threshold, the weight corresponding to the second cost is reduced, and the weight corresponding to the first cost is increased.
[0134] It should be noted that this situation can be considered as when the target distance is close, so the integral cost weight of the square of the lateral acceleration is reduced, the trajectory length cost weight is increased, and the obstacle avoidance speed is improved.
[0135] Step A35: If the distance between the target vehicle and the lane boundary is less than a third preset distance threshold, the weight corresponding to the fourth cost is increased.
[0136] It should be noted that this situation can be considered as the target being close to the lane boundary, so the integral cost weight of the square value of the lane boundary distance is increased to increase the safety of crossing the boundary.
[0137] Step A36: If the target lane-changing probability is greater than the preset probability, increase the weight corresponding to the third cost.
[0138] It should be noted that this situation can be considered as a situation where the target lane change probability is relatively large. For example, the preset probability is set to 70. When the target lane change probability is higher than 70, the integral cost weight of the square value of the obstacle distance is increased to enhance obstacle avoidance safety.
[0139] Step A37: Obtain the weight corresponding to the cost after the first adjustment.
[0140] It can be understood that after increasing or decreasing the weight corresponding to the cost, the weights corresponding to all the costs after the first adjustment are obtained.
[0141] Step A38: Determine that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the first adjustment.
[0142] It can be understood that this determination step is to update the weight corresponding to the cost in the preset cost function.
[0143] In a feasible implementation manner, specific reference may be made to Figure 4 , after step A38, steps B31 to B36 may also be included:
[0144] Step B31: If it is detected that this is not the first time that the vehicle is avoiding an obstacle, a first historical obstacle avoidance failure rate, a second historical obstacle avoidance failure rate, and a third historical obstacle avoidance failure rate are obtained.
[0145] It should be noted that the first historical obstacle avoidance failure rate refers to the probability of obstacle avoidance failure due to failure to avoid the target vehicle during obstacle avoidance, the second historical obstacle avoidance failure rate refers to the probability of obstacle avoidance failure due to crossing the lane boundary during obstacle avoidance, and the third historical obstacle avoidance failure rate refers to the probability of obstacle avoidance failure due to insufficient longitudinal distance during obstacle avoidance.
[0146] It is understandable that if it is detected that this is not the first time that the vehicle is avoiding an obstacle, the first historical obstacle avoidance failure rate, the second historical obstacle avoidance failure rate and the third historical obstacle avoidance failure rate can be obtained based on the data stored in the vehicle.
[0147] Step B32: If the first historical obstacle avoidance failure rate is greater than a first preset failure rate, then increasing the weight corresponding to the third cost.
[0148] In a specific embodiment, the first preset failure rate is set to 3%. If the first historical obstacle avoidance failure rate is higher than 3%, the integral cost weight of the square value of the obstacle distance is increased.
[0149] Step B33: If the second historical obstacle avoidance failure rate is greater than the second preset failure rate, then increase the weight corresponding to the fourth cost.
[0150] In a specific embodiment, the second preset failure rate is set to 10%. If the second historical obstacle avoidance failure rate is higher than 10%, the lane boundary distance square value integral cost weight is increased.
[0151] Step B34: If the third historical obstacle avoidance failure rate is greater than a third preset failure rate, increasing the weight corresponding to the first cost.
[0152] In a specific embodiment, the third preset failure rate is set to 0%, and if the third historical obstacle avoidance failure rate is higher than 0%, the trajectory length cost weight is increased.
[0153] Step B35: Obtain the weight corresponding to the cost after the second adjustment.
[0154] It can be understood that after adding the weight corresponding to the cost, the weights corresponding to all the costs after the second adjustment are obtained.
[0155] Step B36: Determine that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the second adjustment.
[0156] It can be understood that this determination step is to update the weight corresponding to the cost in the preset cost function.
[0157] It should be understood that the weight corresponding to the cost in the preset cost function is dynamically adjusted through the target vehicle information and the historical obstacle avoidance probability, thereby improving the obstacle avoidance success rate.
[0158] Step S40: Determine whether the vehicle avoids obstacles and the direction of obstacle avoidance according to the optimal trajectory.
[0159] In a specific embodiment, if there is no optimal trajectory or the optimal trajectory overlaps with the target vehicle, it is determined that the vehicle does not avoid obstacles; if the optimal trajectory is on the left side of the target vehicle, it is determined that the vehicle avoids obstacles on the left; if the optimal trajectory is on the right side of the target vehicle, it is determined that the vehicle avoids obstacles on the right.
[0160] This embodiment provides an obstacle avoidance method based on a preset cost function, according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval, the lateral point-scattering coordinates and the longitudinal point-scattering coordinates are obtained; according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates and the longitudinal point-scattering coordinates, several trajectories are obtained; according to the preset cost function and the several trajectories, the optimal trajectory is determined; according to the optimal trajectory, whether the vehicle avoids obstacles and the obstacle avoidance direction are determined. Based on the preset cost function, the preset cost function can be dynamically weighted and feedback adjusted to determine the obstacle avoidance direction, which not only improves the obstacle avoidance success rate, but also reduces the false trigger rate.
[0161] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5, step A31 includes steps S301 to S305:
[0162] Step S301: determining a first target lane-changing probability according to the flashing time of the turn signal lamp of the target vehicle.
[0163] It should be noted that the flashing time of a vehicle's turn signal refers to the duration of the vehicle's turn signal from on to off, completing one or more flashing actions. It is an important parameter in the vehicle's signal system, used to convey to other road users (such as other vehicle drivers, pedestrians) the vehicle's intention to change direction (turn, change lanes, etc.).
[0164] Specifically, if the flashing time of the turn signal of the target vehicle is greater than a preset flashing time threshold, the first target lane change probability is confirmed to be a first preset value; if the flashing time of the turn signal of the target vehicle is less than or equal to the preset flashing time threshold, the first target lane change probability is confirmed to be a second preset value.
[0165] In a specific embodiment, if the flashing time of the turn signal of the target vehicle is greater than 0.2s, the first target lane changing probability P1 is confirmed to be the first preset value 100; otherwise, the first target lane changing probability P1 is the second preset value 0.
[0166] Step S302: determining a second target lane change probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle.
[0167] It should be noted that the distance between the target vehicle and the lane line refers to the vertical distance from a specific reference point on the target vehicle (such as the center line, front edge, rear edge, etc. of the vehicle) to the nearest lane line on the road plane. This distance is used to measure the lateral position of the target vehicle in the lane, and can intuitively reflect whether the vehicle is driving normally in the lane and the degree of proximity between the vehicle and the lane boundary.
[0168] In addition, the target vehicle lateral velocity refers to the velocity component of the target vehicle in the direction perpendicular to its driving direction (longitudinal direction). In the vehicle driving scene, the vehicle's forward direction is usually defined as the longitudinal direction, and the left and right directions perpendicular to the forward direction are defined as the lateral direction. The lateral velocity is used to describe the speed at which the target vehicle moves left and right in the lane. For example, when a vehicle changes lanes or has a certain lateral deviation when driving on a curve, a lateral velocity is generated.
[0169] Specifically, if the distance between the target vehicle and the lane line is less than or equal to the fourth preset distance threshold, the second target lane change probability is confirmed to be the first preset value; if the distance between the target vehicle and the lane line is greater than or equal to the fifth preset distance threshold, the second target lane change probability is confirmed to be the second preset value; if the lateral speed of the target vehicle is greater than or equal to the first preset speed threshold, the second target lane change probability is confirmed to be the first preset value; if the lateral speed of the target vehicle is less than or equal to the second preset speed threshold, the second target lane change probability is confirmed to be the second preset value; if the distance between the target vehicle and the lane line is greater than the fourth preset distance threshold and less than the fifth preset distance threshold, and the lateral speed of the target vehicle is greater than the second preset speed threshold and less than the first preset speed threshold; then the fourth target lane change probability is obtained according to the distance between the target vehicle and the lane line, the fourth preset distance threshold and the fifth preset distance threshold; and the fifth target lane change probability is obtained according to the lateral speed of the target vehicle, the first preset speed threshold and the second preset speed threshold; and the second target lane change probability is determined according to the fourth target lane change probability and the fifth target lane change probability.
[0170] In a specific implementation, if the distance x between the target vehicle and the lane line is less than or equal to the fourth preset distance threshold x4, the second target lane change probability P2 is confirmed to be the first preset value 100; if the distance x between the target vehicle and the lane line is greater than or equal to the fifth preset distance threshold x5, the second target lane change probability P2 is confirmed to be the second preset value 0; if the lateral speed v of the target vehicle is greater than or equal to the first preset speed threshold v1, the second target lane change probability P2 is confirmed to be the first preset value 100; if the lateral speed v of the target vehicle is less than or equal to the second preset speed threshold v2, the second target lane change probability P2 is confirmed to be the second preset value 0; if the distance x between the target vehicle and the lane line is greater than the fourth preset distance threshold x4 and less than the fifth preset distance threshold x5, and the lateral speed v of the target vehicle is greater than the second preset speed threshold v2 and less than the first preset speed threshold v1, the fourth target lane change probability P4 is obtained according to the distance x between the target vehicle and the lane line, the fourth preset distance threshold x4 and the fifth preset distance threshold x5, as shown in Formula 9 below:
[0171] P4=(x-x5) / (x4-x5)*100(Formula 9)
[0172] And according to the target vehicle lateral speed v, the first preset speed threshold v1 and the second preset speed threshold v2, the fifth target lane change probability P5 is obtained, as shown in the following formula 10:
[0173] P5 = (v-v1) / (v2-v1)*100 (Formula 10)
[0174] And the second target lane changing probability P2 is determined according to the fourth target lane changing probability P4 and the fifth target lane changing probability P5, as shown in the following formula 11:
[0175] P2=P4*P5(Formula 11)
[0176] Step S303: determining a third target lane-changing probability according to the target vehicle lateral acceleration.
[0177] It should be noted that the lateral acceleration of the target vehicle refers to the acceleration component of the target vehicle in the direction perpendicular to its driving direction (longitudinal direction). It describes the speed of the change of the lateral speed of the vehicle. If the vehicle is driving in a straight line, the lateral acceleration is usually zero; but when the vehicle turns, changes lanes or is disturbed by lateral forces, lateral acceleration will be generated. For example, when a car turns at high speed, it needs to change the driving direction, which will generate lateral acceleration pointing to the inside of the curve.
[0178] Specifically, the lateral acceleration of the target vehicle at each moment within a preset time interval is obtained; the lateral acceleration energy is obtained according to the lateral acceleration of the target vehicle at each moment within the preset time interval; if the lateral acceleration energy is greater than or equal to a first energy threshold, the third target lane changing probability is determined to be a first preset value; if the lateral acceleration energy is less than or equal to a second energy threshold, the third target lane changing probability is determined to be a second preset value; if the lateral acceleration energy is greater than the second energy threshold and less than the first energy threshold, the third target lane changing probability is determined according to the lateral acceleration energy, the first energy threshold and the second energy threshold.
[0179] In a specific implementation, the preset time interval is set to 0.5s, then the lateral acceleration of the target vehicle at each moment within 0.5s is obtained, and the square value of the lateral acceleration of the target vehicle at each moment within 0.5s is calculated and accumulated, which is recorded as the lateral acceleration energy A. If the lateral acceleration energy A is greater than or equal to the first energy threshold A1, the third target lane change probability P3 is confirmed to be the first preset value 100; if the lateral acceleration energy A is less than or equal to the second energy threshold A2, the third target lane change probability P3 is determined to be the second preset value 0; if the lateral acceleration energy A is greater than the second energy threshold A2 and less than the first energy threshold A1, the third target lane change probability P3 is determined according to the lateral acceleration energy A, the first energy threshold A1 and the second energy threshold A2, as shown in the following formula 12:
[0180] P3=(A-A2) / (A1-A2)*100(Formula 12)
[0181] Step S304: obtaining a maximum lane changing probability among the first target lane changing probability, the second target lane changing probability and the third target lane changing probability.
[0182] It can be understood that obtaining the maximum lane changing probability among the first target lane changing probability, the second target lane changing probability and the third target lane changing probability lays a foundation for subsequent determination.
[0183] Step S305: determining that the target lane-changing probability is the maximum lane-changing probability.
[0184] It can be understood that determining the target lane change probability to be the maximum lane change probability can more effectively ensure driving safety.
[0185] This embodiment determines a first target lane-changing probability according to the flashing time of the turn signal lamp of the target vehicle; determines a second target lane-changing probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle; determines a third target lane-changing probability according to the lateral acceleration of the target vehicle; obtains the maximum lane-changing probability among the first target lane-changing probability, the second target lane-changing probability and the third target lane-changing probability; and determines that the target lane-changing probability is the maximum lane-changing probability. Determining the target lane-changing probability based on the target vehicle information can improve driving safety.
[0186] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the obstacle avoidance method of the present application based on a preset cost function. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0187] This application also provides an obstacle avoidance device based on a preset cost function, please refer to Figure 6 , the obstacle avoidance device based on the preset cost function includes:
[0188] The determination module 10 is used to obtain the lateral point scattering coordinates and the longitudinal point scattering coordinates according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval.
[0189] The determination module 10 is further used to obtain a plurality of trajectories according to the lateral distance between the target vehicle and the host vehicle, the longitudinal distance between the target vehicle and the host vehicle, the lateral scattering coordinates and the longitudinal scattering coordinates.
[0190] The determination module 10 is further configured to determine an optimal trajectory according to a preset cost function and the plurality of trajectories.
[0191] The judgment module 20 is used to judge whether the vehicle avoids obstacles and the direction of obstacle avoidance according to the optimal trajectory.
[0192] The obstacle avoidance device based on a preset cost function provided by the present application adopts the obstacle avoidance method based on a preset cost function in the above-mentioned embodiment, which can solve the technical problem that the cost calculation mechanism of the existing obstacle avoidance scheme based on the cost function cannot dynamically adjust and feedback the adjusted cost function, resulting in a high obstacle avoidance failure rate. Compared with the prior art, the beneficial effects of the obstacle avoidance device based on a preset cost function provided by the present application are the same as the beneficial effects of the obstacle avoidance method based on a preset cost function provided by the above-mentioned embodiment, and the other technical features of the obstacle avoidance device based on a preset cost function are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0193] In one embodiment, the determination module 10 is further used to filter the plurality of trajectories based on the screening conditions to obtain the plurality of filtered trajectories; obtain a preset cost function according to the cost and the weight corresponding to the cost, the cost including a first cost, a second cost, a third cost and a fourth cost; and determine the optimal trajectory according to the preset cost function and the plurality of filtered trajectories.
[0194] In one embodiment, the determination module 10 is also used to determine the target lane change probability based on the target vehicle information; obtain the distance between the target vehicle and the lane boundary; if the longitudinal distance between the target vehicle and the vehicle is greater than a first preset distance threshold, increase the weight corresponding to the second cost and reduce the weight corresponding to the first cost; if the longitudinal distance between the target vehicle and the vehicle is less than the second preset distance threshold, reduce the weight corresponding to the second cost and increase the weight corresponding to the first cost; if the distance between the target vehicle and the lane boundary is less than a third preset distance threshold, increase the weight corresponding to the fourth cost; if the target lane change probability is greater than the preset probability, increase the weight corresponding to the third cost; obtain the weight corresponding to the cost after the first adjustment; determine that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the first adjustment.
[0195] In one embodiment, the determination module 10 is also used to obtain the first historical obstacle avoidance failure rate, the second historical obstacle avoidance failure rate and the third historical obstacle avoidance failure rate if it is detected that this is not the first time that the vehicle is avoiding obstacles; if the first historical obstacle avoidance failure rate is greater than the first preset failure rate, the weight corresponding to the third cost is increased; if the second historical obstacle avoidance failure rate is greater than the second preset failure rate, the weight corresponding to the fourth cost is increased; if the third historical obstacle avoidance failure rate is greater than the third preset failure rate, the weight corresponding to the first cost is increased; obtain the weight corresponding to the cost after the second adjustment; and determine that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the second adjustment.
[0196] In one embodiment, the determination module 10 is further used to determine a first target lane changing probability according to the flashing time of the turn signal light of the target vehicle; determine a second target lane changing probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle; determine a third target lane changing probability according to the lateral acceleration of the target vehicle; obtain the maximum lane changing probability among the first target lane changing probability, the second target lane changing probability and the third target lane changing probability; and determine that the target lane changing probability is the maximum lane changing probability.
[0197] In one embodiment, the determination module 10 is further used to confirm that the first target lane change probability is a first preset value if the flashing time of the turn signal of the target vehicle is greater than a preset flashing time threshold; if the flashing time of the turn signal of the target vehicle is less than or equal to the preset flashing time threshold, then confirm that the first target lane change probability is a second preset value.
[0198] In one embodiment, the determination module 10 is further used to confirm that the second target lane change probability is the first preset value if the distance between the target vehicle and the lane line is less than or equal to the fourth preset distance threshold; if the distance between the target vehicle and the lane line is greater than or equal to the fifth preset distance threshold, the second target lane change probability is confirmed to be the second preset value; if the lateral speed of the target vehicle is greater than or equal to the first preset speed threshold, the second target lane change probability is confirmed to be the first preset value; if the lateral speed of the target vehicle is less than or equal to the second preset speed threshold, the second target lane change probability is confirmed to be the second preset value; if the distance between the target vehicle and the lane line is greater than the fourth preset distance threshold and less than the fifth preset distance threshold, and the lateral speed of the target vehicle is greater than the second preset speed threshold and less than the first preset speed threshold; then the fourth target lane change probability is obtained according to the distance between the target vehicle and the lane line, the fourth preset distance threshold and the fifth preset distance threshold; and the fifth target lane change probability is obtained according to the lateral speed of the target vehicle, the first preset speed threshold and the second preset speed threshold; and the second target lane change probability is determined according to the fourth target lane change probability and the fifth target lane change probability.
[0199] In one embodiment, the determination module 10 is further used to obtain the lateral acceleration of the target vehicle at each moment within a preset time interval; obtain the lateral acceleration energy according to the lateral acceleration of the target vehicle at each moment within the preset time interval; if the lateral acceleration energy is greater than or equal to the first energy threshold, determine the third target lane change probability as the first preset value; if the lateral acceleration energy is less than or equal to the second energy threshold, determine the third target lane change probability as the second preset value; if the lateral acceleration energy is greater than the second energy threshold and less than the first energy threshold, determine the third target lane change probability according to the lateral acceleration energy, the first energy threshold and the second energy threshold.
[0200] In one embodiment, the determination module 10 is further used to establish a coordinate system according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral scattering coordinates and the longitudinal scattering coordinates; obtain the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates and the second-order derivative of the end point coordinates according to the vehicle information of the vehicle, the lane line information and the coordinate system; obtain the trajectory coefficient according to the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates and the second-order derivative of the end point coordinates; obtain a plurality of trajectories according to the trajectory coefficient, the lateral scattering coordinates and the longitudinal scattering coordinates.
[0201] The present application provides an obstacle avoidance device based on a preset cost function, and the obstacle avoidance device based on the preset cost function includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the obstacle avoidance method based on the preset cost function in the above-mentioned embodiment one.
[0202] Reference below Figure 7 , which shows a schematic diagram of the structure of an obstacle avoidance device based on a preset cost function suitable for implementing an embodiment of the present application. The obstacle avoidance device based on a preset cost function in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The obstacle avoidance device based on the preset cost function shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0203] like Figure 7As shown, the obstacle avoidance device based on the preset cost function may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the obstacle avoidance device based on the preset cost function are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the obstacle avoidance device based on a preset cost function to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an obstacle avoidance device based on a preset cost function with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0204] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0205] The obstacle avoidance device based on a preset cost function provided by the present application adopts the obstacle avoidance method based on a preset cost function in the above-mentioned embodiment, which can solve the technical problem that the cost calculation mechanism of the existing obstacle avoidance scheme based on the cost function cannot dynamically adjust and feedback the adjusted cost function, resulting in a high obstacle avoidance failure rate. Compared with the prior art, the beneficial effects of the obstacle avoidance device based on a preset cost function provided by the present application are the same as the beneficial effects of the obstacle avoidance method based on a preset cost function provided by the above-mentioned embodiment, and the other technical features of the obstacle avoidance device based on a preset cost function are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0206] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0207] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0208] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the obstacle avoidance method based on a preset cost function in the above-mentioned embodiment.
[0209] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0210] The computer-readable storage medium may be included in the obstacle avoidance device based on a preset cost function; or may exist independently without being assembled into the obstacle avoidance device based on a preset cost function.
[0211] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the obstacle avoidance device based on a preset cost function, the obstacle avoidance device based on the preset cost function: obtains lateral scatter coordinates and longitudinal scatter coordinates according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval; obtains several trajectories according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral scatter coordinates and the longitudinal scatter coordinates; determines the optimal trajectory according to the preset cost function and the several trajectories; and determines whether the vehicle avoids obstacles and the obstacle avoidance direction according to the optimal trajectory.
[0212] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0213] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0214] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0215] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned obstacle avoidance method based on a preset cost function, and can solve the technical problem that the cost calculation mechanism of the existing obstacle avoidance scheme based on the cost function cannot dynamically adjust and feedback the adjustment cost function, resulting in a high obstacle avoidance failure rate. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the obstacle avoidance method based on a preset cost function provided by the above-mentioned embodiment, and will not be repeated here.
[0216] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the obstacle avoidance method based on a preset cost function as described above.
[0217] The computer program product provided by the present application can solve the technical problem that the cost calculation mechanism of the existing obstacle avoidance solution based on the cost function cannot dynamically adjust and feedback the adjusted cost function, resulting in a high obstacle avoidance failure rate. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the obstacle avoidance method based on the preset cost function provided by the above embodiment, and will not be repeated here.
[0218] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An obstacle avoidance method based on a preset cost function, characterized in that: The method comprises: According to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval, the lateral point scattering coordinates and the longitudinal point scattering coordinates are obtained; A plurality of trajectories are obtained according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral scattered point coordinates and the longitudinal scattered point coordinates; Determine an optimal trajectory according to a preset cost function and the plurality of trajectories; Determine whether the vehicle should avoid obstacles and the direction of obstacle avoidance according to the optimal trajectory.
2. The method according to claim 1, characterized in that The step of determining the optimal trajectory according to the preset cost function and the plurality of trajectories comprises: Filtering the plurality of trajectories based on the screening condition to obtain a plurality of filtered trajectories; Obtaining a preset cost function according to the cost and the weight corresponding to the cost, wherein the cost includes a first cost, a second cost, a third cost and a fourth cost; An optimal trajectory is determined according to the preset cost function and the filtered multiple trajectories.
3. The method according to claim 2, characterized in that Before the step of determining the optimal trajectory according to the preset cost function and the filtered plurality of trajectories, the method further includes: Determine a target lane change probability based on target vehicle information; Get the distance between the target vehicle and the lane boundary; If the longitudinal distance between the target vehicle and the host vehicle is greater than a first preset distance threshold, the weight corresponding to the second cost is increased, and the weight corresponding to the first cost is decreased; If the longitudinal distance between the target vehicle and the host vehicle is less than a second preset distance threshold, the weight corresponding to the second cost is reduced, and the weight corresponding to the first cost is increased; If the distance between the target vehicle and the lane boundary is less than a third preset distance threshold, increasing the weight corresponding to the fourth cost; If the target lane-changing probability is greater than a preset probability, increasing the weight corresponding to the third cost; Get the weight corresponding to the cost after the first adjustment; It is determined that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the first adjustment.
4. The method according to claim 3, characterized in that After the step of determining that the weight corresponding to the cost in the preset cost function is the weight corresponding to the cost after the first adjustment, the method further includes: If it is detected that this is not the first time that the vehicle is avoiding an obstacle, the first historical obstacle avoidance failure rate, the second historical obstacle avoidance failure rate, and the third historical obstacle avoidance failure rate are obtained; If the first historical obstacle avoidance failure rate is greater than a first preset failure rate, increasing the weight corresponding to the third cost; If the second historical obstacle avoidance failure rate is greater than the second preset failure rate, increasing the weight corresponding to the fourth cost; If the third historical obstacle avoidance failure rate is greater than a third preset failure rate, increasing the weight corresponding to the first cost; Get the weight corresponding to the cost after the second adjustment; The weight corresponding to the cost in the preset cost function is determined to be the weight corresponding to the cost after the second adjustment.
5. The method according to claim 3, characterized in that The target vehicle information includes at least: the flashing time of the target vehicle turn signal, the distance between the target vehicle and the lane line, the lateral speed of the target vehicle and the lateral acceleration of the target vehicle; The step of determining the target lane change probability according to the target vehicle information comprises: Determining a first target lane change probability according to the flashing time of the turn signal lamp of the target vehicle; Determine a second target lane change probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle; determining a third target lane change probability according to the target vehicle lateral acceleration; Obtaining a maximum lane changing probability among the first target lane changing probability, the second target lane changing probability, and the third target lane changing probability; The target lane changing probability is determined to be the maximum lane changing probability.
6. The method according to claim 5, characterized in that The step of determining a first target lane-changing probability according to the flashing time of the turn signal lamp of the target vehicle comprises: If the flashing time of the turn signal lamp of the target vehicle is greater than the preset flashing time threshold, confirming that the first target lane change probability is a first preset value; If the flashing time of the turn signal lamp of the target vehicle is less than or equal to the preset flashing time threshold, the first target lane changing probability is confirmed to be a second preset value.
7. The method according to claim 5, characterized in that The step of determining a second target lane change probability according to the distance between the target vehicle and the lane line and the lateral speed of the target vehicle comprises: If the distance between the target vehicle and the lane line is less than or equal to a fourth preset distance threshold, confirming that the second target lane change probability is a first preset value; If the distance between the target vehicle and the lane line is greater than or equal to a fifth preset distance threshold, confirming that the second target lane change probability is a second preset value; If the lateral speed of the target vehicle is greater than or equal to a first preset speed threshold, confirming that the second target lane change probability is a first preset value; If the lateral speed of the target vehicle is less than or equal to a second preset speed threshold, confirming that the second target lane change probability is a second preset value; If the distance between the target vehicle and the lane line is greater than the fourth preset distance threshold and less than the fifth preset distance threshold, and the lateral speed of the target vehicle is greater than the second preset speed threshold and less than the first preset speed threshold; Then, a fourth target lane change probability is obtained according to the distance between the target vehicle and the lane line, the fourth preset distance threshold and the fifth preset distance threshold; and obtaining a fifth target lane change probability according to the target vehicle lateral speed, the first preset speed threshold, and the second preset speed threshold; A second target lane changing probability is determined according to the fourth target lane changing probability and the fifth target lane changing probability.
8. The method according to claim 5, characterized in that The step of determining a third target lane change probability according to the target vehicle lateral acceleration comprises: Obtaining the lateral acceleration of the target vehicle at each moment within a preset time interval; Obtaining lateral acceleration energy according to the lateral acceleration of the target vehicle at each moment within the preset time interval; If the lateral acceleration energy is greater than or equal to the first energy threshold, determining the third target lane change probability to be a first preset value; If the lateral acceleration energy is less than or equal to a second energy threshold, determining a third target lane change probability to be a second preset value; If the lateral acceleration energy is greater than the second energy threshold and less than the first energy threshold, a third target lane change probability is determined according to the lateral acceleration energy, the first energy threshold and the second energy threshold.
9. The method according to claim 1, characterized in that The step of obtaining a plurality of trajectories according to the lateral distance between the target vehicle and the host vehicle, the longitudinal distance between the target vehicle and the host vehicle, the lateral point-scattering coordinates and the longitudinal point-scattering coordinates comprises: A coordinate system is established according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates, and the longitudinal point-scattering coordinates; Obtaining the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates and the second-order derivative of the end point coordinates according to the vehicle information, the lane line information and the coordinate system; Obtaining a trajectory coefficient according to the starting point coordinates, the first-order derivative of the starting point coordinates, the second-order derivative of the starting point coordinates, the end point coordinates, the first-order derivative of the end point coordinates, and the second-order derivative of the end point coordinates; A plurality of trajectories are obtained according to the trajectory coefficients, the horizontal scattering point coordinates and the vertical scattering point coordinates.
10. An obstacle avoidance device based on a preset cost function, characterized in that: The obstacle avoidance device based on a preset cost function includes: A determination module, used for obtaining the lateral scattering point coordinates and the longitudinal scattering point coordinates according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the preset lateral interval and the preset longitudinal interval; The determination module is further used to obtain a plurality of trajectories according to the lateral distance between the target vehicle and the vehicle, the longitudinal distance between the target vehicle and the vehicle, the lateral point-scattering coordinates and the longitudinal point-scattering coordinates; The determination module is further used to determine the optimal trajectory according to a preset cost function and the plurality of trajectories; The judgment module is used to judge whether the vehicle avoids obstacles and the direction of obstacle avoidance according to the optimal trajectory.