Cleaning path generation method, generation device, and cleaning robot
Patent Information
- Application Number
- CN202210199938.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-03-01
AI Technical Summary
[0005]本公开的主要目的在于提供一种清洁路径生成方法、清洁机器人的清洁方法、生成装置、计算机可读存储介质、处理器以及清洁机器人,以解决现有技术中缺乏可以判断哪些区域可以沿边清扫的方式的问题
[0017]In this embodiment of the invention, firstly, a target image of the contour of the space to be cleaned and/or the contour of obstacles in the space to be cleaned is acquired; then, the position information of each contour point is acquired and the curvature of each contour point is calculated based on the position information of each contour point in the contour, and the edge points of the contour are determined based on the curvature of each contour point; finally, an edge path is generated based on the edge points, and/or a non-edge path is generated based on the non-edge points, and a cleaning path is generated based on the edge path and/or the non-edge path. In the cleaning path generation method of this disclosure, by acquiring at least one of the position information of contour points in the contour of the clean space in the target image and the position information of contour points of obstacles therein, and then calculating the curvature of the contour points based on the position information of the contour points, and then determining the edge points based on the curvature of the contour points to generate edge paths that can be cleaned along the edge and/or non-edge paths that cannot be cleaned along the edge, it is possible to determine which areas can be cleaned along the edge, thus solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during task execution.
Smart Images

Figure CN116725433B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of cleaning robot technology, and more specifically, to a cleaning path generation method, a cleaning method for a cleaning robot, a generation device, a computer-readable storage medium, a processor, and a cleaning robot. Background Technology
[0002] Current cleaning robots use sensors to determine whether they can clean along edges of obstacles or walls during the cleaning process. However, because this method only detects the local position of obstacles, collisions are inevitable. Compared to household cleaning robots, commercial robots are larger and heavier. If they were to use the same method, the likelihood of collisions would be even greater, potentially leading to serious consequences.
[0003] Therefore, existing technologies lack a way to determine which areas can be cleaned along the edges.
[0004] The information disclosed above in the background section is only intended to enhance the understanding of the background art of the art described herein. Therefore, the background art may contain certain information that does not constitute prior art known to those skilled in the art in this country. Summary of the Invention
[0005] The main objective of this disclosure is to provide a cleaning path generation method, a cleaning method for a cleaning robot, a generation device, a computer-readable storage medium, a processor, and a cleaning robot to address the problem in the prior art of lacking a way to determine which areas can be cleaned along the edges.
[0006] According to one aspect of the present invention, a cleaning path generation method is provided, comprising: acquiring a target image, the target image including the contour of a space to be cleaned and / or the contour of an obstacle in the space to be cleaned; acquiring position information of each contour point, calculating the curvature of each contour point based on the position information of each contour point in the contour, determining edge points of the contour based on the curvature of each contour point; generating an edge path based on the edge points, and / or generating a non-edge path based on the non-edge points, and generating a cleaning path based on the edge path and / or the non-edge path.
[0007] Optionally, the position information of each contour point can be obtained, and the curvature of each contour point can be calculated based on the position information of each contour point in the contour. The edge points of the contour can be determined based on the curvature of each contour point, including: obtaining the position information of the target contour point and the position information of N adjacent contour points, and calculating the curvature of the target contour point according to the position information of the target contour point and the position information of each of the adjacent contour points, wherein the target contour point is one of the contour points and N is a positive integer greater than or equal to 2; determining the target contour point with a curvature less than a curvature threshold as a prospective edge point; if M consecutive target contour points are all prospective edge points, then determining the M target contour points as edge points, wherein M is a positive integer greater than or equal to 2.
[0008] Optionally, obtaining the position information of the target contour point and the position information of N adjacent contour points, and calculating the curvature of the target contour point based on the position information of the target contour point and the position information of each of the adjacent contour points, includes: obtaining the first coordinate value of the target contour point and the first coordinate value of each of the adjacent contour points; obtaining the second coordinate value of the target contour point and the second coordinate value of each of the adjacent contour points, wherein the first coordinate value is the coordinate value of the horizontal axis, and the second coordinate value is the coordinate value of the vertical axis, and the horizontal axis and the vertical axis are two coordinate axes in a two-dimensional coordinate system established with a point in the target image as the origin; calculating the difference between the first coordinate value of each of the adjacent contour points and the first coordinate value of the target contour point to obtain a first deviation value Xd; calculating the difference between the second coordinate value of each of the adjacent contour points and the second coordinate value of the target contour point to obtain a second deviation value Yd; and obtaining the curvature of the target contour point based on the first deviation value Xd and the second deviation value Yd.
[0009] Optionally, if M consecutive target contour points are all the prepared edge points, then determining that the M target contour points are all edge points includes: traversing all the target contour points to determine all the prepared edge points; determining whether there are M consecutive prepared edge points, and if there are M consecutive prepared edge points, then determining that the M consecutive prepared edge points are all edge points.
[0010] Optionally, acquiring the target image includes: acquiring an occupancy grid map of the space to be cleaned; dilating the occupancy grid map to obtain an expanded occupancy grid map; and extracting the contours from the expanded occupancy grid map to obtain the target image.
[0011] Optionally, after generating an edge path based on the edge points and / or generating a non-edge path based on the non-edge points, the method further includes: adjusting the color of the edge path in the target image to a first color, and adjusting the color of the non-edge path in the target image to a second color, wherein the first color and the second color are different.
[0012] According to another aspect of the present invention, a cleaning method for a cleaning robot is also provided, comprising: generating the cleaning path using any of the generation methods described herein; and controlling the cleaning robot to clean according to the cleaning path.
[0013] According to another aspect of the present invention, a cleaning path generation apparatus is also provided, comprising an acquisition unit, a calculation unit, and a generation unit, wherein the acquisition unit is configured to acquire a target image, the target image including the contour of a space to be cleaned and / or the contour of obstacles in the space to be cleaned; the calculation unit is configured to acquire position information of each contour point, calculate the curvature of each contour point based on the position information of each contour point in the contour, and determine the edge points of the contour based on the curvature of each contour point; the generation unit is configured to generate an edge path based on the edge points, and / or generate a non-edge path based on the non-edge points, and generate a cleaning path based on the edge path and / or the non-edge path.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein the program performs any of the methods described.
[0015] According to another aspect of the present invention, a processor is also provided, the processor being configured to run a program, wherein the program, when running, performs any of the methods described.
[0016] According to another aspect of the present invention, a cleaning robot is also provided, the cleaning robot including a cleaning structure, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the methods described.
[0017] In this embodiment of the invention, firstly, a target image of the contour of the space to be cleaned and / or the contour of obstacles in the space to be cleaned is acquired; then, the position information of each contour point is acquired and the curvature of each contour point is calculated based on the position information of each contour point in the contour, and the edge points of the contour are determined based on the curvature of each contour point; finally, an edge path is generated based on the edge points, and / or a non-edge path is generated based on the non-edge points, and a cleaning path is generated based on the edge path and / or the non-edge path. In the cleaning path generation method of this disclosure, by acquiring at least one of the position information of contour points in the contour of the clean space in the target image and the position information of contour points of obstacles therein, and then calculating the curvature of the contour points based on the position information of the contour points, and then determining the edge points based on the curvature of the contour points to generate edge paths that can be cleaned along the edge and / or non-edge paths that cannot be cleaned along the edge, it is possible to determine which areas can be cleaned along the edge, thus solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during task execution. Attached Figure Description
[0018] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure. In the drawings:
[0019] Figure 1 A flowchart of a cleaning path generation method according to a typical embodiment of the present disclosure is shown;
[0020] Figure 2 A schematic diagram of a cleaning path generation apparatus according to a typical embodiment of the present disclosure is shown;
[0021] Figure 3 A schematic diagram of a target image is shown in one specific embodiment of this disclosure;
[0022] Figure 4 The accompanying path and non-accounting path are illustrated in one specific embodiment of this disclosure. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be an intermediate element present. Furthermore, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element via a third element.
[0027] For ease of description, the following explains some of the terms or nouns used in the embodiments of this disclosure:
[0028] Occupied raster map: This is a discretized map representation where rasters have three states: occupied, free, and unknown.
[0029] Edge-following path: The edge-following path is a path that surrounds the environment, used for better cleaning along walls, obstacle edges, etc. There are two states for edge-following paths: one where sensor information can be used to follow the edge, allowing the robot to get closer to the wall and reduce blind spots; these points will be referred to as edge points later. The other state where sensor information cannot be used to follow the edge, and cleaning can only be done using ordinary path tracking, at a greater distance from the wall.
[0030] As mentioned in the background section, the prior art lacks a way to determine which areas can be cleaned along the edges. In order to solve the above problems, in a typical embodiment of this disclosure, a cleaning path generation method, a cleaning method of a cleaning robot, a generation device, a computer-readable storage medium, a processor, and a cleaning robot are provided.
[0031] According to embodiments of this disclosure, a method for generating a clean path is provided.
[0032] Figure 1 This is a flowchart of a cleaning path generation method according to an embodiment of the present disclosure. Figure 1 As shown, the method includes the following steps:
[0033] Step S101: Obtain a target image, wherein the target image includes the outline of the space to be cleaned and / or the outline of obstacles in the space to be cleaned;
[0034] Step S102: Obtain the position information of each contour point, and calculate the curvature of each contour point based on the position information of each contour point in the contour. Determine the edge point of the contour based on the curvature of each contour point. The contour point is the pixel point of the contour.
[0035] Step S103: Generate an edge path based on the edge points mentioned above, and / or generate a non-edge path based on the non-edge points. The edge path is the path that can be cleaned along the edge, and the non-edge path is the path that cannot be cleaned along the edge. A cleaning path is generated based on the edge path and / or the non-edge path mentioned above.
[0036] The aforementioned cleaning path generation method first acquires a target image of the contour of the space to be cleaned and / or the contour of obstacles in the space to be cleaned; then, it acquires the position information of each contour point and calculates the curvature of each contour point based on the position information of each contour point in the contour, and determines the edge points of the contour based on the curvature of each contour point; finally, it generates an edge path based on the edge points, and / or generates a non-edge path based on the non-edge points, and generates a cleaning path based on the edge path and / or the non-edge path. In this cleaning path generation method, by acquiring at least one of the position information of contour points in the contour of the cleaning space in the target image and the position information of contour points of obstacles therein, and then calculating the curvature of the contour points based on the position information of the contour points, and then determining the edge points based on the curvature of the contour points to generate edge paths that can be cleaned along the edge and / or non-edge paths that cannot be cleaned along the edge, it is possible to determine which areas can be cleaned along the edge, thus solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during task execution.
[0037] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0038] In one specific embodiment of this application, determining the edge points of the contour based on the curvature of the aforementioned contour points includes: determining the aforementioned contour points with at least a portion of curvature less than a curvature threshold as edge points. This allows for more accurate determination of edge points, thereby enabling more precise identification of which areas can be cleaned along the edges, further ensuring the safety of the cleaning robot during task execution.
[0039] In another embodiment of this application, generating an edge path based on the aforementioned edge points includes: generating an edge path using multiple consecutive edge points. Generating a non-edge path based on non-edge points includes: generating a non-edge path using multiple consecutive non-edge points.
[0040] In one embodiment of this disclosure, the method involves obtaining position information of each contour point, calculating the curvature of each contour point based on the position information of each contour point in the contour, and determining the edge points of the contour based on the curvature of each contour point. This includes: obtaining position information of a target contour point and position information of N adjacent contour points; calculating the curvature of the target contour point based on the position information of the target contour point and the position information of each of the adjacent contour points; the target contour point being one of a plurality of contour points, where N is a positive integer greater than or equal to 2; determining the target contour point whose curvature is less than the curvature threshold as a prospective edge point; and determining that if M consecutive target contour points are all prospective edge points, then the M consecutive target contour points are all edge points, where M is a positive integer greater than or equal to 2. Since the curvature of path points and their neighboring path points is relatively small in real-world environments, by calculating the curvature of each of the aforementioned contour points and determining the target contour points whose curvature is less than the aforementioned curvature threshold as preliminary edge points, edge points are roughly extracted. Then, if M consecutive contour points are all the aforementioned preliminary edge points, it can be accurately determined that M consecutive contour points are all edge points, thereby improving the accuracy of determining which areas can be cleaned along the edge.
[0041] In one specific embodiment, a portion of the N adjacent contour points are located on one side of the target contour point, and another portion is located on the other side of the target contour point. The target contour point and the contour points among the N adjacent contour points are adjacent to each other. For example, if N=4, there are 2 contour points on each side of the target contour point, and the 2 contour points on the left are adjacent, and one of the 2 contour points is adjacent to the target contour point. The 2 contour points on the right are adjacent, and one of the 2 contour points is adjacent to the target contour point. That is, the 5 contour points formed by the 4 adjacent contour points and the 1 target contour point are 5 consecutive contour points.
[0042] To facilitate the rapid and accurate calculation of the curvature of the target contour, thereby enabling the rapid and accurate determination of which areas can be cleaned along the edge, in another embodiment of this disclosure, the position information of the target contour point and the position information of N adjacent contour points are obtained, and the curvature of the target contour point is calculated based on the position information of the target contour point and the position information of each of the adjacent contour points. This includes: obtaining the first coordinate value of the target contour point and the first coordinate value of each of the adjacent contour points; obtaining the second coordinate value of the target contour point and the second coordinate value of each of the adjacent contour points, wherein the first coordinate value is the coordinate value of the horizontal axis and the second coordinate value is the coordinate value of the vertical axis; obtaining a first deviation value Xd based on the difference between the first coordinate value of each of the adjacent contour points and the first coordinate value of the target contour point; obtaining a second deviation value Yd based on the difference between the second coordinate value of each of the adjacent contour points and the second coordinate value of the target contour point; and obtaining the curvature of the target contour point based on the first deviation value Xd and the second deviation value Yd.
[0043] In one specific embodiment, the horizontal axis and the vertical axis are two coordinate axes in a two-dimensional coordinate system established with a point in the target image as the origin. A first deviation value Xd is obtained based on the difference between the first coordinate values of each adjacent contour point and the first coordinate value of the target contour point, including: calculating the difference between the first coordinate values of each adjacent contour point and the first coordinate value of the target contour point to obtain multiple first differences, and calculating the average of the multiple first differences to obtain the first deviation value Xd. A second deviation value Yd is obtained based on the difference between the second coordinate values of each adjacent contour point and the second coordinate value of the target contour point, including: calculating the difference between the second coordinate values of each adjacent contour point and the second coordinate value of the target contour point to obtain multiple second differences, and calculating the average of the multiple second differences to obtain the second deviation value Yd. The curvature of the target contour point is obtained based on the first deviation value Xd and the second deviation value Yd, including: using a formula... Calculate the curvature of the target contour points mentioned above.
[0044] In one specific embodiment of this disclosure, N is 6. The position information of the target contour point and the position information of three pairs of adjacent contour points are obtained. Assuming the target contour point is p4, the three points to the left are p3, p2, and p1, and the three points to the right are p5, p6, and p7, the curvature of the target contour point P4 is calculated as follows:
[0045] Xd=(p1.x+p2.x+p3.x+p5.x+p6.x+p7.x-2*3*p4.x) / 6
[0046] Yd=(p1.y+p2.y+p3.y+p5.y+p6.y+p7.y-2*3*p4.y) / 6
[0047] Where p1.x, p2.x, p3.x, p4.x, p6.x, p6.x and p7.x are the first coordinate values of points p1, p2, p3, p4, p5, p6 and p7 respectively, and p1.y, p2.y, p3.y, p4.y, p6.y, p6.y and p7.y are the second coordinate values of points p1, p2, p3, p4, p5, p6 and p7 respectively.
[0048] To further improve the accuracy of the extracted edge points, in another embodiment of this disclosure, if M consecutive target contour points are all the prepared edge points, then determining that the M consecutive target contour points are all edge points includes: traversing all the target contour points to determine all the prepared edge points; determining whether there are M consecutive prepared edge points, and if there are M consecutive prepared edge points, then determining that the M consecutive prepared edge points are all edge points.
[0049] In another embodiment of this disclosure, obtaining a target image includes: obtaining an occupancy grid map of the space to be cleaned; dilating the occupancy grid map to obtain an expanded occupancy grid map; and extracting contours from the expanded occupancy grid map to obtain the target image. By extracting contours from the expanded occupancy grid map, obtaining the target image is more efficient and accurate.
[0050] Specifically, the aforementioned dilation is a commonly used technique in the field of image processing. It refers to expanding the boundary points of a binarized object, increasing pixel values at the edges of the image, thereby expanding the overall pixel value. The dilation disclosed herein can be horizontal, vertical, or omnidirectional, and those skilled in the art can choose the appropriate dilation method based on the actual situation.
[0051] In another specific embodiment of this disclosure, the contours in the dilated occupied raster map are extracted to obtain the target image as shown below. Figure 3 As shown, it can depict the outline of the map and the outline of obstacles. Figure 3 In the diagram, the black area represents the occupied state, the white area represents the idle state, and the dashed line represents the outline of the extracted space to be cleaned and the outline of the obstacles in the space to be cleaned.
[0052] To make it easier to observe the position of the edge path, the edge path and the non-edge path are distinguished by different colors. After generating the edge path based on the edge point and / or generating the non-edge path based on the non-edge point, the method further includes: adjusting the color of the edge path in the target image to a first color and adjusting the color of the non-edge path in the target image to a second color, wherein the first color and the second color are different.
[0053] Of course, in practice, it's not limited to different colors for paths along the edge and non-paths; it can also be that the line types corresponding to these two paths are different, such as... Figure 4 As shown, the thin dashed line 101 represents the edge path, and the thick dashed line 102 represents the non-edge path. Of course, other different methods can also be used to distinguish between edge paths and non-edge paths.
[0054] According to another aspect of the present invention, a cleaning method for a cleaning robot is also provided, comprising: generating the cleaning path using any of the above-described generation methods; and controlling the cleaning robot to perform cleaning according to the cleaning path.
[0055] The cleaning method of the aforementioned cleaning robot controls the cleaning robot to clean according to the cleaning path generated by the aforementioned cleaning path generation method. The cleaning path generation method obtains at least one of the contour point position information in the contour of the cleaning space in the target image and the contour point position information of the obstacles therein. Then, it calculates the curvature of the contour points based on the position information of the contour points. After that, it determines the edge-side path that can be cleaned along the edge and the non-edge-side path that cannot be cleaned along the edge based on the curvature of the contour points. This can determine which areas can be cleaned along the edge, thus solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot in the process of performing the task.
[0056] This disclosure also provides a cleaning path generation apparatus. It should be noted that the cleaning path generation apparatus of this disclosure can be used to execute the cleaning path generation method provided in this disclosure. The cleaning path generation apparatus provided in this disclosure will be described below.
[0057] Figure 2 This is a schematic diagram of a cleaning path generation apparatus according to an embodiment of the present disclosure. Figure 2 As shown, the device includes:
[0058] The acquisition unit 10 is used to acquire a target image, wherein the target image includes the outline of the space to be cleaned and / or the outline of obstacles in the space to be cleaned.
[0059] The calculation unit 20 is used to obtain the position information of each contour point, and calculate the curvature of each contour point according to the position information of each contour point in the contour, and determine the edge point of the contour based on the curvature of each contour point, wherein the contour point is the pixel point of the contour.
[0060] The generation unit 30 is used to generate an edge path based on the edge points mentioned above, and / or generate a non-edge path based on the non-edge points. The edge path is a path that can be cleaned along the edge, and the non-edge path is a path that cannot be cleaned along the edge. The generation unit 30 is used to generate a cleaning path based on the edge path and / or the non-edge path mentioned above.
[0061] The cleaning path generation device includes an acquisition unit 10, a calculation unit 20, and a generation unit 30. The acquisition unit 10 acquires target images of the contour of the space to be cleaned and / or the contours of obstacles in the space to be cleaned. The calculation unit 20 acquires the position information of each contour point and calculates the curvature of each contour point based on the position information of each contour point in the contour. Based on the curvature of each contour point, the edge points of the contour are determined, and the contour points are the pixels of the contour. The generation unit 30 generates an edge path based on the edge points and / or generates a non-edge path based on the non-edge points. The edge path is the path that can be cleaned along the edge, and the non-edge path is the path that cannot be cleaned along the edge. A cleaning path is generated based on the edge path and / or the non-edge path. This device acquires at least one of the position information of contour points in the contour of the clean space in the target image and the position information of contour points of obstacles therein. Then, it calculates the curvature of the contour points based on their position information. Subsequently, it determines the edge points by the curvature of the contour points and generates edge paths that can be cleaned along the edge and / or non-edge paths that cannot be cleaned along the edge. This allows it to determine which areas can be cleaned along the edge, solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during the task.
[0062] In one specific embodiment of this application, determining the edge points of the contour based on the curvature of the aforementioned contour points includes: determining the aforementioned contour points with at least a portion of curvature less than a curvature threshold as edge points. This allows for more accurate determination of edge points, thereby enabling more precise identification of which areas can be cleaned along the edges, further ensuring the safety of the cleaning robot during task execution.
[0063] In another embodiment of this application, generating an edge path based on the aforementioned edge points includes: generating an edge path using multiple consecutive edge points. Generating a non-edge path based on non-edge points includes: generating a non-edge path using multiple consecutive non-edge points.
[0064] In one embodiment of this disclosure, the calculation unit includes a calculation subunit, a first determination subunit, and a second determination subunit. The calculation subunit acquires the position information of a target contour point and the position information of N adjacent contour points, and calculates the curvature of the target contour point based on the position information of the target contour point and the position information of each of the adjacent contour points. The first determination subunit determines target contour points with curvature less than a curvature threshold as prospective edge points. The second determination subunit determines that if M consecutive target contour points are all prospective edge points, then M consecutive target contour points are all edge points, where M is a positive integer greater than or equal to 2. Since the curvature of path points and their neighboring path points is relatively small in real-world environments, by calculating the curvature of each contour point and determining target contour points with curvature less than the curvature threshold as prospective edge points—that is, roughly extracting edge points—and then accurately determining that M consecutive contour points are edge points when M consecutive contour points are prospective edge points, the accuracy of determining which areas can be cleaned along the edge is improved.
[0065] In one specific embodiment, a portion of the N adjacent contour points are located on one side of the target contour point, and another portion is located on the other side of the target contour point. The target contour point and the contour points among the N adjacent contour points are adjacent to each other. For example, if N=4, there are 2 contour points on each side of the target contour point, and the 2 contour points on the left are adjacent, and one of the 2 contour points is adjacent to the target contour point. The 2 contour points on the right are adjacent, and one of the 2 contour points is adjacent to the target contour point. That is, the 5 contour points formed by the 4 adjacent contour points and the 1 target contour point are 5 consecutive contour points.
[0066] To facilitate the rapid and accurate calculation of the curvature of the target contour, thereby enabling the rapid and accurate determination of which areas can be cleaned along the edge, in another embodiment of this disclosure, the calculation subunit includes an acquisition module, a first calculation module, a second calculation module, and a third calculation module. The acquisition module acquires the first coordinate values of the target contour point and the first coordinate values of each of the adjacent contour points, and acquires the second coordinate values of the target contour point and the second coordinate values of each of the adjacent contour points. The first coordinate values are the coordinate values of the horizontal axis, and the second coordinate values are the coordinate values of the vertical axis. The first calculation module calculates the difference between the first coordinate values of each of the adjacent contour points and the first coordinate value of the target contour point to obtain a first deviation value Xd. The second calculation module calculates the difference between the second coordinate values of each of the adjacent contour points and the second coordinate value of the target contour point to obtain a second deviation value Yd. The third calculation module obtains the curvature of the target contour point based on the first deviation value Xd and the second deviation value Yd.
[0067] In one specific embodiment, the horizontal axis and the vertical axis are two coordinate axes in a two-dimensional coordinate system established with a point in the target image as the origin. The first calculation module is used to calculate the difference between the first coordinate value of each of the adjacent contour points and the first coordinate value of the target contour point, obtaining multiple first differences, and calculating the average of the multiple first differences to obtain a first deviation value Xd. The second calculation module is used to calculate the difference between the second coordinate value of each of the adjacent contour points and the second coordinate value of the target contour point, obtaining multiple second differences, and calculating the average of the multiple second differences to obtain a second deviation value Yd. The third calculation module is used to use a formula... Calculate the curvature of the target contour points mentioned above.
[0068] In one specific embodiment of this disclosure, N is 6. The position information of the target contour point and the position information of three pairs of adjacent contour points are obtained. Assuming the target contour point is p4, the three points to the left are p3, p2, and p1, and the three points to the right are p5, p6, and p7, the curvature of the target contour point P4 is calculated as follows:
[0069] Xd=(p1.x+p2.x+p3.x+p5.x+p6.x+p7.x-2*3*p4.x) / 6
[0070] Yd=(p1.y+p2.y+p3.y+p5.y+p6.y+p7.y-2*3*p4.y) / 6
[0071]
[0072] To further improve the accuracy of the extracted edge points, in another embodiment of this disclosure, the second determining subunit includes a first determining module and a second determining module. The first determining module is used to traverse all the target contour points and determine all the proposed edge points. The second determining module is used to determine whether there are M consecutive proposed edge points. If there are M consecutive proposed edge points, then all M consecutive proposed edge points are determined to be edge points. This process involves traversing all the contour points, determining all the proposed edge points, and determining each of the M consecutive proposed edge points as an edge point.
[0073] In another embodiment of this disclosure, the acquisition unit includes an acquisition subunit, an expansion subunit, and an extraction subunit. The acquisition subunit acquires an occupancy grid map of the space to be cleaned; the expansion subunit expands the occupancy grid map to obtain an expanded occupancy grid map; and the extraction subunit extracts contours from the expanded occupancy grid map to obtain the target image. By extracting contours from the expanded occupancy grid map, obtaining the target image is more efficient and accurate.
[0074] Specifically, the aforementioned dilation is a commonly used technique in the field of image processing. It refers to expanding the boundary points of a binarized object, increasing pixel values at the edges of the image, thereby expanding the overall pixel value. The dilation disclosed herein can be horizontal, vertical, or omnidirectional, and those skilled in the art can choose the appropriate dilation method based on the actual situation.
[0075] In another specific embodiment of this disclosure, the contours in the dilated occupied raster map are extracted to obtain the target image as shown below. Figure 3 As shown, it can depict the outline of the map and the outline of obstacles. Figure 3 In the diagram, the black area represents the occupied state, the white area represents the idle state, and the dashed line represents the outline of the extracted space to be cleaned and the outline of the obstacles in the space to be cleaned.
[0076] To make it easier to observe the position of the edge path, the device further includes an adjustment unit to distinguish the edge path from the non-edge path using different colors. The adjustment unit is used to adjust the color of the edge path in the target image to a first color and the color of the non-edge path in the target image to a second color after generating the edge path based on the edge point and / or generating the non-edge path based on the non-edge point. The first color and the second color are different.
[0077] Of course, in practice, it's not limited to different colors for paths along the edge and non-paths; it can also be that the line types corresponding to these two paths are different, such as... Figure 4 As shown, the thin dashed line 101 represents the edge path, and the thick dashed line 102 represents the non-edge path. Of course, other different methods can also be used to distinguish between edge paths and non-edge paths.
[0078] The aforementioned cleaning path generation device includes a processor and a memory. The aforementioned acquisition unit, calculation unit, and generation unit are all stored as program units in the memory, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0079] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the current lack of methods to determine which areas can be cleaned along their edges.
[0080] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0081] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements the above-described cleaning path generation method.
[0082] This invention provides a processor for running a program, wherein the program executes the cleaning path generation method.
[0083] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0084] Step S101: Obtain a target image, wherein the target image includes the outline of the space to be cleaned and / or the outline of obstacles in the space to be cleaned;
[0085] Step S102: Obtain the position information of each contour point, and calculate the curvature of each contour point based on the position information of each contour point in the contour. Determine the edge point of the contour based on the curvature of each contour point. The contour point is the pixel point of the contour.
[0086] Step S103: Generate an edge path based on the edge points mentioned above, and / or generate a non-edge path based on the non-edge points. The edge path is the path that can be cleaned along the edge, and the non-edge path is the path that cannot be cleaned along the edge. A cleaning path is generated based on the edge path and / or the non-edge path mentioned above.
[0087] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0088] This disclosure also provides a computer program product, which, when executed on a data processing device, is adapted to execute an initialization program having at least the following method steps:
[0089] Step S101: Obtain a target image, wherein the target image includes the outline of the space to be cleaned and / or the outline of obstacles in the space to be cleaned;
[0090] Step S102: Obtain the position information of each contour point, and calculate the curvature of each contour point based on the position information of each contour point in the contour. Determine the edge point of the contour based on the curvature of each contour point. The contour point is the pixel point of the contour.
[0091] Step S103: Generate an edge path based on the edge points mentioned above, and / or generate a non-edge path based on the non-edge points. The edge path is the path that can be cleaned along the edge, and the non-edge path is the path that cannot be cleaned along the edge. A cleaning path is generated based on the edge path and / or the non-edge path mentioned above.
[0092] In another typical embodiment of this disclosure, a cleaning robot is also provided, the cleaning robot including a cleaning structure, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing any of the above-described methods.
[0093] The aforementioned cleaning robot includes a cleaning structure, one or more processors, a memory, and one or more programs. These programs include methods for executing any of the methods described above. These methods acquire at least one of the position information of contour points in the contour of the cleaning space in the target image and the position information of contour points of obstacles therein. Then, they calculate the curvature of the contour points based on their position information. Finally, they determine the edge-side paths that can be cleaned along the edge and the non-edge-side paths that cannot be cleaned along the edge based on the curvature of the contour points. This determines which areas can be cleaned along the edge, solving the problem in the prior art of lacking a method to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during task execution.
[0094] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0095] In the several embodiments provided in this disclosure, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units described above can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0096] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0097] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0098] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0099] As can be seen from the above description, the embodiments of this disclosure achieve the following technical effects:
[0100] 1) The cleaning path generation method of this disclosure firstly acquires a target image of the contour of the space to be cleaned and / or the contour of obstacles in the space to be cleaned; then, it acquires the position information of each contour point and calculates the curvature of each contour point based on the position information of each contour point in the contour, and determines the edge points of the contour based on the curvature of each contour point; finally, it generates an edge path based on the edge points, and / or generates a non-edge path based on the non-edge points, and generates a cleaning path based on the edge path and / or the non-edge path. In the cleaning path generation method of this disclosure, by acquiring at least one of the position information of contour points in the contour of the cleaning space in the target image and the position information of contour points of obstacles therein, and then calculating the curvature of the contour points based on the position information of the contour points, and then determining the edge points based on the curvature of the contour points to generate an edge path that can be cleaned along the edge and / or a non-edge path that cannot be cleaned along the edge, it is possible to determine which areas can be cleaned along the edge, thus solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot in the process of performing the task.
[0101] 2) The cleaning method of the cleaning robot disclosed herein controls the cleaning robot to clean according to the cleaning path generated by the cleaning path generation method. The cleaning path generation method obtains at least one of the contour point position information in the contour of the cleaning space in the target image and the contour point position information of the obstacle therein, then calculates the curvature of the contour point based on the position information of the contour point, and then determines the edge-side path that can be cleaned along the edge and the non-edge-side path that cannot be cleaned along the edge based on the curvature of the contour point. This can determine which areas can be cleaned along the edge, solving the problem of the lack of a method to determine which areas can be cleaned along the edge in the prior art, thereby ensuring the safety of the cleaning robot in the process of performing the task.
[0102] 3) The cleaning path generation device of this disclosure includes an acquisition unit, a calculation unit, and a generation unit. The acquisition unit 10 acquires target images of the contour of the space to be cleaned and / or the contours of obstacles in the space to be cleaned. The calculation unit 20 acquires the position information of each contour point and calculates the curvature of each contour point based on the position information of each contour point in the contour. Based on the curvature of each contour point, the edge points of the contour are determined, and the contour points are the pixels of the contour. The generation unit 30 generates an edge path based on the edge points and / or generates a non-edge path based on the non-edge points. The edge path is the path that can be cleaned along the edge, and the non-edge path is the path that cannot be cleaned along the edge. A cleaning path is generated based on the edge path and / or the non-edge path. This device acquires at least one of the position information of contour points in the contour of the clean space in the target image and the position information of contour points of obstacles therein. Then, it calculates the curvature of the contour points based on their position information. Subsequently, it determines the edge points by the curvature of the contour points and generates edge paths that can be cleaned along the edge and / or non-edge paths that cannot be cleaned along the edge. This allows it to determine which areas can be cleaned along the edge, solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during the task.
[0103] 4) The cleaning robot disclosed herein includes a cleaning structure, one or more processors, a memory, and one or more programs. The one or more programs include methods for performing any of the above-described methods. These methods acquire at least one of the position information of contour points in the contour of the cleaning space in the target image and the position information of contour points of obstacles therein. Then, they calculate the curvature of the contour points based on the position information of the contour points. Subsequently, they determine the edge points by the curvature of the contour points and generate edge-side paths that can be cleaned along the edge and non-edge-side paths that cannot be cleaned along the edge. This method can determine which areas can be cleaned along the edge, solving the problem of the lack of a method in the prior art to determine which areas can be cleaned along the edge, thereby ensuring the safety of the cleaning robot during task execution.
[0104] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating a clean path, characterized in that, include: Acquire a target image, the target image including the outline of the space to be cleaned and / or the outline of obstacles in the space to be cleaned; Obtain the position information of each contour point, calculate the curvature of each contour point based on the position information of each contour point in the contour, and determine the edge points of the contour based on the curvature of each contour point. An edge-following path is generated based on the edge-following points, and / or a non-edge-following path is generated based on the non-edge-following points; a clean path is generated based on the edge-following path and / or the non-edge-following path. The step of determining the edge points of the contour based on the curvature of each contour point includes: determining the contour points whose curvature is at least partially less than a curvature threshold as the edge points.
2. The method according to claim 1, characterized in that, Obtain the position information of each contour point, calculate the curvature of each contour point based on the position information of each contour point in the contour, and determine the edge points of the contour based on the curvature of each contour point, including: Obtain the position information of the target contour point and the position information of N adjacent contour points, and calculate the curvature of the target contour point based on the position information of the target contour point and the position information of each of the adjacent contour points. The target contour point is one of the contour points, and N is a positive integer greater than or equal to 2. The target contour points with curvature less than the curvature threshold are identified as pre-edge points; If M consecutive target contour points are all the pre-edge points, then the M target contour points are determined to be edge points, where M is a positive integer greater than or equal to 2.
3. The method according to claim 2, characterized in that, Acquire the position information of the target contour point and the position information of N adjacent contour points, and calculate the curvature of the target contour point based on the position information of the target contour point and the position information of each of the adjacent contour points, including: Obtain the first coordinate value of the target contour point and the first coordinate value of each of the adjacent contour points, and obtain the second coordinate value of the target contour point and the second coordinate value of each of the adjacent contour points, wherein the first coordinate value is the coordinate value of the horizontal axis and the second coordinate value is the coordinate value of the vertical axis. The first deviation value Xd is obtained based on the difference between the first coordinate value of each of the adjacent contour points and the first coordinate value of the target contour point. The second deviation value Yd is obtained based on the difference between the second coordinate value of each of the adjacent contour points and the second coordinate value of the target contour point. The curvature of the target contour point is obtained based on the first deviation value Xd and the second deviation value Yd.
4. The method according to claim 2, characterized in that, If M consecutive target contour points are all the pre-selected edge points, then determining that the M target contour points are all edge points includes: Traverse all the target contour points to determine all the pre-selected edge points; Determine whether there are M consecutive prepared edge points. If there are M consecutive prepared edge points, then determine that the M consecutive prepared edge points are all edge points.
5. The method according to any one of claims 1 to 4, characterized in that, Acquire the target image, including: Obtain the occupied grid map of the space to be cleaned; The occupied grid map is expanded to obtain the expanded occupied grid map; The target image is obtained by extracting the contours from the dilated occupied raster map.
6. The method according to any one of claims 1 to 4, characterized in that, After generating an edge-along path based on the edge-along points, and / or generating a non-edge-along path based on the non-edge-along points, the method further includes: The color of the edge-following path in the target image is adjusted to a first color, and the color of the non-edge-following path in the target image is adjusted to a second color, wherein the first color and the second color are different.
7. A cleaning method for a cleaning robot, characterized in that, include: The cleaning path is generated using the generation method described in any one of claims 1 to 6; Control the cleaning robot to clean according to the cleaning path.
8. A cleaning path generation device, characterized in that, include: An acquisition unit is used to acquire a target image, the target image including the outline of the space to be cleaned and / or the outline of obstacles in the space to be cleaned; The calculation unit is used to obtain the position information of each contour point, calculate the curvature of each contour point based on the position information of each contour point in the contour, and determine the edge points of the contour based on the curvature of each contour point. A generation unit is configured to generate an edge-along path based on the edge-along points, and / or generate a non-edge-along path based on the non-edge-along points, and generate a clean path based on the edge-along path and / or the non-edge-along path; The calculation unit is further configured to determine the contour points with at least a portion of curvature less than a curvature threshold as edge points.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program performs the method according to any one of claims 1 to 7.
10. A processor, characterized in that, The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 7 when it runs.
11. A cleaning robot, characterized in that, include: A clean structure, one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising methods for performing any one of claims 1 to 7.
Citation Information
Patent Citations
Self-propelled robot and control method thereof
CN111949021A
Obstacle classification obstacle avoidance control method based on TOF camera
CN112327878A