Local path planning method for structured road
Technical Field
The invention relates to the technical field of automatic driving, in particular to a method for planning a local path of a structured road.
Background
The unmanned intelligent vehicle is considered as a main direction of automobile development in the future due to potential of improving traffic safety, reducing energy consumption, improving travel convenience and the like. Nowadays, with the rise of artificial intelligence technology and the continuous progress of the automobile industry, the automobile unmanned technology becomes the key point of research of scientific companies, scientific research institutions and colleges in the world. Autopilot systems can be generally classified as: the system comprises an environment perception module, a decision planning module and a control execution module, wherein the decision planning module is responsible for planning a safe and comfortable driving path for a vehicle, and urban roads, expressways and other structured roads with obvious lane lines are road scenes mainly faced by vehicle driving, so that the partial path planning of the structured roads is one of important contents of the research of the unmanned technology of the automobile.
The existing method for planning the unmanned local path of the automobile mainly comprises the following steps: (1) in a method for performing local path planning using the a-algorithm, for example, in the methods proposed in patent documents CN 107702716 a and CN 108444488A, sub-paths are generated according to environment perception information and vehicle positioning and navigation information, and then sub-path search is performed on candidate sub-paths without collision using the a-algorithm to generate local paths, which are different in the generation manner of the sub-paths and the heuristic function design of the a-search. The method has the disadvantages that collision detection is required for each generated sub-path, the required calculation amount is large, and the planning efficiency is low. (2) Patent document CN 106598055 a proposes an intelligent vehicle local path planning method for finding an optimal obstacle avoidance path point, which finds an optimal obstacle avoidance path point according to collected vehicle actual driving information, expected path information, and obstacle information, and generates an obstacle avoidance path using a double-circle synthetic curve. The method has the disadvantages that only a single obstacle avoidance path point can be generated in each planning, and continuous obstacle avoidance cannot be carried out. (3) Patent document CN 110032188A proposes an autonomous obstacle avoidance method based on an unmanned sightseeing electric vehicle, which divides coordinate points into three areas, namely, left, middle and right areas, detects obstacles in each area, and determines and makes an obstacle avoidance decision according to the detection result of each area. The method has the defect that the obstacle avoidance path only comprises three simple modes of straight movement, left turning and right turning, and cannot generate the optimal obstacle avoidance path. (4) Patent document CN 107992050 a proposes a local path planning method for an unmanned vehicle, which fits to obtain a local path trajectory cluster according to a current vehicle position, a current heading and an expected driving path of the unmanned vehicle, and selects an optimal local path as a current optimal local path according to a cost function. The method has the defects that only a single optimal obstacle avoidance local path of the current position can be generated, and the optimal obstacle avoidance path for continuous obstacle avoidance cannot be obtained. Therefore, the existing local path planning method cannot solve the problem of continuous obstacle avoidance in the structured road multi-obstacle environment, and still has the problem of improvement in the planning efficiency and the optimality of the obstacle avoidance path.
Disclosure of Invention
It is an object of the present invention to provide a structured road partial path planning method that overcomes or at least alleviates at least one of the above-mentioned drawbacks of the prior art.
In order to achieve the above object, the present invention provides a structured road local path planning method, which includes:
s1, acquiring obstacle information, a global reference path and self-parking position information, wherein, in a Cartesian coordinate system, the obstacle obstacles (i) presents a length liWidth wiAngle of orientation thetaiAnd the coordinates (x) of the center pointi,yi) The rectangular frame of (2); the coordinate of each reference path point waypoints (j) included in the global reference path is represented by (x)j,yj) The arc length is represented by sjAnd the distance from the left road boundary is represented by lleft,jAnd the distance from the right road boundary is represented by lright,jThe driving direction angle is represented as αj;
S2, converting each information acquired in S1 from a Cartesian coordinate system to a curvilinear coordinate system;
s3, presetting a transverse and longitudinal aggregation distance threshold, comparing the threshold with the actual transverse and longitudinal distance value between the two adjacent obstacles provided by S2, and classifying and aggregating the two adjacent obstacles according to the comparison result;
s4, generating a passable area of the barrier road section and a discrete obstacle avoidance sub-path thereof according to the new barrier information classified and aggregated by the S3;
s5, searching the optimal obstacle avoidance sub-path of the discrete obstacle avoidance sub-paths of each obstacle road section by adopting an improved A-star search algorithm;
s6, fitting each optimal obstacle avoidance sub-path obtained by searching S5 by adopting a cubic spline interpolation curve to obtain a continuous obstacle avoidance path under a curve coordinate system;
and S7, converting the continuous obstacle avoidance path obtained by fitting the S6 from a curvilinear coordinate system to a Cartesian coordinate system.
Further, the horizontal and vertical aggregate distance thresholds include a horizontal aggregate distance threshold and a vertical aggregate distance threshold, the actual horizontal and vertical distance value includes an actual horizontal distance value and an actual vertical distance value, wherein S3 specifically includes:
s31, when the actual lateral distance value is smaller than the lateral convergence distance threshold and the actual longitudinal distance value is smaller than the longitudinal convergence distance threshold, taking a rectangular frame surrounded by straight lines where lateral outer edges and longitudinal outer edges of the two adjacent obstacles are far away from each other as a first new obstacle after lateral and longitudinal convergence; and
s32, in a case that the actual lateral distance value is smaller than the lateral convergence distance threshold value and the actual longitudinal distance value is larger than the longitudinal convergence distance threshold value, extending two lateral outer edges of one of the two adjacent obstacles respectively toward the other obstacle in the lateral direction until the two lateral outer edges are flush with the longitudinal outer edge of the other obstacle, and converging the two lateral outer edges to form a second new obstacle in a rectangular frame; in the same way, another obstacle is laterally aggregated to obtain a third new obstacle presented in a rectangular box.
Further, the two adjacent obstacles comprise:
first obstacle obstacles (1) ═ s1,d1,l1,w1,Id1};
Second obstacle obstacles (2) ═ s2,d2,l2,w2,Id2};
The first new obstacle obstacles '(1) ═ s'1,d′1,l′1,w′1,Id′1}, wherein:
s′1=0.5*(min{s1+0.5*w1,s1-0.5*w1,s2+0.5*w2,s2-0.5* (3)
w2}+max{s1+0.5*w1,s1-0.5*w1,s2+0.5*w2,s2-0.5*w2})
d′1=0.5*(min{d1+0.5*h1,d1-0.5*h1,d2+0.5*h2,d2-0.5* (4)
h2}+max{d1+0.5*h1,d1-0.5*h1,d2+0.5*h2,d2-0.5*h2})
l′1=|s2-s1|+0.5*(l2+l1) (5)
w′1=|d2-d1|+0.5*(w2+w1) (6)
further, the two adjacent obstacles comprise:
third obstacle obstacles (3) ═ s3,d3,l3,w3,Idx3};
Fourth obstacle obstacles (4) ═ s4,d4,l4,w4,Idx4};
The second new obstacle obstacles '(3) ═ s'3,d′3,l′3,w′3,Id′3}, wherein:
s′3=0.5*(s3+s4) (7)
d′3=d3(8)
l′3=0.5*(l3+l4)+|s3+s4| (9)
w′3=w3(10)
the third new obstacle obstacles '(4) ═ s'4,d′4,l′4,w′4,Id′4}, wherein:
s′4=0.5*(s3+s4) (11)
d′4=d4(12)
l′4=0.5*(l3+l4)+|s3+s4| (13)
w′4=w4(14)
further, S5 specifically includes:
the improved A-algorithm uses the longitudinal offset between each obstacle avoidance sub-path as a parameter of a calculation heuristic functionHeuristic function fiThe specific calculation formula is as follows:
fi=w1*gi+w2*hi(17)
wherein d isiThe longitudinal coordinate of the current obstacle avoidance sub-path endpoint is taken as the longitudinal coordinate; di-1The vertical coordinate of the optimal obstacle avoidance sub-path end point of the previous obstacle road section; | di-di-1I is the longitudinal offset between the current obstacle avoidance sub-path and the optimal obstacle avoidance sub-path of the last obstacle road section; siThe horizontal coordinate of the left end point of the current obstacle avoidance sub-path is taken as the horizontal coordinate; si-1The abscissa of the right end point of the optimal obstacle avoidance sub-path of the previous obstacle road section; lleftRepresenting the distance of the obstacle from the left road boundary; lrightRepresenting the distance of the obstacle from the right road boundary; heuristic function fiAs a function g of different weightsiAnd function hiSumming; weight coefficient w1And w2The sum is always 1; dgoalWhich represents the coordinates of the target point goal in the direction of the vertical axis.
Further, the interpolation fitting method in S6 is specifically as follows:
an end point (i-1) ═ s through the adjacent optimal obstacle avoidance pathi-1,di-1,Idi-1}、point(i)={si,di,IdiSubstituting the coordinate of the point and the angle tangent value of the endpoint into a cubic spline interpolation curve equation and a first derivative equation, and converting into a matrix form to obtain an equation (19):
in the formula (19), diThe longitudinal coordinate of the current obstacle avoidance sub-path endpoint is taken as the longitudinal coordinate; di-1For the last barrierThe vertical coordinate of the optimal obstacle avoidance sub-path end point of the obstacle section; siThe horizontal coordinate of the left end point of the current obstacle avoidance sub-path is taken as the horizontal coordinate; si-1The abscissa of the right end point of the optimal obstacle avoidance sub-path of the previous obstacle road section; a. b, c and d are parameters to be calculated;
and according to a, b, c and d obtained by calculation of the formula (19), obtaining a cubic spline function expression (20) fitting each adjacent optimal obstacle avoidance sub-path:
f(s)=a*(s-si-1)3+b*(s-si-1)2+c*(s-si-1)1+d (20)
in the formula (20), the independent variable s is an abscissa value of the continuous obstacle avoidance path point, and the value range is(s)i-1,si) (ii) a Obtaining continuous obstacle avoidance path points waypoints (j) ═ Id by equidistant interpolationj,sj,dj,αj}。
Further, S4 specifically includes:
s41, for the aggregated road sections containing new obstacles in S3, generating accessible areas of the obstacle road sections by setting safe distances D between vehicles and road boundaries and obstacles; and
and S42, discretely generating the discrete obstacle avoidance sub-paths through longitudinal equal spacing delta d in the passable area of each obstacle section.
Further, the method for converting from the cartesian coordinate system to the curvilinear coordinate system in S2 specifically includes:
s21, coordinate system transformation of global reference path: by taking the road length s of each global reference waypointiA left-right longitudinal offset d of each path point is used as an abscissaiFor the ordinate, the global reference path waypoints (j) ═ x in the cartesian coordinate system is setj,yj,sj,lleft,j,lright,j,αjConverting to waypoints (j) { s) in a curve coordinate system taking the global reference path as a referencej,lleft,j,lright,j};
S22, converting the coordinate system of the obstacle: according to getting away from the obstacleThe nearest global reference path point waypoints (j) ═ xj,yj,sj,lleft,j,lright,j,αjAn obstacle obstacles (i) ═ x in a cartesian coordinate system is seti,yi,li,wi,θiConverting to a curve coordinate system: obstacles (i) { s }i,di,l′i,w′iId, the conversion calculation formula is as follows:
l′i=wi*sin(θi-αj)+li*cos(θi-αj) (1)
w′i=wi*cos(θi-αj)+li*sin(θi-αj) (2)
among the above parameters, siArc length of reference path point nearest to obstacle, diIs the distance between the center of the obstacle and the nearest reference path point,/'i、w′iId is the Id number of the reference path point closest to the obstacle for conversion to the length and width of the obstacle in the curvilinear coordinate system.
Further, S7 specifically includes:
according to the nearest reference path point waypoints (j) ═ xj,yj,sj,lleft,j,lright,j,αjAnd (d) continuously avoiding barrier path points waypoints (i) ═ Id in the curve coordinate systemi,si,di,αiReverting to the Cartesian coordinate system:
x=xj-di*sin(αj) (21)
y=yj+di*cos(αj) (22)
θ=αj+αi(23)
and obtaining the path points waypoints ═ { x, y, theta }, which are continuous obstacle avoidance paths in a Cartesian coordinate system.
Due to the adoption of the technical scheme, the invention has the following advantages:
according to the method for classifying and aggregating the adjacent obstacles, disclosed by the invention, the adjacent obstacles meeting the aggregation condition are classified and aggregated, so that a multi-obstacle scene can be greatly simplified, and the generation of obstacle avoiding sub-paths of the obstacle road section is facilitated; according to the method, the passable area of the obstacle section is generated, so that the obstacle avoidance local path planning is carried out in the non-collision passable area, the generated discrete obstacle avoidance sub-paths do not collide with the obstacle, the extra calculation required by collision check of the discrete obstacle avoidance sub-paths is reduced, and the planning efficiency can be effectively improved; the invention adopts the improved A-star search algorithm to search the obstacle avoidance path, and under the premise of ensuring the safety of no collision, the searched path not only meets the smoothness of the local path, but also can ensure that the newly generated local path and the global reference path do not have larger longitudinal deviation. Therefore, the method can be widely applied to the structured roads of different obstacle scenes.
Drawings
Fig. 1 is a flowchart of a method for planning a local path of a structured road according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a global reference path and obstacle information in a Cartesian coordinate system according to an embodiment of the invention;
FIG. 3 is a schematic diagram of coordinate system transformation according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a method for classifying and aggregating neighboring obstacles according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a passable area of an obstacle road section and a discrete obstacle avoidance sub-path generation method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an improved a-search algorithm for searching an obstacle avoidance sub-path according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a cubic spline interpolation curve fitting obstacle avoidance sub-path according to an embodiment of the present invention;
fig. 8 is a schematic diagram of the generation of a partial path of a structured road according to the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and examples.
As shown in fig. 1, the method for planning a local path of a structured road provided in this embodiment includes:
and S1, acquiring obstacle information, a global reference path and self-parking position information according to the environment sensing module, the decision planning module and the vehicle positioning navigation system.
As shown in fig. 2, the structured road multi-obstacle environment of the present invention is schematically illustrated, and the system input information includes pose information, obstacle information and global reference path of the own vehicle.
In a cartesian coordinate system, the obstacle obstacles (i) is represented as a rectangular box in the cartesian coordinate system, i.e. the length l of the obstacleiWidth wiAngle of orientation thetaiAnd the coordinates (x) of the center pointi,yi). The global reference path is a global path given by global planning, and is composed of continuous path points, and path points are generated without performing other recalculations (the dotted line in fig. 1 is for visually representing a path and does not contain actual path information). The coordinate of each reference path point waypoints (j) included in the global reference path is represented by (x)j,yj) The road length from the starting waypoint is denoted as siAnd the distance from the left road boundary (road boundary) is represented by lleft,jAnd the distance from the right road boundary (road boundary) is represented by lright,jThe yaw angle of the direction of travel is shown as αj. The self-parking position information comprises the current position coordinates and the yaw angle of the vehicle.
And S2, converting the obstacle information, the global reference path and the self-parking position information acquired in the S1 from a Cartesian coordinate system to a curvilinear coordinate system (hereinafter, simply referred to as "coordinate system conversion"). The coordinate system conversion refers to converting the obstacle information, the global reference path and the self-parking position information in the Cartesian coordinate system into the curve coordinate system. The horizontal axis of the curve coordinate system is the road length from each continuous path point of the global reference path to the initial path point, and the vertical axis of the curve coordinate system is the longitudinal offset from each path point.
And S3, presetting a transverse and longitudinal aggregation distance threshold, comparing the threshold with the actual transverse and longitudinal distance value between the two adjacent obstacles provided by the S2, and classifying and aggregating the two adjacent obstacles according to the comparison result. The adjacent obstacles are classified and aggregated under a curve coordinate system, so that the obstacle information needs to be subjected to coordinate conversion, a longitudinal aggregation distance threshold value L and a transverse aggregation distance threshold value R are arranged between the adjacent obstacles, and the adjacent obstacles smaller than the distance threshold value are classified and aggregated.
And S4, generating a passable area of the barrier road section and a discrete obstacle avoidance sub-path thereof according to the new barrier information classified and aggregated by the S3. For each road section containing the obstacles, a passable area of the road section of the obstacles is generated by setting a safe distance D between a vehicle and a road boundary and between the vehicle and the obstacles, and discrete obstacle avoidance sub-paths are generated by performing longitudinal equal-interval delta D discretization in the passable area.
And S5, searching the optimal obstacle avoidance sub-path of the discrete obstacle avoidance sub-paths by adopting an improved A-star search algorithm.
And S6, fitting the optimal obstacle avoidance sub-paths obtained by searching S5 by adopting a cubic spline interpolation curve to obtain continuous obstacle avoidance paths under a curve coordinate system.
And S7, converting the continuous obstacle avoidance path obtained by fitting the S6 from a curvilinear coordinate system to a Cartesian coordinate system.
In one embodiment, as shown in fig. 3, "coordinate system conversion" specifically includes the following steps:
s21, coordinate system transformation of global reference path: global reference path coordinate system conversion: by taking the road length s of each reference waypointiAs the abscissa, the left and right longitudinal offsets d of each reference path pointiAnd converting each reference path point of the global reference path in the Cartesian coordinate system into a curve coordinate system based on the global reference system as a vertical coordinate. Wherein, the coordinate (x) of each path point waypoints (j) of the global reference path in the Cartesian coordinate systemj,yj) Arc length sjDistance l from left road boundaryleft,jDistance l of right road boundary (road boundary)right,jAnd a heading angle αjDenoted as waypoints (j) ═ xj,yj,sj,lleft,j,lright,j,αj}. Each path point of the global reference path of the curved coordinate system is represented as waypoints ═ sj,lleft,j,lright,j}。
S22, converting the coordinate system of the obstacle: will be centered on the obstacle(s)i,di) The reference path point with the closest straight line distance is taken as the reference path point waypoints (j) ═ xj,yj,sj,lleft,j,lright,j,αjId is the Id number of the reference path point closest to the obstacle (each path point in the global reference path already contains its own Id information). When the obstacle information is converted from the cartesian coordinate system to the curvilinear coordinate system, the obstacle in the curvilinear coordinate system is represented as obstacles (i) { s }i,di,l′i,w′iId, the conversion calculation formula is as follows:
l′i=wi*sin(θi-αj)+li*cos(θi-αj) (1)
w′i=wi*cos(θi-αj)+li*sin(θi-αj) (2)
wherein s isiThe arc length of the reference path point closest to the obstacle; diIs the distance between the center of the obstacle and the nearest reference path point,/'iIs the length of the obstacle in the curved coordinate system, w'iIs the width of the obstacle in a curvilinear coordinate system, still appears as a rectangular box. Id is the Id number of the reference waypoint closest to the obstacle.
In one embodiment, as shown in fig. 4, the horizontal and vertical aggregation distance threshold includes a horizontal aggregation distance threshold R and a vertical aggregation distance threshold L, and the actual horizontal and vertical distance value includes an actual horizontal distance value and an actual vertical distance value, where S3 specifically includes:
and S31, taking a rectangular frame surrounded by straight lines where the transverse outer edges and the longitudinal outer edges of the two adjacent obstacles are far away from each other as a first new obstacle after transverse and longitudinal aggregation under the condition that the actual transverse distance value is smaller than the transverse aggregation distance threshold value R and the actual longitudinal distance value is smaller than the longitudinal aggregation distance threshold value L.
S32, in a case that the actual lateral distance value is smaller than the lateral convergence distance threshold R and the actual longitudinal distance value is larger than the longitudinal convergence distance threshold L, extending two lateral outer edges of one of the two adjacent obstacles respectively toward the other obstacle in the lateral direction until the two lateral outer edges are flush with the longitudinal outer edge of the other obstacle, and converging the two lateral outer edges to form a second new obstacle in a rectangular frame; in the same way, another obstacle is laterally aggregated to obtain a third new obstacle presented in a rectangular box.
The embodiment can simplify the environment of the obstacle and is beneficial to generating a continuous and smooth obstacle avoidance path. When the relative positions of the adjacent obstacles appear in the situations of S31 and S32, the obstacle avoidance sub-paths between the adjacent obstacle segments are too close to each other in the S-axis direction, and even overlap occurs in the d-axis direction, so that the continuous obstacle avoidance path of the adjacent obstacle segments has poor smoothness and even cannot generate the continuous obstacle avoidance path. In the obstacle environment after polymerization of the polymerization model, the distances between adjacent obstacles in the directions of the s axis and the d axis are both proper, so that a continuous and smooth obstacle avoidance path can be generated.
In one embodiment, in S31, the two adjacent obstacles include:
the first obstacle is represented as obstacles (1) ═ s1,d1,l1,w1,Id1};
The second obstacle is represented as obstacles (2) ═ s2,d2,l2,w2,Id2};
The first new obstacle is denoted as obstacles '(1) ═ s'1,d′1,l′1,w′1,Id′1}, wherein:
s′1=0.5*(min{s1+0.5*w1,s1-0.5*w1,s2+0.5*w2,s2-0.5* (3)
w2}+max{s1+0.5*w1,s1-0.5*w1,s2+0.5*w2,s2-0.5*w2})
d′1=0.5*(min{d1+0.5*h1,d1-0.5*h1,d2+0.5*h2,d2-0.5* (4)
h2}+max{d1+0.5*h1,d1-0.5*h1,d2+0.5*h2,d2-0.5*h2})
l′1=|s2-s1|+0.5*(l2+l1) (5)
w′1=|d2-d1|+0.5*(w2+w1) (6)
in one embodiment, the two adjacent obstacles comprise:
the third obstacle is represented by obstacles (3) ═ s3,d3,l3,w3,Idx3};
The fourth obstacle is represented by obstacles (4) ═ s4,d4,l4,w4,Idx4};
The second new obstacle is represented by obstacles '(3) ═ s'3,d′3,l′3,w′3,Id′3}, wherein:
s′3=0.5*(s3+s4) (7)
d′3=d3(8)
l′3=0.5*(l3+l4)+|s3+s4| (9)
w′3=w3(10)
the third new obstacle obstacles '(4) ═ s'4,d′4,l′4,w′4,Id′4}, wherein:
s′4=0.5*(s3+s4) (11)
d′4=d4(12)
l′4=0.5*(l3+l4)+|s3+s4| (13)
w′4=w4(14)
in one embodiment, as shown in fig. 5, in S4, the generating of the obstacle section passable region and the generating of the discrete obstacle avoidance sub-path specifically include:
and S41, generating accessible areas of the road sections of the obstacles by setting safe distances D between vehicles and road boundaries and the obstacles for the aggregated road sections containing new obstacles in the S3.
And S42, discretely generating the discrete obstacle avoidance sub-paths through longitudinal equal spacing delta d in the passable area of each obstacle section.
In one embodiment, as shown in fig. 6, in S5, the improved a-algorithm searches for the obstacle avoidance sub-path by using the longitudinal offset between the discrete obstacle avoidance sub-paths in the curved coordinate system as a parameter of the calculation heuristic function. The method comprises the steps that an improved A-star search algorithm is adopted to conduct obstacle avoidance sub-path search on discrete obstacle avoidance sub-paths, and is different from a traditional A-star algorithm in that the traditional A-star algorithm uses distances as parameters of a calculation heuristic function, and the improved A-star algorithm uses longitudinal offset between the discrete obstacle avoidance sub-paths as parameters of the calculation heuristic function; secondly, the traditional a-algorithm is generally used for uniformly and discretely occupying a grid map, and the improved a-algorithm searches for an obstacle avoidance sub-path in a discrete obstacle avoidance sub-path in a passable area of an adjacent obstacle road section to obtain an optimal obstacle avoidance sub-path of each obstacle road section. S5 specifically includes:
said modified a algorithm uses the longitudinal offset between each of said obstacle avoidance sub-paths as a parameter for calculating a heuristic function, the heuristic function fiThe specific calculation formula is as follows:
fi=w1*gi+w2*hi(17)
wherein d isiThe longitudinal coordinate of the current obstacle avoidance sub-path endpoint is taken as the longitudinal coordinate; di-1The vertical coordinate of the optimal obstacle avoidance sub-path end point of the previous obstacle road section; | di-di-1I is the longitudinal offset between the current obstacle avoidance sub-path and the optimal obstacle avoidance sub-path of the last obstacle road section; siThe horizontal coordinate of the left end point of the current obstacle avoidance sub-path is taken as the horizontal coordinate; si-1The abscissa of the right end point of the optimal obstacle avoidance sub-path of the previous obstacle road section; dgoalCoordinates of the target point goal in the direction of the d axis (vertical axis); lleftIndicating the distance of the obstacle from the left road boundary,/rightRepresenting the distance of the obstacle from the right road boundary; function hiThe longitudinal offset between the current obstacle avoidance sub-path and the target point is adopted. Heuristic function fiAs a function g of different weightsiAnd function hiSumming; weight coefficient w1And w2The sum is always 1.
Function giRepresents: the sum of the longitudinal offset between the starting point and the optimal obstacle avoidance sub-path of the first obstacle road section, the accumulation of the longitudinal offset between each adjacent optimal obstacle avoidance sub-path between the starting point and the current obstacle avoidance sub-path, and the longitudinal offset between the current obstacle avoidance sub-path and the most obstacle avoidance sub-path of the last obstacle road section; function gi-1Represents: the sum of the longitudinal offset between the starting point and the optimal obstacle avoidance sub-path of the first obstacle road section and the sum of the longitudinal offsets between the starting point and each adjacent optimal obstacle avoidance sub-path between the current obstacle avoidance sub-path; the starting point is the starting point of the local path, local obstacle avoidance path planning is carried out from the starting point, and the vehicle does not travel according to the global reference path any more.
And calculating the cost f of each obstacle avoidance sub-path through the above formula, and selecting the obstacle avoidance sub-path with the minimum f value as the optimal obstacle avoidance sub-path.
In one embodiment, as shown in fig. 7, since the optimal obstacle avoidance sub-path obtained by the search in S5 is not continuous, it is necessary to adopt a cubic spline interpolation curve in S6 to fit each obstacle avoidance sub-path, so as to generate a local path. By setting the end point coordinate point (i-1) of the adjacent obstacle avoidance path to { s }i-1,di-1,Idi-1}、point(i)={si,di,IdiSubstituting the angle tangent value (first derivative) of the point and the endpoint into a cubic spline interpolation curve equation and a first derivative expression, converting into a matrix form, obtaining a cubic spline curve function expression fitting each adjacent obstacle avoidance sub-path, and generating a continuous local path through equidistant interpolation. The interpolation fitting method in S6 is specifically as follows:
end point (i-1) { s) through adjacent obstacle avoidance pathsi-1,di-1,Idi-1}、point(i)={si,di,IdiSubstituting the coordinate of the point and the angle tangent value of the endpoint into a cubic spline interpolation curve equation and a first derivative equation and converting into a matrix form to obtain:
in the formula (19), diThe longitudinal coordinate of the current obstacle avoidance sub-path endpoint is taken as the longitudinal coordinate; di-1The vertical coordinate of the optimal obstacle avoidance sub-path end point of the previous obstacle road section; siThe horizontal coordinate of the left end point of the current obstacle avoidance sub-path is taken as the horizontal coordinate; si-1The abscissa of the right end point of the optimal obstacle avoidance sub-path of the previous obstacle road section; a. b, c and d are parameters to be calculated.
And (3) obtaining a cubic spline function expression (20) fitting each adjacent obstacle avoidance path according to a, b, c and d obtained by calculation of the expression (19):
f(s)=a*(s-si-1)3+b*(s-si-1)2+c*(s-si-1)1+d (20)
in the formula (20), the independent variable s of f(s) is the continuous obstacle avoidance path pointThe abscissa value has a value in the range of(s)i-1,si) (ii) a By interpolating Δ s at equal intervals, successive obstacle avoidance path points waypoints (j) ═ Id in the curve coordinate system can be obtainedj,sj,dj,αj},IdjAn ID number representing a global reference waypoint closest to the obstacle avoidance waypoint; sj、djRespectively representing the abscissa and ordinate of the obstacle avoidance waypoint αjAnd the size of the tangential angle of the obstacle avoidance path point is shown.
In one embodiment, S7 specifically includes:
according to the nearest reference path point waypoints (j) ═ xj,yj,sj,lleft,j,lright,j,αjAnd (d) continuously avoiding barrier path points waypoints (i) ═ Id in the curve coordinate systemi,si,di,αiReverting to the Cartesian coordinate system:
x=xj-di*sin(αj) (21)
y=yj+di*cos(αj) (22)
θ=αj+αi(23)
and obtaining the path points waypoints ═ { x, y, theta }, which are continuous obstacle avoidance paths in a Cartesian coordinate system.
Fig. 8 shows a schematic diagram for generating a local path of a structured road according to an embodiment of the present invention, where a weight coefficient w is adjusted in a structured road with multiple obstacles1And w2Different obstacle avoidance paths can be generated, wherein the paths ①, ② and ③ are obstacle avoidance paths generated under different weight coefficients, it can be seen from fig. 8 that the local path generated by the local path planning of the present invention realizes two points:
firstly, continuous obstacle avoidance is realized under the environment of multiple obstacles on a structured road.
And secondly, generating an obstacle avoidance sub-path in the passable area, and effectively planning a collision-free local path.
And thirdly, the local path planning result can be ensured to simultaneously meet the requirements of smoothness of the obstacle avoidance path and small offset between the obstacle avoidance path and the global reference path by adjusting a proper weight coefficient.
Finally, it should be pointed out that: the above examples are only for illustrating the technical solutions of the present invention, and are not limited thereto. Those of ordinary skill in the art will understand that: modifications can be made to the technical solutions described in the foregoing embodiments, or some technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.