Cleaning robot path planning method and cleaning robotTechnical Field
The invention relates to the field of cleaning robots, in particular to a cleaning robot path planning method and a cleaning robot.
Background
Automatic cleaning robots do not require manual operation and can work continuously, and are widely used, for example, household floor sweeping robots. The automatic cleaning robot can automatically scan the surrounding environment during working, a cleaning path is generated according to a cleaning strategy, repeated cleaning and omission cleaning are easy to occur in the existing cleaning strategy, and the cleaning effect is poor.
Disclosure of Invention
The present invention provides a cleaning robot path planning method and a cleaning robot, aiming at the above-mentioned defects of the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: a cleaning robot path planning method is constructed, and the method comprises the following steps:
a. acquiring a target cleaning area: the cleaning robot cleans a circle along the area to be cleaned from the initial starting point to obtain a target cleaning area;
b. determining a preferential cleaning direction: defining a direction of the cleaning robot to a nearest boundary as a preferential sweeping direction, wherein the nearest boundary is a boundary closest to the cleaning robot among boundaries of the target sweeping area, and the nearest boundary is located at one side of a bow-shaped path of the cleaning robot;
c. planning a cleaning path: in each round of path planning, the cleaning robot starts from a cleaning starting point to clean an uncleaned area on one side of the preferential cleaning direction, and cleans the uncleaned area on the opposite side of the preferential cleaning direction after the cleaning on one side of the preferential cleaning direction is finished.
Further, in the path planning method for a cleaning robot according to the present invention, in the step a:
if the initial starting point of the cleaning robot is on the boundary of the area to be cleaned, the cleaning robot starts from the initial starting point and cleans a circle along the area to be cleaned to obtain a target cleaning area;
if the initial starting point of the cleaning robot is not on the boundary of the area to be cleaned, the cleaning robot firstly drives to the boundary of the area to be cleaned according to a preset direction, and then cleans a circle along the boundary of the area to be cleaned to obtain a target cleaning area.
Further, in the path planning method for a cleaning robot according to the present invention, the nearest boundary determining method in step b includes:
selecting a boundary closer to the initial starting point from a left boundary and a right boundary of the target cleaning region as the nearest boundary if the bow-shaped path of the cleaning robot is a vertically reciprocating row bow shape;
and selecting a boundary closer to the initial starting point from the upper boundary and the lower boundary of the target cleaning region as the nearest boundary if the zigzag path of the cleaning robot is a line zigzag path reciprocating left and right.
Further, in the path planning method for a cleaning robot according to the present invention, in the step c:
if the zigzag path of the cleaning robot is in a row zigzag shape, the cleaning robot cleans an uncleaned area on one side of the row corresponding to the preferential cleaning direction from a cleaning starting point;
if the zigzag path of the cleaning robot is in a row zigzag shape, the cleaning robot starts from the cleaning starting point to clean an uncleaned area on the side of the row corresponding to the preferential cleaning direction.
Further, in the cleaning robot path planning method according to the present invention, for a cleaning robot in a shape of a Chinese character 'ji', if there is an area that is not cleaned after each round of cleaning, a cleaning start point for a new round of cleaning is selected according to a column-near rule, where the column-near rule is:
judging whether the cleaning robot can reach an uncleaned area without encountering obstacles along the current row;
if so, selecting an uncleaned point which is positioned in an uncleaned area in the current row and is closest to the cleaning robot as the cleaning starting point;
if not, judging whether the next row can reach the non-cleaning area without encountering the obstacle one by one from the current row until the row which can reach the non-cleaning area without encountering the obstacle is selected, and then selecting the non-cleaning point which is positioned in the non-cleaning area and is closest to the cleaning robot in the row as the cleaning starting point.
Further, in the cleaning robot path planning method according to the present invention, for a cleaning robot in a line-bow shape, if there is an uncleaned area after each round of cleaning, a cleaning start point for a new round of cleaning is selected according to a near-by rule, where the near-by rule is:
judging whether the cleaning robot can reach an uncleaned area without meeting obstacles along the current row;
if so, selecting an uncleaned point which is positioned in an uncleaned area in the current row and is closest to the cleaning robot as the cleaning starting point;
if not, judging whether the next row can reach the non-cleaning area without encountering the obstacle one by one from the current row until the row which can reach the non-cleaning area without encountering the obstacle is selected, and then selecting the non-cleaning point which is positioned in the non-cleaning area and is closest to the cleaning robot in the row as the cleaning starting point.
Further, in the cleaning robot path planning method according to the present invention, after a cleaning start point for a new cleaning round is selected, the cleaning robot extends the zigzag path in the preferential cleaning direction from the cleaning start point to perform cleaning.
Further, in the method for planning a path of a cleaning robot according to the present invention, if the cleaning robot encounters an obstacle during cleaning, a circle is cleaned along the obstacle, an area occupied by the obstacle is marked as an uncleanable area, and the cleaning robot continues to complete cleaning on one side of the obstacle.
Further, in the cleaning robot path planning method of the present invention, after the cleaning robot continues to complete cleaning on the obstacle side,
if the zigzag path of the cleaning robot is in a row zigzag shape, selecting a cleaning starting point of a new round of cleaning according to the row proximity principle;
and if the zigzag path of the cleaning robot is in a row zigzag shape, selecting a cleaning starting point of a new round of cleaning according to the row proximity principle.
In addition, the invention also provides a cleaning robot, which comprises a memory and a processor, wherein the memory is used for storing the computer program;
the processor is configured to execute the computer program stored in the memory to implement the cleaning robot path planning method as described above.
The cleaning robot path planning method and the cleaning robot have the following beneficial effects that: according to the invention, after the target cleaning area is determined, the cleaning direction is selected according to the position of the cleaning robot and the target cleaning area, so that the cleaning path can be optimized, and the cleaning efficiency is improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a flowchart of a cleaning robot path planning method provided in embodiment 1;
FIG. 2 is a schematic view of an initial position of the cleaning robot provided in embodiment 1;
FIG. 3 is a schematic view of the upper and lower reciprocating proximal boundaries of the Chinese character 'zhuyin' type provided in example 1;
FIG. 4 is a schematic view of the right and left reciprocating side-by-side column Chinese character type nearest boundary provided in example 1;
FIG. 5 is a schematic illustration of the column proximity principle provided in example 1;
fig. 6 is a schematic diagram of a path plan including obstacles provided in embodiment 1.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
Example 1
Referring to fig. 1, the cleaning robot path planning method of the embodiment is applied to a cleaning robot, which can automatically complete cleaning work in a certain area, that is, can automatically plan a path to perform cleaning work without the participation of workers, such as a household sweeping robot. The cleaning robot path planning method comprises the following steps:
a. acquiring a target cleaning area: the cleaning robot cleans a circle along the area to be cleaned from the initial starting point to obtain a target cleaning area.
Specifically, when the user uses the cleaning robot, the cleaning robot may be placed on the boundary of the area to be cleaned, or may be placed in the area to be cleaned, so that the cleaning robot in this embodiment needs to first determine whether the current position is the boundary of the area to be cleaned. Alternatively, the cleaning robot may determine whether it is on the boundary of the area to be cleaned using a laser radar, an ultrasonic wave, a camera, a distance sensor, or the like, and the specific determination process may refer to the related art.
Referring to fig. 2, if the initial starting point of the cleaning robot is on the boundary of the area to be cleaned, the cleaning robot cleans a circle along the area to be cleaned starting from the initial starting point to obtain a target cleaning area; for example position a in figure 2, is on the border of the area to be cleaned. If the initial starting point of the cleaning robot is not on the boundary of the area to be cleaned, the cleaning robot firstly drives to the boundary of the area to be cleaned according to the preset direction, and then cleans a circle along the boundary of the area to be cleaned to obtain a target cleaning area; for example, position B in fig. 2 is on the boundary of the area to be cleaned. In this embodiment, the cleaning robot first travels to the boundary of the area to be cleaned according to a preset direction, where the preset direction may be a fixed direction, or may be a direction in which the cleaning robot is closest to the boundary. In the embodiment, the cleaning robot cleans a circle along the to-be-cleaned area from the initial starting point to obtain the target cleaning area, which can be referred to in the prior art.
b. Determining a preferential cleaning direction: a direction of the cleaning robot to a nearest boundary is defined as a preferential cleaning direction, wherein the nearest boundary is a boundary closest to the cleaning robot among boundaries of the target cleaning region, and the nearest boundary is located at one side of the bow-shaped path of the cleaning robot.
Specifically, the cleaning robot of the present embodiment performs cleaning using a zigzag path, which can be divided into a row zigzag type reciprocating up and down and a row zigzag type reciprocating left and right, wherein,
if the arcuate path of the cleaning robot is a row arcuate path that reciprocates up and down, a boundary closer to the initial starting point is selected as a closest boundary from the left boundary and the right boundary of the target cleaning region. Fig. 3 is a vertically reciprocating arrow-shaped arrow, and position B in fig. 3 is a position where the cleaning robot is located, where position B is a distance d1 from the left boundary of the target cleaning region, a distance d2 from the right boundary of the target cleaning region, and d1 < d2, so that the left boundary is the closest boundary and the cleaning robot's preferential cleaning direction is to the left.
When the arcuate path of the cleaning robot is a line arcuate path that reciprocates left and right, a boundary closer to the initial starting point is selected as a closest boundary from the upper boundary and the lower boundary of the target cleaning region. Fig. 4 is a shape of a bow row reciprocating left and right, and position B in fig. 4 is a position where the cleaning robot is located, where position B is a distance d3 from a lower boundary of the target cleaning region, a distance d4 from an upper boundary of the target cleaning region, and d3 < d4, so that the lower boundary is a nearest boundary and the cleaning robot's preferential cleaning direction is downward.
It should be noted that, the distance between the cleaning robot and the boundary of the target cleaning area is obtained by calculation, and the cleaning robot obtains the target cleaning area after cleaning for one week along the area to be cleaned starting from the initial starting point, at this time, the outer circle boundary of the target cleaning area can be known, and then the distance between the cleaning robot and the boundary is obtained by calculation according to the real-time position of the cleaning robot. In addition, if the bow-shaped path of the cleaning robot is a row bow shape reciprocating up and down, the distance between the cleaning robot and the upper boundary and the lower boundary is not considered; if the zigzag path of the cleaning robot is a line zigzag path reciprocating left and right, the distance of the cleaning robot from the left and right boundaries is not considered. In addition, the directions of up, down, left, and right in the present embodiment are set to explain the operation principle of the present embodiment, and the directions can be set as necessary in an actual planar work area. In addition, the detailed definition of the zigzag path can refer to the prior art.
c. Planning a cleaning path: in each round of path planning, the cleaning robot starts from the cleaning starting point to clean an uncleaned area on one side of the preferential cleaning direction, and cleans the uncleaned area on the opposite side of the preferential cleaning direction after the cleaning on one side of the preferential cleaning direction is finished. When the non-cleaning area exists in the preferential cleaning direction, the non-cleaning area in the preferential cleaning direction is preferentially cleaned, namely when the non-cleaning area exists in the preferential cleaning direction, all the non-cleaning areas in the preferential cleaning direction are preferentially finished, and after all the areas in the preferential cleaning direction are completely cleaned, other areas are cleaned.
Specifically, the cleaning robot of the present embodiment performs cleaning using a zigzag path, which can be divided into a row zigzag type reciprocating up and down and a row zigzag type reciprocating left and right, wherein,
if the zigzag path of the cleaning robot is in a row zigzag shape, the cleaning robot cleans an uncleaned region on the side of the row corresponding to the preferential cleaning direction from the cleaning start point. Fig. 3 is a vertically reciprocating train bow shape, and position B in fig. 3 is a position where the cleaning robot is located, where position B is a distance d1 from the left boundary of the target cleaning region, a distance d2 from the right boundary of the target cleaning region, and d1 < d2, so that the left boundary is the closest boundary, the preferential cleaning direction of the cleaning robot is to the left, and the cleaning robot cleans an uncleaned region on the left side of the train from the cleaning start point.
If the arcuate path of the cleaning robot is in a line arcuate shape, the cleaning robot cleans an uncleaned area on the side of the line corresponding to the preferential cleaning direction from the cleaning start point. Fig. 4 is a row-bow shape reciprocating left and right, and position B in fig. 4 is a position where the cleaning robot is located, where position B is a distance d3 from a lower boundary of the target cleaning region, a distance d4 from an upper boundary of the target cleaning region, and d3 < d4, so that the lower boundary is a nearest boundary, a preferential cleaning direction of the cleaning robot is downward, and the cleaning robot cleans an uncleaned region on a lower side of a row where the cleaning robot is located from a cleaning start point.
Further, in the cleaning robot path planning method according to the present embodiment, for a cleaning robot in a shape like a Chinese character 'ji', if there is an uncleaned area after each round of cleaning, a cleaning start point for a new round of cleaning is selected according to a near rule:
and judging whether the cleaning robot can reach an uncleaned area without encountering obstacles along the current row.
If the cleaning robot can reach the non-cleaning area along the current row without meeting the obstacle, selecting the non-cleaning point which is positioned in the non-cleaning area and is closest to the cleaning robot in the current row as a cleaning starting point.
If the cleaning robot can not reach the non-cleaning area along the current row without encountering the obstacle, judging whether the next row can reach the non-cleaning area without encountering the obstacle one by one from the current row until the row which can reach the non-cleaning area without encountering the obstacle is selected, and then selecting the non-cleaning point which is positioned in the non-cleaning area and is closest to the cleaning robot in the row as a cleaning starting point.
Referring to fig. 5, the principle of column proximity is further explained, where fig. 5 is a bow-shaped column reciprocating up and down, and in fig. 5, position B is where the cleaning robot is located, where position B is at a distance d1 from the left boundary of the target cleaning region, at a distance d2 from the right boundary of the target cleaning region, and d1 < d2, so that the left boundary is the closest boundary and the preferential cleaning direction of the cleaning robot is to the left, and the cleaning robot cleans the left non-cleaned region of the column from the cleaning start point. After the cleaning is started, the cleaning robot completes the cleaning on the left side according to the vertically reciprocating row-bow shape. The wheel finishes the cleaning under the obstacle due to the existence of the obstacle, and the area above the obstacle is the left area of the position B according to the principle of the preferential cleaning direction of the embodiment, so the cleaning starting point for cleaning the area above the obstacle needs to be found. The position C is determined instead of the position D according to the principle of selecting the row of the cleaning starting point of the new cleaning, and the cleaning on the left side is finished according to the row Chinese character 'gong' shape which reciprocates up and down from the position C.
Further, in the cleaning robot path planning method according to the present embodiment, for a cleaning robot in a line-shaped manner, if there is an uncleaned area after each cleaning cycle is finished, a cleaning start point for a new cleaning cycle is selected according to a near principle, where the near principle is:
and judging whether the cleaning robot can reach an uncleaned area without encountering obstacles along the current row.
If the cleaning robot can reach the non-cleaning area along the current row without meeting the obstacle, selecting a non-cleaning point which is positioned in the non-cleaning area and is closest to the cleaning robot in the current row as a cleaning starting point.
If the cleaning robot can not reach the non-cleaning area without encountering the obstacle along the current row, judging whether the next row can reach the non-cleaning area without encountering the obstacle one by one from the current row until the row which can reach the non-cleaning area without encountering the obstacle is selected, and then selecting the non-cleaning point which is positioned in the non-cleaning area and is closest to the cleaning robot in the row as a cleaning starting point.
As can be appreciated, after the cleaning start point of a new cleaning round is selected, the cleaning robot expands the zigzag path in the preferential cleaning direction from the cleaning start point to perform cleaning. The prior art can be referred to for expanding the zigzag path for cleaning.
Alternatively, in the cleaning robot path planning method of the present embodiment, if the cleaning robot encounters an obstacle during cleaning, the cleaning robot cleans a circle along the obstacle, marks an area occupied by the obstacle as an uncleanable area, and continues to complete cleaning on the obstacle side.
Further, after the cleaning robot continues to complete the cleaning on the obstacle side, if the zigzag path of the cleaning robot is in the row zigzag shape, the cleaning start point of a new round of cleaning is selected according to the row-near principle, and the specific process of the row-near principle can refer to the above-described embodiment. If the zigzag path of the cleaning robot is in a row zigzag shape, the cleaning start point of a new cleaning round is selected according to the in-row principle, and the specific process of the in-row principle can refer to the above embodiment.
Referring to fig. 6, fig. 6 is a row-bow shape reciprocating up and down, and the cleaning robot has a preferential cleaning direction to the left. The cleaning robot starts cleaning the cleaning area on the right side of the row of the cleaning robot after cleaning the cleaning area on the left side of the row of the cleaning robot from the initial position. After the cleaning robot meets the obstacle, the cleaning robot cleans a circle along the obstacle, the area occupied by the obstacle is marked as an uncleanable area, and the cleaning robot continues to complete cleaning on the lower side of the obstacle. Since the cleaning robot continues to complete the cleaning of the lower side of the obstacle, the preferred cleaning direction is left in this embodiment, and if the area on the right side of the obstacle is directly cleaned at this time, the area above the obstacle is omitted, so that after the cleaning robot continues to complete the cleaning of the lower side of the obstacle, the area above the obstacle must be completed in the preferred cleaning direction, that is, after all the left side areas are completely cleaned, the area on the right side of the obstacle must be cleaned again.
According to the embodiment, after the target cleaning area is determined, the cleaning direction is selected according to the position of the cleaning robot and the target cleaning area, so that the cleaning path can be optimized, and the cleaning efficiency is improved.
Example 2
The cleaning robot of the present embodiment includes a memory for storing a computer program and a processor; the processor is used for executing the computer program stored in the memory to realize the cleaning robot path planning method of the above embodiment. Alternatively, the cleaning robot of the present embodiment is a household sweeping robot.
According to the embodiment, after the target cleaning area is determined, the cleaning direction is selected according to the position of the cleaning robot and the target cleaning area, so that the cleaning path can be optimized, and the cleaning efficiency is improved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above embodiments are merely illustrative of the technical ideas and features of the present invention, and are intended to enable those skilled in the art to understand the contents of the present invention and implement the present invention, and not to limit the scope of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should be covered by the claims of the present invention.