Disclosure of Invention
The invention aims to provide a method for planning a full-coverage cleaning path of a multi-communication area of an unmanned sweeper, aiming at the technical defects in the prior art.
Therefore, the invention provides a method for planning a full-coverage cleaning path of a multi-communication area of an unmanned sweeper, which comprises the following steps:
step S1, regarding the annular area containing the object, the inner ring and the outer ring are respectively represented by polygons;
step S2, when the inner ring polygon and the outer ring polygon of the annular region are equidistant polygons, judging that the annular region is a regular annular region, and executing step S3, wherein the full-coverage broken line path of the regular annular region obtained in step S3 is the full-coverage broken line path of the whole annular region, otherwise, judging that the annular region is an irregular annular region, and executing step S4;
step S3, executing the full-coverage planning operation of the regular annular area to obtain a full-coverage broken line path of the regular annular area;
step S4, executing splitting operation of the irregular annular region, splitting the irregular annular region into a regular annular region and a pipeline region, wherein the regular annular region and the pipeline region have an intersection point, then executing the regular annular region full-coverage planning operation of the step S3 on the regular annular region to obtain a full-coverage broken line path of the regular annular region, and then executing the step S5 on the pipeline region to obtain a full-coverage broken line path of the pipeline region;
step S5, executing the pipeline area full-coverage planning operation to obtain the full-coverage broken line path of the pipeline area;
step S6, the full-coverage broken line path of the regular annular region obtained in step S4 and the full-coverage broken line path of the pipe region obtained in step S5 are spliced together by the intersection point of the regular annular region and the pipe region, a broken line segment connecting the intersection point in the regular annular region and a broken line segment connecting the intersection point in the pipe region, to obtain a full-coverage broken line path of the entire annular region as the irregular annular region.
In step S2, when all the sides of the inner ring polygon of the ring-shaped region are parallel to all the sides of the outer ring polygon of the ring-shaped region in a one-to-one correspondence and have equal distances, the inner ring polygon and the outer ring polygon of the ring-shaped region are equidistant polygons.
Wherein, in step S4, the irregular annular region a includes an inner annular polygon a1 and an outer annular polygon a 2;
the regular annular region B includes an inner annular polygon B1 and an outer annular polygon B2;
the pipe region C includes an inner ring polygon C1 and an outer ring polygon C2;
wherein, the outer ring polygon a2 of the irregular ring-shaped area a is taken as the outer ring polygon B2 of the regular ring-shaped area B, namely, is the same polygon;
the inner ring polygon B1 of the regular ring region B is an equidistant polygon from the outer ring polygon B2 of the regular ring region B.
Wherein, in step S4, the inner ring polygon B1 of the regular ring-shaped region B is the outer ring polygon C2 of the pipe region C;
the outer ring polygon C2 of the pipe region C intersects the inner ring polygon C1 of the pipe region C, and there is at least one intersecting boundary point, i.e., an intersection point, between the two.
Wherein the step S3: executing a regular annular region full-coverage planning operation to obtain a full-coverage broken line path of the whole regular annular region, and specifically comprising the following substeps:
step S31, taking the outer ring polygon B2 of the regular ring-shaped area B as a reference, taking the fixed width as a unit, performing equal-width translation in the direction of the inner ring polygon B1 of the regular ring-shaped area B to obtain a cluster of equidistant polygons, and stopping the equal-width translation until finally reaching the inner ring polygon B1 of the innermost layer;
and step S32, selecting a position point on the outer ring polygon B2 of the regular annular region B, the cluster of equidistant polygons obtained in the step S31 and the inner ring polygon B1 respectively, and then performing linear connection in sequence to finally obtain a full-coverage broken line path of the whole regular annular region.
For step S32, the specific operation includes the following steps:
for a plurality of polygons distributed from outside to inside, firstly, connecting the tail point and the head point of the initial polygon as a first section of broken line, and then sequentially connecting other vertexes of the initial polygon from the head point of the initial polygon until the polygons are connected to the tail point;
then, for other polygons positioned between the initial polygon and the last polygon, according to the sequence from inside to outside, for each polygon, selecting the head point on the polygon to be connected with the tail point of the last polygon, then starting from the head point, sequentially connecting the head point to the tail point, and linearly connecting the tail point with the head point of the next polygon;
then, for the last polygon, connecting the head point of the last polygon with the tail point of the last polygon, then sequentially connecting the head point of the last polygon to the tail point until the tail point and the head point are connected to be used as the last section of broken line, and finally obtaining the full-coverage broken line path of the whole regular annular area;
wherein the initial polygon, i.e., the outer ring polygon B2 that is the regular ring region B;
the last polygon, inner ring polygon B1, is regular annular region B.
Wherein the step S5: executing a pipeline region full-coverage planning operation to obtain a full-coverage broken line path of the whole pipeline region, and specifically comprising the following substeps:
step S51, skeleton extraction: triangulation is carried out on the whole pipeline area C, the pipeline area C is split into a plurality of adjacent triangles, then the middle points of the bridging sides of all the triangles are sequentially connected, and the dividing points of the pipeline area are connected with the middle points of the bridging sides of the adjacent triangles to obtain a central skeleton line L1 of the pipeline area;
step S52, skeleton expansion: taking a central skeleton line L1 of the pipeline area as a base line, respectively performing equal-width translation on the inner side and the outer side of the pipeline area until the inner side and the outer side of the pipeline area are respectively translated to an outer ring polygon C2 of the pipeline area C, so as to obtain an inner cluster of folded line segments L2 which are positioned on the inner side and the outer side of the central skeleton line L1 and are parallel to the central skeleton line, then splicing the inner cluster of folded line segments L2 and the outer cluster of folded line segments L2 from inside to outside, and finally obtaining a full-coverage folded line segment path of the whole pipeline area C.
After step S6, the method further includes the following steps:
and step S7, executing a path smoothing optimization operation, and performing smoothing optimization processing on the splicing position of every two broken line segments in the regular annular area and the pipeline area, so that the full-coverage broken line path of the whole annular area meets the curvature requirement of vehicle driving, namely meets the constraint of vehicle kinematics.
Wherein the step S7: executing smooth optimization operation of a path, and performing smooth optimization processing on the splicing position of every two broken line segments in the regular annular area and the pipeline area, wherein the smooth optimization processing specifically comprises the following steps:
step S71, in the full-coverage broken line segment path of the whole irregular annular area, the circular arc line M is respectively used as the path to carry out smoothing treatment on the left side and the right side of the splicing position of every two broken line segments, and the broken line between the two ends of the circular arc line is not used as the path;
and step S72, carrying out pure tracking algorithm operation on the smooth-processed full-coverage broken line segment path of the whole irregular annular area, further optimizing the whole path, realizing path tracking control of the vehicle, enabling the whole path to meet vehicle kinematic constraints, and finally obtaining the further-optimized full-coverage path of the whole irregular annular area.
Compared with the prior art, the multi-communication-region full-coverage cleaning path planning method for the unmanned sweeper, provided by the invention, has the advantages that the geometric characteristics of the regular annular region and the pipeline region are utilized to describe the trend of the full-coverage path, the full coverage of the region is ensured, the kinematic constraint of the vehicle is fully considered, the effectiveness of the generated path can be ensured, the application of the method is in line with the normal cleaning habit of the sweeper, and the method has great practical significance.
The invention mainly aims at annular multi-communication areas similar to flower beds, realizes path planning through area splitting and geometric characteristics of sub-areas, ensures path effectiveness and meets normal cleaning habits.
Detailed Description
In order that those skilled in the art will better understand the technical solution of the present invention, the following detailed description of the present invention is provided in conjunction with the accompanying drawings and embodiments.
The invention provides a method for planning a full-coverage cleaning path of a multi-communication area of an unmanned sweeper, which mainly aims at an annular area, and particularly can be a multi-communication area similar to an annular shape. The whole full-coverage path planning method comprises four parts of contents, including region splitting, regular annular region full-coverage planning, pipeline region full-coverage planning and path optimization smoothing. The implementation flow of the whole method is shown in fig. 1.
Referring to fig. 1, the invention provides a method for planning a full-coverage cleaning path of a multi-communication area of an unmanned sweeper, which comprises the following steps:
step S1, for an annular area containing an object (e.g., a building, a flower bed), an inner ring and an outer ring thereof are respectively represented by polygons;
in the present invention, it should be noted that the present invention is directed to: the input is the annular area generated by the polygon, that is, for the annular area containing objects (such as buildings and flower beds), the outer boundary and the inner boundary of the area are drawn as polygons, that is, both are represented by the polygons, and then the invention performs the full coverage planning for the polygons. Thus, even for a flower bed-like annular area, it is depicted in a polygonal format.
Step S2, when the inner ring polygon and the outer ring polygon of the annular region are equidistant polygons, judging that the annular region is a regular annular region, and executing step S3, wherein the full-coverage broken line path of the regular annular region obtained in step S3 is the full-coverage broken line path of the whole annular region, otherwise, judging that the annular region is an irregular annular region, and executing step S4;
in the present invention, in step S2, it should be noted that, if the corresponding sides of the inner ring polygon and the outer ring polygon are parallel to each other and the distances between the corresponding sides are equal, the two polygons (i.e., the inner ring polygon and the outer ring polygon) can be considered as equidistant polygons.
Step S3, executing the full-coverage planning operation of the regular annular area to obtain a full-coverage broken line path of the regular annular area;
step S4, executing splitting operation of the irregular annular region, splitting the irregular annular region into a regular annular region and a pipeline region, wherein the regular annular region and the pipeline region have an intersection point, then executing the regular annular region full-coverage planning operation of the step S3 on the regular annular region to obtain a full-coverage broken line path of the regular annular region, and then executing the step S5 on the pipeline region to obtain a full-coverage broken line path of the pipeline region;
step S5, executing the pipeline area full-coverage planning operation to obtain the full-coverage broken line path of the pipeline area;
step S6, the full-coverage broken line path of the regular annular region obtained in step S4 and the full-coverage broken line path of the pipe region obtained in step S5 are pieced together, through the intersection point of the regular annular region and the pipe region (i.e., the demarcation point D shown in fig. 5), a broken line segment connecting the intersection point in the regular annular region and a broken line segment connecting the intersection point in the pipe region, to obtain a full-coverage broken line path of the entire annular region as the irregular annular region, see fig. 7.
It should be noted that, with the present invention, the unmanned sweeping vehicle travels in the annular area according to the full-coverage broken-line path of the entire annular area obtained in step S6, so as to ensure the cleaning full coverage of the annular area and ensure a good cleaning effect.
In the present invention, in a specific implementation, the annular region mainly includes an inner ring and an outer ring, both of which are represented by polygons. The inner and outer ring polygons of the majority of the ring-shaped regions are not equidistant. If the two polygons are equidistant, the region is considered to be a regular annular region, and the full-coverage planning operation of the regular annular region in the step S3 is directly performed; if the two polygons are not equidistant, the region is considered to be an irregular annular region, and the irregular annular region needs to be split into a regular annular region and a pipeline region (i.e., step S4 is executed), as shown in fig. 2, the irregular annular region a is split into a regular annular region B and a pipeline region C.
In the present invention, in step S2, in a concrete implementation, when all sides of the inner ring polygon of the ring-shaped region are parallel to all sides (i.e., line segments) of the outer ring polygon of the ring-shaped region respectively, and have equal distances, the inner ring polygon and the outer ring polygon of the ring-shaped region are equidistant polygons. In addition, the judgment principle of equidistant polygons in other steps is the same.
In the present invention, in a concrete implementation, in step S4, referring to fig. 2, the irregular annular region a includes an inner-ring polygon a1 and an outer-ring polygon a 2;
the regular annular region B includes an inner annular polygon B1 and an outer annular polygon B2;
the pipe region C includes an inner ring polygon C1 and an outer ring polygon C2;
wherein, the outer ring polygon a2 of the irregular ring-shaped area a is taken as the outer ring polygon B2 of the regular ring-shaped area B, namely, is the same polygon;
the inner ring polygon B1 of the regular ring region B is an equidistant polygon from the outer ring polygon B2 of the regular ring region B. The method specifically comprises the following steps: all the edges of the inner ring polygon of the regular ring-shaped area are respectively parallel to all the edges (namely line segments) of the outer ring polygon of the regular ring-shaped area in a one-to-one correspondence mode, and the distances are equal.
In particular, in step S4, the inner ring polygon B1 of the regular ring-shaped region B is the outer ring polygon C2 of the pipe region C;
the outer ring polygon C2 of the pipe region C intersects the inner ring polygon C1 of the pipe region C, and there is at least one intersecting boundary point, i.e., an intersection point, between the two.
In a specific implementation of the present invention, the step S3: executing a regular annular region full-coverage planning operation to obtain a full-coverage broken line path of the whole regular annular region, and specifically comprising the following substeps:
step S31, referring to fig. 3, taking the outer ring polygon B2 of the regular ring-shaped area B as a reference, and taking a fixed width as a unit, performing equal width translation (i.e. equal width retraction) in the direction of the inner ring polygon B1 of the regular ring-shaped area B to obtain a cluster (i.e. a plurality of) equidistant polygons, and stopping the equal width translation until finally reaching the innermost inner ring polygon B1;
in step S32, referring to fig. 4, a position point is selected from the outer ring polygon B2 of the regular annular region B, the cluster (i.e., the plurality) of equidistant polygons obtained in step S31, and the inner ring polygon B1, and then the positions are connected in a straight line in sequence, so as to finally obtain the full-coverage polygonal line path of the whole regular annular region.
It should be noted that the full coverage polyline path of the whole regular annular area: the line segments of polygons such as the outer ring polygon B2, the cluster (i.e., the plurality) of equidistant polygons obtained in step S31, and the inner ring polygon B1 are included in addition to the connecting lines between the above-described position points.
Referring to fig. 4, for the present invention, since a plurality of groups of polygons are obtained before, taking fig. 4 as an example, specifically: after 5 groups of polygons are counted, as shown in fig. 4, the following steps are performed in sequence for step S32 in the present invention, including polygons including vertices such as P11, P12, P13, P14, and P15, polygons including vertices such as P21, P22, P23, P24, and P25, polygons including vertices such as P31, P32, P33, P34, and P35, polygons including vertices such as P41, P42, P43, P44, and P45, and polygons including vertices such as P51, P52, P53, P54, and P55:
for a plurality of polygons distributed from outside to inside, firstly, connecting the tail point (namely the vertex at the end) and the head point (the vertex at the beginning) of the initial polygon (namely the outer ring polygon B2 of the regular ring-shaped area B) as a first section of broken line, and then sequentially connecting other vertexes of the initial polygon from the head point of the initial polygon until connecting to the tail point;
then, for other polygons located between the initial polygon (i.e., the outer ring polygon B2 of the regular ring region B) and the last polygon (i.e., the inner ring polygon B1 of the regular ring region B), selecting, for each polygon, in order from inside to outside, a leading point thereon to be connected to a trailing point of the last polygon, then starting from the leading point thereof, connecting to the trailing point thereof in sequence, and connecting the trailing point thereof to a leading point of the next polygon in a straight line;
then, for the last polygon (i.e. the inner ring polygon B1 of the regular ring-shaped area B), the head point of the last polygon is connected with the tail point of the last polygon, and then the last polygon is connected with the tail point in sequence from the head point until the tail point and the head point are connected as the last segment of the polyline finally, so as to prevent missing scanning, and finally, the full-coverage polyline path of the whole regular ring-shaped area can be obtained. This results in the broken line segments in fig. 4 in the order: p and P-line- > P and 4P-line- > P and P-line- > P33 and P-line- > P and P-line- >.
In the present invention, it should be noted that, in step S32, the "selected position point" is actually the position where two adjacent polygons are sequentially connected, i.e., the last point of the previous polygon and the first point of the next polygon, i.e., the P15 and P21 position points, the P25 and P31 position points, the P35 and P41 position points, and the P45 and P51 position points.
It should be noted that, for the present invention, in the regular annular region obtained after the region splitting, the inner ring polygon and the outer ring polygon are equidistant, and the full coverage planning includes two parts: the first part is a polygon retraction: and taking the outer ring polygon as a reference, and taking the fixed width as a unit, and carrying out retraction on the polygon to obtain a cluster of equally spaced polygons until finally reaching the inner ring polygon at the innermost layer. The second part is path splicing, one position point is selected in an outer ring polygon of the regular annular area, corresponding position points are sequentially selected in adjacent equidistant polygons, and straight line connection is sequentially carried out, so that the full-coverage broken line path of the whole regular annular area can be obtained.
In a specific implementation of the present invention, the step S5: executing a pipeline region full-coverage planning operation to obtain a full-coverage broken line path of the whole pipeline region, and specifically comprising the following substeps:
step S51, skeleton extraction: referring to fig. 5, the whole pipeline region C is triangulated, the pipeline region C is split into a plurality of adjacent triangles, then the midpoints of the bridging sides of the triangles are sequentially connected, and the dividing point of the pipeline region is connected with the midpoints of the bridging sides of the adjacent triangles, so that a central skeleton line L1 of the pipeline region is obtained, which represents the basic trend of the pipeline region C.
The dividing point D of the duct area is an intersection point where the outer ring polygon C2 of the duct area C intersects with the inner ring polygon C1 of the duct area C.
It should be noted that, in the pipe area C obtained after the area splitting, it can be considered that both ends of the pipe (i.e., the outer ring polygon C2 and the inner ring polygon C1 of the pipe area C) are fixed on the same vertex, which is called a dividing point D, as shown in fig. 5.
Step S52, skeleton expansion: taking the central skeleton line of the pipeline area as a base line, respectively performing equal-width translation on the inner side and the outer side of the pipeline area until the inner side and the outer side of the pipeline area are respectively translated to an outer ring polygon C2 (namely the outermost edge) of the pipeline area C, so as to obtain inner and outer clusters (a plurality of each cluster) of broken line segments L2 which are positioned on the inner side and the outer side of the central skeleton line L1 and are parallel to the central skeleton line L1, then splicing the inner and outer clusters of broken line segments L2 from inside to outside (specifically, by using a line segment which the outer ring polygon C2 of the pipeline area C and the inner ring polygon C1 of the pipeline area C have, namely a polygon edge), and finally obtaining a full-coverage broken line segment path of the whole pipeline area C.
In the present invention, it should be noted that, the full coverage broken line path segment of the whole duct area C: the three-dimensional skeleton line mainly comprises the central skeleton line L1 and an inner and outer two-cluster broken line segment L2. As for the outer ring polygon and the inner ring polygon, the polygon can be regarded as a component of a full-coverage broken line path in an inner cluster broken line segment and an outer cluster broken line segment.
In the present invention, in a specific implementation, the skeleton extraction method of the pipeline region in step S51 may also be implemented in a form of voronoi algorithm or distance transformation.
In step S6, it should be noted that, for the present invention, after obtaining the full-coverage broken line path of the two sub-areas, namely the regular annular area and the pipe area, for the irregular annular area, the intersection point of the two sub-areas, namely the dividing point of the pipe area, is found, and the two broken line segments are spliced together to obtain the full-coverage broken line path of the entire irregular annular area.
In the present invention, regarding step S6, it should be noted that, a broken line segment in the regular annular region and a broken line segment in the pipe region adjacent to the broken line segment are the following two broken line segments: the broken line segment obtained from the regular annular region and the broken line segment obtained from the pipeline region finally return to the inner annular polygon B1 of the regular annular region B, and the broken line segment of the pipeline region C passes through the boundary point of the pipeline region C (i.e., the inner annular polygon B1 of the regular annular region B and also serves as the outer annular polygon C2 of the pipeline region C), so that the two regions of the regular annular region and the pipeline region can be connected together by the boundary point (i.e., the boundary point of the pipeline region C), that is, a broken line segment connecting the intersection point (boundary point) in the regular annular region and a broken line segment (i.e., two broken line segments) connecting the intersection point (boundary point) in the pipeline region are spliced together.
In a specific implementation of the present invention, after step S6, the method further includes the following steps:
and step S7, executing a path smoothing optimization operation, and performing smoothing optimization processing on the splicing position (namely the broken line position) of every two broken line sections in the regular annular area and the pipeline area, so that the full-coverage broken line path of the whole annular area meets the curvature requirement of vehicle driving, namely meets the constraint of vehicle kinematics.
In the present invention, in terms of specific implementation, the method for optimizing and smoothing the path mentioned in step S7 of the present invention may also be implemented by using a moving average or spline fitting method.
In a specific implementation of the present invention, the step S7: executing a path smoothing optimization operation, and performing smoothing optimization processing on the splicing position (namely a broken line position and a broken point position) of every two broken line sections in the regular annular area and the pipeline area, wherein the path smoothing optimization operation specifically comprises the following steps:
step S71, referring to fig. 8, in the full-coverage broken line segment path of the entire irregular annular region, at the left and right sides of the joint (i.e., broken line, broken point) of every two broken line segments, the circular arc line M is used as the path to perform smoothing processing, and the broken line between the two ends of the circular arc line is no longer used as the path;
and step S72, performing pure tracking (pure pursuit) algorithm (existing vehicle path tracking control algorithm) operation on the full-coverage broken line segment path of the whole irregular annular area after smoothing processing, further optimizing the whole path, realizing vehicle path tracking control, enabling the whole path to meet vehicle kinematic constraint, and finally obtaining the further-optimized full-coverage path of the whole irregular annular area.
It should be noted that, after the full-coverage broken line path of the entire irregular annular area is finally obtained, the invention performs two parts of processing on the broken line segment: firstly, finding out all folding points of a path, and smoothly optimizing the folding line positions by utilizing arcs on the left side and the right side of the folding points; and secondly, performing pure tracking algorithm operation on the whole path from the starting point of the smoothed path, further optimizing the whole path to meet the vehicle kinematics constraint, and finally obtaining a further optimized full-coverage path of the whole area.
Based on the technical scheme, the kinematic constraint of the vehicle is considered in the path planning during the design, so that the normal running of the path is ensured. Meanwhile, the idea of area splitting and sub-area path translation of the annular area is adopted, and the full coverage of the area and the reasonability of the path are also ensured.
Compared with the prior art, the unmanned sweeper full-coverage sweeping path planning method for the multi-communication area has the following beneficial technical effects:
1. the full-coverage path planning method provided by the invention describes the trend of the full-coverage path by using the geometric characteristics of the regular annular area and the pipeline area, ensures the full coverage of the area, and simultaneously conforms to the normal cleaning habit.
2. The planning method designed by the invention meets the curvature requirement of vehicle running, fully considers the kinematic constraint of the vehicle and can ensure the effectiveness of generating the path.
In summary, compared with the prior art, the method for planning the full-coverage cleaning path of the multi-communication area of the unmanned sweeper provided by the invention describes the trend of the full-coverage path by utilizing the geometric characteristics of the regular annular area and the pipeline area, ensures the full coverage of the area, fully considers the kinematic constraint of the vehicle, and can ensure the effectiveness of the generated path.
The invention mainly aims at annular multi-communication areas similar to flower beds, realizes path planning through area splitting and geometric characteristics of sub-areas, ensures path effectiveness and meets normal cleaning habits.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.