CN111728535B - Method and device for generating cleaning path, electronic equipment and storage medium - Google Patents

Method and device for generating cleaning path, electronic equipment and storage medium Download PDF

Info

Publication number
CN111728535B
CN111728535B CN202010576338.7A CN202010576338A CN111728535B CN 111728535 B CN111728535 B CN 111728535B CN 202010576338 A CN202010576338 A CN 202010576338A CN 111728535 B CN111728535 B CN 111728535B
Authority
CN
China
Prior art keywords
area
grid
determining
cleaning path
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010576338.7A
Other languages
Chinese (zh)
Other versions
CN111728535A (en
Inventor
卜大鹏
黎文正
陈侃
霍峰
秦宝星
程昊天
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Gaussian Automation Technology Development Co Ltd
Original Assignee
Shanghai Gaussian Automation Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Gaussian Automation Technology Development Co Ltd filed Critical Shanghai Gaussian Automation Technology Development Co Ltd
Priority to CN202010576338.7A priority Critical patent/CN111728535B/en
Publication of CN111728535A publication Critical patent/CN111728535A/en
Application granted granted Critical
Publication of CN111728535B publication Critical patent/CN111728535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L11/00Machines for cleaning floors, carpets, furniture, walls, or wall coverings
    • A47L11/24Floor-sweeping machines, motor-driven
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L11/00Machines for cleaning floors, carpets, furniture, walls, or wall coverings
    • A47L11/40Parts or details of machines not provided for in groups A47L11/02 - A47L11/38, or not restricted to one of these groups, e.g. handles, arrangements of switches, skirts, buffers, levers
    • AHUMAN NECESSITIES
    • A47FURNITURE; DOMESTIC ARTICLES OR APPLIANCES; COFFEE MILLS; SPICE MILLS; SUCTION CLEANERS IN GENERAL
    • A47LDOMESTIC WASHING OR CLEANING; SUCTION CLEANERS IN GENERAL
    • A47L11/00Machines for cleaning floors, carpets, furniture, walls, or wall coverings
    • A47L11/40Parts or details of machines not provided for in groups A47L11/02 - A47L11/38, or not restricted to one of these groups, e.g. handles, arrangements of switches, skirts, buffers, levers
    • A47L11/4011Regulation of the cleaning machine by electric means; Control systems and remote control systems therefor

Abstract

The invention discloses a method and a device for generating a cleaning path, electronic equipment and a storage medium. The method comprises the following steps: determining barrier areas and blank areas in a grid map of an area to be cleaned; determining a first area according to the blank area, determining a first grid in the first area, wherein the distance between the first grid and a target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area, wherein the target object comprises a boundary line between the obstacle area and the blank area or a previous cleaning path; and determining a second grid meeting set conditions according to the boundary line of the first area and the second area, and connecting the second grid to generate a cleaning path. The cleaning path generated by the mode can realize the full coverage of the area to be cleaned, and the conditions of missing cleaning or repeated cleaning and the like easily caused by certain randomness during the determination of the cleaning path are avoided.

Description

Method and device for generating cleaning path, electronic equipment and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a method and an apparatus for generating a cleaning path, an electronic device, and a storage medium.
Background
With the development of the robot technology and the laser sensor, the robot based on the synchronous positioning and map building technology of the laser sensor is more and more widely applied. Especially in the field of cleaning, the robot with the functions of automatically building a picture and positioning brings great convenience to the life of people.
Planning a sweeping path is a key technology for cleaning robot movement. Currently, methods for planning a cleaning route include a random cleaning method, a cattle plowing cleaning method, and a cattle plowing-random cleaning method. The random cleaning mode comprises that the robot moves linearly firstly, rotates a random angle after touching an obstacle, continues to move forwards, and repeats the operation until the electric quantity is low or the preset cleaning time is reached. The cattle ploughing and cleaning mode comprises that the robot carries out zigzag reciprocating cleaning until the electric quantity is low or the preset cleaning time is reached. The cattle plowing-random cleaning mode comprises that the robot carries out reciprocating cleaning in a bow shape, rotates at an angle randomly after colliding at a certain position for multiple times, continues reciprocating cleaning in the bow shape, and repeats the operation until the electric quantity is low or the preset cleaning time is reached.
The inventor finds that the cleaning path planning mode in the related technology has certain randomness, the coverage effect is related to the cleaning time, and the situations of missing cleaning or repeated cleaning and the like are easy to occur in the process of realizing the invention.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for generating a cleaning path, which can avoid the condition of missing cleaning or repeated cleaning.
In a first aspect, an embodiment of the present invention provides a method for generating a cleaning path, including:
determining barrier areas and blank areas in a grid map of an area to be cleaned;
determining a first area according to the blank area, determining a first grid in the first area, wherein the distance between the first grid and a target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area, wherein the target object comprises a boundary line between the obstacle area and the blank area or a previous cleaning path;
and determining a second grid meeting set conditions according to the boundary line of the first area and the second area, and connecting the second grid to generate a cleaning path.
Optionally, the determining the obstacle area and the blank area in the grid map of the area to be cleaned includes:
acquiring a grid map of an area to be cleaned, wherein the grid map records occupation information of whether a sub-area to be cleaned corresponding to each grid is occupied by an obstacle;
and determining an obstacle area and a blank area in the grid map according to the occupancy information.
The advantages of the design are as follows: because each grid in the grid map corresponds to one area in the real world, whether the corresponding area in the real world is occupied by the obstacle or not is recorded through the grids, and the obstacle area and the blank area in the grid map can be rapidly marked according to whether the area is occupied by the obstacle or not, so that the subsequent planning processing of cleaning paths for the blank area is facilitated.
Optionally, the determining the first area according to the blank area includes:
when the previous cleaning path does not exist, taking the blank area as a first area;
and when the previous cleaning path exists, taking a closed area formed by the previous cleaning path in the blank area as a first area.
The advantages of the design are as follows: when a first cleaning path is generated in the area to be cleaned, the blank area in the grid map is the first area, and the area where the cleaning path is not planned is gradually reduced along with the generation of more and more cleaning paths. In this case, the closed area formed by the previous cleaning path is used as the first area, and the area where the cleaning path is not planned can be determined quickly and accurately.
Optionally, the determining a first grid in the first region, where a distance to the target object is smaller than a set threshold, includes:
when the previous cleaning path does not exist, determining the position information of a boundary line of the obstacle area and the blank area, and determining a first grid in the first area, wherein the distance between the first grid and the boundary line is smaller than a set threshold value according to the position information;
when a previous cleaning path exists, determining a first grid in the first area, wherein the distance between the first grid and the previous cleaning path is smaller than a set threshold value.
The advantages of the design are as follows: and determining a first grid in the first area, wherein the distance between the first grid and the boundary line or the previous cleaning path is smaller than a set threshold, and the robot collides with the obstacle due to walking in the area corresponding to the first grid.
Optionally, the determining a second grid meeting a set condition according to the boundary line between the first area and the second area includes:
determining any one side on a boundary line of the first area and the second area as a reference side, wherein two grids adjacent to the reference side respectively belong to the first area and the second area;
determining a target edge satisfying a set condition from adjacent edges of the reference edge, wherein the adjacent edges are edges having the same vertex as the reference edge;
when the target edge is not coincident with the reference edge, determining a new target edge meeting set conditions from adjacent edges of the target edge;
when the target edge is coincident with the reference edge, respectively determining a second grid adjacent to each target edge, wherein the second grid is a grid in the first area.
The advantages of the design are as follows: the cleaning path is determined based on the edges on the boundary line of the first area and the second area and the adjacent second grids of the adjacent edges, so that the full coverage of the area to be cleaned can be realized, and the blank caused by the fact that cleaning is not carried out can be avoided near the obstacle.
Optionally, the setting condition includes:
two grids adjacent to the target edge are a grid in a first area and a grid in a second area respectively;
and the grid in the first area adjacent to the reference edge is communicated with the grid in the first area adjacent to the target edge.
The advantages of the design are as follows: the condition for determining the target side from the adjacent sides of the reference side is limited, and the influence on the accuracy and the coverage rate of the cleaning path due to the error determination of the target side is avoided.
Optionally, the connecting the second grid generates a sweeping path, including:
and connecting the central point of the second grid to generate a sweeping path in the area to be cleaned, wherein the resolution of the acquired grid map of the area to be cleaned is less than or equal to 10 cm.
The advantages of the design are as follows: by connecting the center points of the second grid, a smooth, collision-risk-free sweeping path is obtained which completely covers the area to be cleaned. In addition, the accuracy of the grid map is required to be less than or equal to 10cm, so that the problem that the accuracy of the grid map is too low and a large amount of computing resources are required can be avoided while the accuracy of the generated path is ensured, and task work can be efficiently performed.
In a second aspect, an embodiment of the present invention further provides an apparatus for generating a cleaning path, where the apparatus includes:
the area determination module is used for determining an obstacle area and a blank area in a grid map of an area to be cleaned;
the grid determining module is used for determining a first area according to the blank area, determining a first grid of which the distance between the first area and a target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area, wherein the target object comprises a boundary line between the obstacle area and the blank area or a previous cleaning path;
and the path generation module is used for determining a second grid meeting set conditions according to the boundary line of the first area and the second area and connecting the second grid to generate a cleaning path.
Optionally, the region determining module is specifically configured to:
acquiring a grid map of an area to be cleaned, wherein the grid map records occupation information of whether a sub-area to be cleaned corresponding to each grid is occupied by an obstacle;
and determining an obstacle area and a blank area in the grid map according to the occupancy information.
Optionally, the grid determining module comprises:
the area determining submodule is used for taking the blank area as a first area when the previous cleaning path does not exist; and when the previous cleaning path exists, taking a closed area formed by the previous cleaning path in the blank area as a first area.
Optionally, the grid determining module further comprises:
the first grid determining submodule is used for determining the position information of a boundary line of the obstacle area and the blank area when the previous cleaning path does not exist, and determining a first grid of which the distance between the first area and the boundary line is smaller than a set threshold value according to the position information; when a previous cleaning path exists, determining a first grid in the first area, wherein the distance between the first grid and the previous cleaning path is smaller than a set threshold value.
Optionally, the path generating module includes:
a reference edge determining submodule, configured to determine that any one edge on a boundary line between the first region and the second region is a reference edge, where two grids adjacent to the reference edge respectively belong to the first region and the second region;
a target edge determination submodule for determining a target edge satisfying a set condition from among adjacent edges of the reference edge, wherein the adjacent edges are edges having the same vertex as the reference edge; when the target edge is not coincident with the reference edge, determining a new target edge meeting set conditions from adjacent edges of the target edge;
and the second grid determining submodule is used for respectively determining a second grid adjacent to each target edge when the target edge is coincided with the reference edge, wherein the second grid is a grid in the first area.
Optionally, the setting condition includes:
two grids adjacent to the target edge are a grid in a first area and a grid in a second area respectively;
and the grid in the first area adjacent to the reference edge is communicated with the grid in the first area adjacent to the target edge.
Optionally, the path generating module further includes:
and the path generation submodule is used for connecting the central point of the second grid to generate a sweeping path in the area to be cleaned, wherein the resolution of the acquired grid map of the area to be cleaned is less than or equal to 10 cm.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of generating a cleaning path as described in any embodiment of the invention.
In a fourth aspect, embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for generating a cleaning path according to any of the embodiments of the present invention.
The invention provides a method for generating a cleaning path, which is characterized in that a blank area formed by surrounding an obstacle area is used as a first area, a first grid in the first area is determined based on the boundary line of the first area or the previous cleaning path, an area corresponding to the first grid is used as a second area, a second grid is determined according to the boundary line of the first area and the second area, and the second grid is connected to generate the cleaning path covering an area to be cleaned. The cleaning path generated by the mode can realize the full coverage of the area to be cleaned, and the conditions of missing cleaning or repeated cleaning and the like easily caused by certain randomness during the determination of the cleaning path are avoided.
Drawings
Fig. 1 is a flowchart of a method for generating a cleaning path according to an embodiment of the present invention;
fig. 2a is a schematic diagram of a grid map according to an embodiment of the present invention;
FIG. 2b is a schematic diagram of another grid map provided in accordance with an embodiment of the present invention;
fig. 2c is a schematic diagram of a first area of a grid map according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for generating a cleaning path according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another grid map provided in accordance with an embodiment of the present invention;
fig. 5 is a flowchart of a method for generating a cleaning path based on a boundary between a second area and a blank area according to an embodiment of the present invention;
FIG. 6 is a schematic view of a sweeping path covering an area to be cleaned according to an embodiment of the present invention;
fig. 7 is a block diagram of an apparatus for generating a cleaning path according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a storage medium according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
For convenience of understanding, technical terms appearing in the embodiments of the present invention are explained below.
Grid map: the grid map is a 2d map formed by splicing a plurality of grids, one grid in the grid map corresponds to a square area of 5cm × 5cm of the real world, each grid has a plurality of states, the most important two states are an obstacle and a blank, different states are represented by different colors in the text, and when the current state of the grid changes, specific parameters are adopted in the program to express, for example: there is an identification field, the obstacle is identified by 1 and the blank is identified by 0.
Side: one grid has 4 sides up, down, left and right. There are 2 grids adjacent to one edge.
Vertex: an edge has 2 vertices and a grid has 4 vertices.
Abutting edges: two edges have a common vertex, and we can say that one edge is an adjacent edge to the other. Typically one edge has 6 adjoining edges.
Communication: the grid A and the grid B are communicated in the grid map, namely the grids which move from the grid A to the grid B from the upper part to the lower part to the left part and the right part are in the same state.
Fig. 1 is a flowchart of a method for generating a cleaning path according to an embodiment of the present invention, where the method may be applied to a sweeping robot to automatically generate a scene of the cleaning path covering an area to be cleaned. The method is performed by an apparatus for generating a cleaning path, which may be implemented by software and/or hardware, and which is integrated in an electronic device. As shown in fig. 1, the method includes:
step 110, determining barrier areas and blank areas in a grid map of the area to be cleaned.
The electronic device may be a terminal device that performs sweeping path planning and performs sweeping operation on the area to be cleaned based on the planned sweeping path. For example, the electronic device may be a sweeping robot.
The obstacle region is a region made up of all the grids identified as 1 in the grid map.
The blank area is an area formed by all the grids identified as 0 in the grid map.
Before the sweeping robot cleans an area, a grid map of the area is prepared in advance. The resolution of the grid map is related to the computing resources of the electronic device and the accuracy of the generated path. The smaller the resolution, the more computing resources are required. And the greater the resolution, the less accurate the generated path. For example, the resolution of a grid map may be 5cm, and then a grid in the grid map corresponds to an area in the real world of 25cm2A square area of (a). And recording the occupation information of whether the sub-area to be cleaned corresponding to each grid is occupied by the obstacle or not by the grid map. If the identifier of a certain grid is 1, it indicates that the corresponding square area in the real world is occupied. If the mark of a certain grid is 0, the corresponding square area in the real world is indicated to be unoccupied。
Illustratively, a grid map of the area to be cleaned is obtained. The grid map records the occupation information of whether the sub-area to be cleaned corresponding to each grid is occupied by the obstacle or not, and the obstacle area and the blank area in the grid map are determined according to the occupation information. For example, the identifier of each grid in the grid map is obtained, the grid whose identifier is 1 is marked as an obstacle area, and the grid whose identifier is 0 is marked as a blank area. Fig. 2a is a schematic diagram of a grid map according to an embodiment of the present invention. As shown in fig. 2a, the grid map includes an obstacle area 211 and a blank area 212, and the blank area 212 corresponds to a blank area to be cleaned in the real world.
Step 120, determining a first area according to the blank area, determining a first grid in the first area, wherein the distance between the first area and the target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area.
The first area may be an area where a sweeping path is not planned in the area to be cleaned in the grid map. For example, when there is no previous cleaning path, the blank area is set as the first area. When the previous cleaning path exists, a closed area formed by the previous cleaning path in the blank area is used as a first area.
The target object includes a boundary line between the obstacle area and the blank area, a previous cleaning path, and the like. For example, when there is no previous cleaning path, the target object is a boundary line of the obstacle region and the blank region. When there is a previous cleaning route, the target object is the previous cleaning route.
It should be noted that the threshold value is set in relation to the size of the sweeping robot. For a circular sweeping robot, the set threshold may be the radius of the sweeping robot. For a polygonal sweeping robot, the set threshold may be the radius of a circumscribed circle of the sweeping robot. Alternatively, for a polygonal sweeping robot, the set threshold may be the radius of the inscribed circle of the sweeping robot. The value of the set threshold is not particularly limited in the embodiments of the present invention.
For example, determining a first grid in the first region, where the distance to the target object is smaller than a set threshold, and taking the region corresponding to the first grid as the second region may include:
when the previous cleaning path does not exist, determining the position information of the boundary line of the obstacle area and the blank area, and determining a first grid in the first area, wherein the distance between the first grid and the boundary line is smaller than a set threshold value according to the position information. The position information includes position coordinates of boundary lines between the barrier area and the blank area in the grid map. The distance between the grid in the blank area and the boundary line is calculated, the grid of which the distance is smaller than a set threshold value is used as a first grid, and the area corresponding to the first grid is used as a second area. Fig. 2b is a schematic diagram of another grid map according to an embodiment of the present invention. As shown in fig. 2b, the grid 222 to which the point a belongs in the first region 221 is a first grid having a distance from the boundary line 223 smaller than a set threshold. The grid 224 to which the point B belongs is a grid which is greater than the set threshold from the boundary line 223, and the grid 224 to which the point B belongs cannot be made the first grid. The region constituted by the first grid is the second region. Alternatively, the distance between the calculation grid and the boundary line may be a distance between the center of the calculation grid and the boundary line, or a distance between any vertex of the calculation grid and the boundary line, and the invention is not particularly limited.
When the previous cleaning path exists, a first grid in the first area, the distance between which and the previous cleaning path is smaller than a set threshold value, is determined. For example, when there is a previous cleaning route, position coordinates of the previous cleaning route are acquired, a distance between a grid in the first area and the previous cleaning route is calculated based on the position coordinates, the grid whose distance is smaller than a set threshold value is set as the first grid, and an area corresponding to the first grid is set as the second area. Fig. 2c is a schematic diagram of a first area of a grid map according to an embodiment of the present invention. As shown in fig. 2C, the grid 232 to which the point C in the first region 231 belongs is a first grid whose distance from the previous cleaning route 233 is smaller than a set threshold. The grid 234 to which the D point belongs is a grid which is greater than a set threshold from the previous cleaning route 233, and the grid 234 to which the D point belongs cannot be made the first grid. The region constituted by the first grid is the second region. Alternatively, the distance between the calculation grid and the previous cleaning path may be the distance between the center of the calculation grid and the previous cleaning path, or the distance between any vertex of the calculation grid and the previous cleaning path.
And step 130, determining a second grid meeting set conditions according to the boundary line of the first area and the second area, and connecting the second grid to generate a cleaning path.
The setting conditions are used to identify a target edge on the boundary line between the first region and the second region, and the grid in the first region adjacent to the target edge is set as the second grid. For example, the setting conditions include:
two grids adjacent to the target edge are a grid in a first area and a grid in a second area respectively;
and the grids in the first area adjacent to the reference edge are communicated with the grids in the first area adjacent to the target edge.
Illustratively, any one side on the boundary line of the first region and the second region is determined as a reference side, and two grids adjacent to the reference side belong to the first region and the second region, respectively. Where a grid with adjacent edges can be considered as two grids that contain the edge at the same time. A target edge satisfying the setting condition is determined from among adjacent edges of a reference edge, wherein the adjacent edges are edges having the same vertex as the reference edge. For example, a reference edge having a common vertex with the reference edge is determined. And selecting adjacent grids from the reference edges as a first region internal grid and a second region internal grid respectively, wherein the adjacent first region internal grid is communicated with the first region internal grid adjacent to the reference edge. When the target edge does not coincide with the reference edge, a new target edge satisfying the setting condition is determined from the adjacent edges of the target edge. For example, if the target edge does not coincide with the reference edge, a reference edge having a common vertex with the target edge is determined. And selecting adjacent grids from the reference edges as a first region internal grid and a second region internal grid respectively, wherein the adjacent first region internal grid is a new target edge communicated with the first region internal grid adjacent to the previous target edge. And if the target edge is not coincident with the reference edge, circularly executing the step of determining a new target edge meeting the set condition from the adjacent edges of the target edge until the target edge is coincident with the reference edge and exiting the circulation.
When the target edge is overlapped with the reference edge, the grids in the first area adjacent to each target edge are respectively used as second grids. Since the target edge coincides with the reference edge, the grid adjacent to each target edge (in the first region) is set as the second grid, and the adjacent grid of the reference edge and the target edge (in the first region) is set as the second grid. Connecting the center points of the second grid generates a cleaning path. The advantages of the design are as follows: by connecting the center points of the second grid, a smooth, collision-risk-free sweeping path is obtained which completely covers the area to be cleaned. It should be noted that there are many ways to connect the second grid to generate the sweeping path covering the area to be cleaned, and the embodiment of the present invention is not limited in particular. For example, it is also possible to connect the same vertices of all second grids to generate a sweeping path covering the area to be cleaned. It may be that all the lower left (or lower right) vertices of the second grid are connected, or that the upper left (or upper right) vertices of the grid are connected, etc. If the lower left vertex or the lower right vertex of the second grid is connected, there may be a risk of collision with the obstacle on the cleaning path near the obstacle. If the upper left or right vertices of the second grid are connected, an unswept area may appear that does not completely cover the area to be cleaned.
According to the technical scheme of the embodiment, a blank area formed by surrounding of the obstacle area is used as a first area, a first grid in the first area is determined based on a boundary line of the first area or a previous cleaning path, an area corresponding to the first grid is used as a second area, a second grid is determined according to the boundary line of the first area and the second area, and the second grid is connected to generate a cleaning path covering the area to be cleaned. The cleaning path generated by the mode can realize the full coverage of the area to be cleaned, and the conditions of missing cleaning or repeated cleaning and the like easily caused by certain randomness during the determination of the cleaning path are avoided.
In an exemplary embodiment, a path covering an area needs to be automatically generated when the sweeping robot sweeps the area. Since the sweeping robot needs to sweep in various environments, the automatic coverage algorithm of the sweeping robot needs to be adaptable to various environments. The automatic coverage algorithm introduced in the embodiment of the invention is a method for generating a cleaning path for covering the area to be cleaned according to the obstacles in the grid map, and can ensure that the generated path can cover the cleaning area by 100%.
Fig. 3 is a flowchart of another method for generating a cleaning path according to an embodiment of the present invention, where the method includes the following steps:
and 310, acquiring a grid map with the resolution of 5cm and marked barrier areas and blank areas, and generating a path of the blank area to be cleaned.
Fig. 4 is a schematic diagram of another grid map provided by an embodiment of the present invention, and as shown in fig. 4, the grid map may be a two-dimensional map formed by splicing a plurality of grids, each grid may be a square area, and each grid corresponds to a planar map of an area of the real world in a corresponding scale. It should be noted that the accuracy of the grid map refers to the size of each grid corresponding to the real world area. For example, in a grid map with square grids, a resolution of 10cm in the grid map means that one grid in the grid map corresponds to a 10cm × 10cm square area of the real world. According to the understanding, the smaller the accuracy of the grid map is, the finer the division of the obstacles is, and the accuracy of the grid map is less than or equal to 10cm, so that the accuracy of the generated path can be ensured, and meanwhile, the situation that the accuracy of the grid map is too small and a large amount of computing resources are needed is avoided, so that task operation can be efficiently performed. In one example, the resolution of the acquired grid map is 5 cm. If the resolution of the map is made large, the accuracy of the generated path is affected.
And step 320, marking the area which is less than r away from the obstacle in the blank area.
It should be noted that, assuming that the sweeping robot is a circle with a radius r, the generated cleaning path cannot be close to the obstacle region, and therefore, it is necessary to mark an area smaller than r from the obstacle in the blank region.
Step 330, a path is generated based on the boundary between the second area and the empty area.
Fig. 5 is a flowchart of a method for generating a cleaning path based on a boundary between a second area and a blank area according to an embodiment of the present invention. As shown in fig. 5, the method includes:
step 331, randomly finding an edge connecting the blank area and the second area, and marking the edge as an S-edge. And searching for the side meeting the set condition from the adjacent sides of the S side as the next side, and recording as the N side.
Here, the setting conditions that N sides need to satisfy include:
(1) two grids adjacent to the N sides are required to be a blank grid and a grid filling area.
(2) The blank grids adjacent to the S side and the blank grids adjacent to the N side are required to be communicated.
Step 332, searching the next edge meeting the condition from the adjacent edges of the N edges, and looping the next edge as a new N edge, wherein the looping structure is performed when the N edge and the S edge are overlapped, namely the N edge and the S edge return to.
And step 333, connecting all the searched adjacent blank grids of the N sides and the S sides to obtain a cleaning path.
For example, the center points of the adjacent blank grids of the searched S side and all N sides are connected to obtain a first cleaning path.
And step 340, taking the closed area formed by the previous path as a new blank area.
Step 350, judging whether a grid with a distance from the previous path being greater than or equal to a set threshold exists in the blank area, if so, executing step 360, otherwise, executing step 370.
And step 360, marking the area, which is less than the set threshold value, in the newly determined blank area, as the second area, and returning to the step 330.
Step 370, all the generated paths are used as cleaning paths covering the area to be cleaned.
For example, an area, which is a distance from the previous path less than a set threshold value, of the newly determined blank area is the second area.
After determining the second area, the process returns to step 330, where a path is generated based on the boundary between the second area and the blank area. An edge may be randomly selected as an S-edge on a boundary line between the second area and the blank area, where the S-edge is an edge connecting the second area and the blank area. And searching for the side meeting the set condition from the adjacent sides of the S side as the next side, and recording as the N side. The setting conditions are the same as those described in the above embodiments, and are not described herein again. And searching the next side meeting the set condition from the adjacent sides of the N sides, taking the next side as a new N side, circulating the process, and ending the circulation when the process returns to the side S. And connecting the grids of the adjacent blank areas of all the edges which are searched to pass through to obtain a new path. For example, the center points of the adjacent blank grids of the searched S side and all N sides are connected to obtain a cleaning path, and the cleaning path is located in the closed area formed by the first cleaning path. The shapes of the newly generated cleaning path and the first cleaning path are similar to the boundary line between the obstacle area and the blank area.
In the embodiment of the invention, the sweeping robot circularly executes the operation of generating the sweeping paths until no grid with the distance from the previous sweeping path being greater than or equal to the set threshold exists in a blank area surrounded by the newly generated sweeping paths, and then the circulation is ended to obtain a plurality of sweeping paths covering the area to be cleaned. Fig. 6 is a schematic diagram of a sweeping path covering an area to be cleaned according to an embodiment of the present invention. As shown in fig. 6, the area to be cleaned is covered with a plurality of sweeping paths.
According to the embodiment of the invention, the cleaning area is generated based on the boundary line of the barrier area and the blank area, the shape of the area to be cleaned is not limited, the full coverage can be realized for the areas to be cleaned in different shapes, and the adaptability of the sweeping robot to various cleaning environments is improved.
Fig. 7 is a block diagram of an apparatus for generating a cleaning path according to an embodiment of the present invention. The apparatus may be implemented by software and/or hardware and is generally configured in an electronic device. As shown in fig. 7, the apparatus includes:
an area determination module 710 for determining an obstacle area and a blank area in a grid map of an area to be cleaned;
a grid determining module 720, configured to determine a first area according to the blank area, determine a first grid in the first area, where a distance between the first area and a target object is smaller than a set threshold, and use an area corresponding to the first grid as a second area, where the target object includes a boundary line between the obstacle area and the blank area or a previous cleaning path;
and a path generating module 730, configured to determine a second grid meeting a set condition according to a boundary line between the first area and the second area, and connect the second grid to generate a cleaning path.
Optionally, the area determining module 710 is specifically configured to:
acquiring a grid map of an area to be cleaned, wherein the grid map records occupation information of whether a sub-area to be cleaned corresponding to each grid is occupied by an obstacle;
and determining an obstacle area and a blank area in the grid map according to the occupancy information.
Optionally, the grid determining module 720 includes:
an area determination sub-module 721 configured to, when there is no previous cleaning path, take the blank area as a first area; and when the previous cleaning path exists, taking a closed area formed by the previous cleaning path in the blank area as a first area.
Optionally, the grid determining module 720 further comprises:
a first grid determining submodule 722, configured to determine, when there is no previous cleaning path, position information of a boundary line between the obstacle area and the blank area, and determine, according to the position information, a first grid in the first area, where a distance from the boundary line is smaller than a set threshold; when a previous cleaning path exists, determining a first grid in the first area, wherein the distance between the first grid and the previous cleaning path is smaller than a set threshold value.
Optionally, the path generating module 730 includes:
a reference edge determining submodule 731, configured to determine that any one edge on a boundary line between the first region and the second region is a reference edge, where two grids adjacent to the reference edge respectively belong to the first region and the second region;
a target edge determination submodule 732, configured to determine a target edge that satisfies a set condition from adjacent edges of the reference edge, where the adjacent edges are edges having the same vertex as the reference edge; when the target edge is not coincident with the reference edge, determining a new target edge meeting set conditions from adjacent edges of the target edge;
and the second grid determining submodule is used for respectively determining a second grid adjacent to each target edge when the target edge is coincided with the reference edge, wherein the second grid is a grid in the first area.
Optionally, the setting condition includes:
two grids adjacent to the target edge are a grid in a first area and a grid in a second area respectively;
and the grid in the first area adjacent to the reference edge is communicated with the grid in the first area adjacent to the target edge.
Optionally, the path generating module 730 further comprises:
and the path generation sub-module 733 is configured to connect a center point of the second grid to generate a sweeping path in the area to be cleaned, where a resolution of the acquired grid map of the area to be cleaned is less than or equal to 10 cm.
The device for generating the cleaning path provided by the embodiment of the invention can execute the method for generating the cleaning path provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 8, the electronic device includes a processor 810, a memory 820, an input device 830, and an output device 840; the number of the processors 810 in the electronic device may be one or more, and one processor 810 is taken as an example in fig. 8; the processor 810, the memory 820, the input device 830 and the output device 840 in the electronic apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 8.
The memory 820 may be used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the method of generating a cleaning path in the embodiments of the present invention (e.g., the region determining module 710, the grid determining module 720, and the path generating module 730). The processor 810 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 820, that is, the method for generating the cleaning path is implemented.
The memory 820 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 820 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 820 may further include memory located remotely from the processor 810, which may be connected to an electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 830 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus. The output device 840 may include a display device such as a display screen.
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, and fig. 9 is a schematic structural diagram of the storage medium according to the embodiment of the present invention. As shown in fig. 9, a readable storage medium 910 has stored thereon computer-executable instructions 911, which when executed by a computer processor 920, the computer-executable instructions 911 are for performing a method of generating a cleaning path, the method comprising:
determining barrier areas and blank areas in a grid map of an area to be cleaned;
determining a first area according to the blank area, determining a first grid in the first area, wherein the distance between the first grid and a target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area, wherein the target object comprises a boundary line between the obstacle area and the blank area or a previous cleaning path;
and determining a second grid meeting set conditions according to the boundary line of the first area and the second area, and connecting the second grid to generate a cleaning path.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the method for generating a cleaning path provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the device for generating a cleaning path, each included unit and module is only divided according to functional logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method of generating a cleaning path, comprising:
determining barrier areas and blank areas in a grid map of an area to be cleaned;
determining a first area according to the blank area, determining a first grid in the first area, wherein the distance between the first grid and a target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area, wherein the target object comprises a boundary line between the obstacle area and the blank area or a previous cleaning path;
determining a second grid meeting set conditions according to a boundary line of the first area and the second area, and connecting the second grid to generate a cleaning path;
wherein, the determining the second grid meeting the set condition according to the boundary line of the first area and the second area comprises:
determining any one side on a boundary line of the first area and the second area as a reference side, wherein two grids adjacent to the reference side respectively belong to the first area and the second area;
determining a target edge satisfying a set condition from adjacent edges of the reference edge, wherein the adjacent edges are edges having the same vertex as the reference edge;
when the target edge is not coincident with the reference edge, determining a new target edge meeting set conditions from adjacent edges of the target edge;
when the target edge is coincident with the reference edge, respectively determining a second grid adjacent to each target edge, wherein the second grid is a grid in the first area.
2. The method of claim 1, wherein determining the barrier area and the clear area in a grid map of the area to be cleaned comprises:
acquiring a grid map of an area to be cleaned, wherein the grid map records occupation information of whether a sub-area to be cleaned corresponding to each grid is occupied by an obstacle;
and determining an obstacle area and a blank area in the grid map according to the occupancy information.
3. The method of claim 1, wherein the determining the first region according to the blank region comprises:
when the previous cleaning path does not exist, taking the blank area as a first area;
and when the previous cleaning path exists, taking a closed area formed by the previous cleaning path in the blank area as a first area.
4. The method of claim 3, wherein the determining that the first grid in the first region is closer than a set threshold from the target object comprises:
when the previous cleaning path does not exist, determining the position information of a boundary line of the obstacle area and the blank area, and determining a first grid in the first area, wherein the distance between the first grid and the boundary line is smaller than a set threshold value according to the position information;
when a previous cleaning path exists, determining a first grid in the first area, wherein the distance between the first grid and the previous cleaning path is smaller than a set threshold value.
5. The method according to claim 1, wherein the setting conditions include:
two grids adjacent to the target edge are a grid in a first area and a grid in a second area respectively;
and the grid in the first area adjacent to the reference edge is communicated with the grid in the first area adjacent to the target edge.
6. The method of any of claims 1-5, wherein said connecting the second grid generates a cleaning path comprising:
and connecting the central point of the second grid to generate a sweeping path in the area to be cleaned, wherein the resolution of the acquired grid map of the area to be cleaned is less than or equal to 10 cm.
7. An apparatus for generating a cleaning path, comprising:
the area determination module is used for determining an obstacle area and a blank area in a grid map of an area to be cleaned;
the grid determining module is used for determining a first area according to the blank area, determining a first grid of which the distance between the first area and a target object is smaller than a set threshold, and taking an area corresponding to the first grid as a second area, wherein the target object comprises a boundary line between the obstacle area and the blank area or a previous cleaning path;
the path generation module is used for determining a second grid meeting set conditions according to a boundary line of the first area and the second area and connecting the second grid to generate a cleaning path;
wherein the path generation module comprises:
a reference edge determining submodule, configured to determine that any one edge on a boundary line between the first region and the second region is a reference edge, where two grids adjacent to the reference edge respectively belong to the first region and the second region;
a target edge determination submodule for determining a target edge satisfying a set condition from among adjacent edges of the reference edge, wherein the adjacent edges are edges having the same vertex as the reference edge; when the target edge is not coincident with the reference edge, determining a new target edge meeting set conditions from adjacent edges of the target edge;
and the second grid determining submodule is used for respectively determining a second grid adjacent to each target edge when the target edge is coincided with the reference edge, wherein the second grid is a grid in the first area.
8. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of generating a cleaning path as recited in any of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of generating a cleaning path according to any one of claims 1-6.
CN202010576338.7A 2020-06-22 2020-06-22 Method and device for generating cleaning path, electronic equipment and storage medium Active CN111728535B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010576338.7A CN111728535B (en) 2020-06-22 2020-06-22 Method and device for generating cleaning path, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010576338.7A CN111728535B (en) 2020-06-22 2020-06-22 Method and device for generating cleaning path, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111728535A CN111728535A (en) 2020-10-02
CN111728535B true CN111728535B (en) 2021-12-28

Family

ID=72650502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010576338.7A Active CN111728535B (en) 2020-06-22 2020-06-22 Method and device for generating cleaning path, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111728535B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110445A (en) * 2021-04-13 2021-07-13 上海高仙自动化科技发展有限公司 Robot path planning method and device, robot and storage medium
CN113317733B (en) * 2021-06-04 2023-01-31 深圳飞鼠动力科技有限公司 Path planning method and cleaning robot
CN113455965B (en) * 2021-06-30 2022-05-27 广州科语机器人有限公司 Cleaning robot control method, cleaning robot control device, medium and cleaning robot
CN113791625A (en) * 2021-09-30 2021-12-14 深圳市优必选科技股份有限公司 Full coverage path generation method and device, terminal equipment and storage medium
CN115444311B (en) * 2022-06-27 2024-02-02 深圳银星智能集团股份有限公司 Cleaning method for cleaning robot, storage medium, and cleaning robot
CN115413981A (en) * 2022-09-19 2022-12-02 深圳市杉川机器人有限公司 Cleaning control method, control device, cleaning robot and storage medium
CN115316887B (en) * 2022-10-17 2023-02-28 杭州华橙软件技术有限公司 Robot control method, robot, and computer-readable storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104121903B (en) * 2014-07-04 2017-06-30 沈阳航空航天大学 A kind of rolling Route planner based on boundary value problem
JP6763809B2 (en) * 2017-03-14 2020-09-30 株式会社日立インダストリアルプロダクツ Route determination device, route determination method and route determination program
CN109744945B (en) * 2017-11-08 2020-12-04 杭州萤石网络有限公司 Method, device and system for determining regional attributes and electronic equipment
CN108775902A (en) * 2018-07-25 2018-11-09 齐鲁工业大学 The adjoint robot path planning method and system virtually expanded based on barrier
CN109116858B (en) * 2018-11-07 2021-09-07 诺亚机器人科技(上海)有限公司 Obstacle-detouring path planning method and system on designated path
CN111185899B (en) * 2018-11-14 2022-05-13 苏州科瓴精密机械科技有限公司 Robot control method and robot system
CN109363585B (en) * 2018-12-17 2021-07-02 深圳市银星智能科技股份有限公司 Partition traversing method, sweeping method and sweeping robot thereof
CN110764513B (en) * 2019-11-26 2023-04-28 小狗电器互联网科技(北京)股份有限公司 Map blind area identification method
CN111077894B (en) * 2020-01-02 2023-11-28 小狗电器互联网科技(北京)股份有限公司 Method and device for determining area to be cleaned

Also Published As

Publication number Publication date
CN111728535A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN111728535B (en) Method and device for generating cleaning path, electronic equipment and storage medium
CN109541634B (en) Path planning method and device and mobile device
CN108209741B (en) Cleaning robot control method and cleaning robot
EP3907575A1 (en) Dynamic region division and region channel identification method, and cleaning robot
CN109540155A (en) A kind of path planning and navigation method, computer installation and the computer readable storage medium of sweeping robot
US11537138B2 (en) Adaptive region division method and system
US9207678B2 (en) Method and apparatus for constructing map for mobile robot
CN110286387A (en) Obstacle detection method, device and storage medium applied to automated driving system
CN111459153B (en) Dynamic region division and region channel identification method and cleaning robot
CN112101378A (en) Robot repositioning method, device and equipment
CN111988524A (en) Unmanned aerial vehicle and camera collaborative obstacle avoidance method, server and storage medium
CN114764239B (en) Cleaning robot control method, cleaning robot control device, computer equipment and storage medium
US20230337880A1 (en) Method for Establishing Map Traversal Blocks of Global Grid Map, Chip, and Mobile Robot
CN111679661A (en) Semantic map construction method based on depth camera and sweeping robot
CN112130165A (en) Positioning method, positioning device, positioning medium and unmanned equipment
CN112298168A (en) Parking space detection method and device and automatic parking method and device
CN112985405A (en) Robot full-coverage path planning method, device, equipment and medium
CN113317733B (en) Path planning method and cleaning robot
CN117109596B (en) Self-mobile device, coverage path planning method and device thereof, and storage medium
CN112180914B (en) Map processing method, map processing device, storage medium and robot
CN110647148B (en) Wall position determining method and device, computer equipment and storage medium
CN111854757A (en) Navigation method, navigation device, electronic equipment and storage medium
CN115779424A (en) Navigation grid path finding method, device, equipment and medium
CN111481108A (en) Repositioning method and device of sweeper
CN113009911B (en) Cleaning path generation method and device and self-moving equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant