Methods for setting map region contours and robot edge-tracing control methods
By setting the area to be cleaned on the map, the robot walks in a preset clockwise direction, accurately determining whether the outline of the work area has been cleaned, thus solving the problem of repeated cleaning or premature termination of the cleaning robot and improving cleaning efficiency.
Patent Information
- Application Number
- CN202210596096.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-05-30
AI Technical Summary
Existing cleaning robots have difficulty accurately determining whether they have finished cleaning the outline of a room when cleaning along the edges, leading to repeated cleaning or premature termination, thus reducing work efficiency.
By using a method based on the map region outline, the robot acquires a map of the work area, searches for corner points, sets the rectangular areas where adjacent corner points are located as the edge-tracing unit areas, divides the work area along a preset clockwise direction, and determines whether the edge-tracing trajectory covers all the edge-tracing unit areas to decide whether to end the edge-tracing.
It can accurately determine whether the robot has covered the entire work area, avoid repeated cleaning or premature termination, and improve cleaning efficiency. Especially in the presence of obstacles or virtual walls, it can adjust its walking strategy in a timely manner.
Smart Images

Figure CN117193277B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of robot walking along edges in indoor areas, and more particularly to a method for setting up a map-based area outline and a method for controlling the robot to stop walking along edges. Background Technology
[0002] Currently, cleaning robots use visual technology to collect location information and clean along the walls of a room. They typically plan the cleaning of the entire room area based on a historical map before performing edge cleaning to improve coverage and remove debris from hard-to-reach areas. However, due to the diverse wall layouts and furniture arrangements in different homes, complex cleaning environments can easily arise. Furthermore, as the robot moves along the walls, the accumulated error of its sensors increases. Therefore, traditional methods for determining when the robot should stop edge cleaning (after completing a full circle along the room's outline) are often untimely or misjudged. For example, if the difference between the rotation angle recorded at the current position and the rotation angle recorded at the starting point of edge cleaning is a positive integer multiple of 360 degrees, the robot may continue cleaning within the same local area, resulting in repeated cleaning and reduced efficiency. Summary of the Invention
[0003] To address the aforementioned technical deficiencies, this invention discloses a method for setting map region contours and a method for robot edge-to-edge control, the specific technical solutions of which are as follows: The method for setting up a map-based region outline involves the robot acquiring a map of the work area before execution. This map represents the outline of the work area, allowing the robot to move along the outline. The method includes: the robot searching for corner points of the work area from the map; then, the robot setting a rectangular area containing two adjacent corner points as a region to be traversed, wherein the two adjacent corner points are covered by the region to be traversed; in the map, the outline that corresponds to the extension direction of the two adjacent corner points covered by each region to be traversed is represented by the region to be traversed or the two adjacent corner points covered by that region.
[0004] Further, the method for the robot to set the rectangular region containing two adjacent corner points as the edge-following unit region includes: when the coordinate values of one dimension of two adjacent corner points are equal, selecting a line segment parallel to the line connecting the two adjacent corner points as the long side of the rectangular region, and setting the length of the long side of the rectangular region to a first preset multiple of the straight-line distance between the two adjacent corner points to construct the rectangular region; then setting the rectangular region as the edge-following unit region; wherein, the first preset multiple is greater than or equal to 1; when the coordinate values of the same dimension of two adjacent corner points are not equal, selecting a line segment parallel to the line connecting the two adjacent corner points or a line segment intersecting the line connecting the two adjacent corner points as the diagonal of the rectangular region, and setting the length of the diagonal of the rectangular region to a second preset multiple of the straight-line distance between the two adjacent corner points to construct the rectangular region; then setting the rectangular region as the edge-following unit region; wherein, the second preset multiple is greater than 1; wherein, the two adjacent corner points are the two corner points uniquely covered by the rectangular region.
[0005] Furthermore, during the process of setting the area to be edged within the working area, the following situations exist: When the coordinate values of one dimension of two adjacent corner points are equal, the long side of the rectangular area includes two endpoints. One endpoint extends along the direction parallel to the line connecting the two adjacent corner points to the other endpoint, thus obtaining the long side of the rectangular area. The length of the line connecting the two endpoints is equal to a first preset multiple of the straight-line distance between the two adjacent corner points, and the projection line segment of the line connecting the two adjacent corner points onto the line connecting the two endpoints does not exceed the line connecting the two endpoints. When the coordinate values of one dimension of two adjacent corner points are equal, there is a midpoint on the perpendicular line connecting the two adjacent corner points. Starting from this midpoint, the line extends along the direction parallel to the line connecting the two adjacent corner points to both sides of the midpoint, thus obtaining the long side of the rectangular area. The sum of the lengths extended on both sides of the midpoint is equal to a first preset multiple of the straight-line distance between the two adjacent corner points, and the projection line segment of the line connecting the two adjacent corner points onto the long side of the rectangular area does not exceed the long side of the rectangular area. When the coordinate values of one dimension of two adjacent corner points are equal, there is a midpoint on the perpendicular line connecting the two adjacent corner points. Starting from this midpoint, the line extends along the direction parallel to the line connecting the two adjacent corner points to both sides of the midpoint, thus obtaining the long side of the rectangular area. When the coordinate values of one dimension of two adjacent corner points are equal, the projection line segment of the line connecting the two adjacent corner points onto the long side of the rectangular area does not exceed the long side of the rectangular area. When the coordinate values of the same dimension at each corner point are not equal, the diagonal of the rectangular region includes two endpoints. One endpoint extends towards the other endpoint along a direction parallel to the line connecting the two adjacent corner points, or along a direction intersecting the line connecting the two adjacent corner points, thus obtaining the diagonal of the rectangular region. The length of the line connecting the two endpoints is equal to a second preset multiple of the straight-line distance between the two adjacent corner points, and the projection of the line connecting the two adjacent corner points onto the line connecting the two endpoints does not exceed the line connecting the two endpoints. When the coordinate values of the same dimension at each of the two adjacent corner points are not equal, there is a midpoint on the perpendicular line connecting the two adjacent corner points. Starting from this midpoint, the lines extend towards both sides of the midpoint along a direction parallel to the line connecting the two adjacent corner points, or along a direction intersecting the line connecting the two adjacent corner points, thus obtaining the diagonal of the rectangular region. The sum of the lengths extended on both sides of the midpoint is equal to a second preset multiple of the straight-line distance between the two adjacent corner points, and the projection of the line connecting the two adjacent corner points onto the diagonal of the rectangular region does not exceed the diagonal of the rectangular region.
[0006] Furthermore, the method by which the robot sets the rectangular region containing two adjacent corner points as the edge-following unit region includes: when the coordinate values of one dimension of two adjacent corner points are equal, the line connecting the two adjacent corner points is set as the long side of the rectangular region so that the length of the rectangular region is equal to the straight-line distance between the two adjacent corner points, thus constructing a rectangular region, wherein the two adjacent corner points are the only two corner points covered by the rectangular region; and then the rectangular region is set as the edge-following unit region; when the coordinate values of the same dimension of two adjacent corner points are not equal, the line connecting the two adjacent corner points is selected as the diagonal of the rectangular region, thus constructing a rectangular region, wherein the two adjacent corner points are the only two corner points covered by the rectangular region; and then the rectangular region is set as the edge-following unit region.
[0007] Furthermore, the minimum side length of the area to be edged is greater than or equal to the robot's body width, or greater than or equal to the wall thickness of the working area, so as to reserve space for the robot to enter the area to be edged.
[0008] Furthermore, when the robot's edge-walking trajectory passes through the area to be edge-walked, it is determined that the robot has walked along a contour segment that is consistent with the extension direction of the two adjacent corner points covered by the area to be edge-walked; the contour of the working area is composed of multiple contour segments connected together; each contour segment corresponds to two adjacent corner points; wherein, when each contour segment is expressed in the map by the area to be edge-walked where the corresponding two adjacent corner points are located in a preset clockwise direction, the coordinate coverage range of each area to be edge-walked in the working area and the order of each area to be edge-walked in the preset clockwise direction are recorded sequentially in the robot's memory; wherein, when each contour segment is expressed in the map by the corresponding two adjacent corner points in a preset clockwise direction, the coordinates of each pair of adjacent corner points in the working area and the order of each pair of adjacent corner points in the preset clockwise direction are recorded sequentially in the robot's memory.
[0009] Furthermore, during the process of setting the edge-following unit area within the working area, a pre-selected corner point is first marked as the current corner point. Starting from the current corner point, the nearest corner point is selected according to the preset clockwise direction and marked as the next corner point. Then, the rectangular area where the two corner points are located is set as the edge-following unit area. The sorting and coordinate coverage of the edge-following unit area and the corresponding corner points in the preset clockwise direction are recorded, and the current corner point and the next corner point are marked as the two adjacent corner points. Then, the next corner point is updated to the current corner point, and so on, until the corresponding edge-following unit area is set at the location of all two adjacent corner points, and the coordinate coverage of all edge-following unit areas in the working area and their sorting in the preset clockwise direction are obtained.
[0010] Furthermore, the method for the robot to search for corner points of the work area from the map includes: in the map, the robot starts from a pre-set search starting point and obtains corner points through neighborhood search; wherein, the search starting point is a pixel point used to represent an obstacle; wherein, the corner point is the intersection of a set of mutually perpendicular contour line segments in the map, and the intersection point is the endpoint of the contour line segment; the contour line segment is marked by the robot in advance when traversing the work area.
[0011] Furthermore, when only one pixel representing an obstacle is found in the neighborhood of the search starting point, the search starting point is set as a corner point, and the pixel is marked as a current candidate point. Then, a search is performed in the neighborhood of the current candidate point. If no pixel is collinear with the current candidate point and the search starting point, the current candidate point is marked as a corner point found in the neighborhood of the search starting point, and the search starting point and the current candidate point are marked as the two adjacent corner points. If a pixel is collinear with the current candidate point and the search starting point, the current candidate point is updated as a transition point, and the pixel is updated as the current candidate point. The search is then performed in the neighborhood of the current candidate point, and this process is repeated until no pixel is collinear with the current candidate point and the transition point, at which point the current candidate point is marked as a corner point.
[0012] A robot edge-tracing termination control method includes: the robot executing a map region contour-based setting method to set multiple edge-tracing unit regions; then the robot walking along the edge within the working area; when the robot has walked through all the edge-tracing unit regions, the robot stops walking along the edge; when the robot repeatedly walks through the same batch of edge-tracing unit regions, the robot stops walking along the edge; wherein the same batch of edge-tracing unit regions are a preset number of different edge-tracing unit regions; and wherein the number of edge-tracing unit regions set by the setting method is greater than the preset number.
[0013] Furthermore, the larger the size of the obstacles in the working area and / or the larger the working restricted area set by the virtual wall, the smaller the preset quantity is set; the smaller the size of the obstacles in the working area and / or the smaller the working restricted area set by the virtual wall, the larger the preset quantity is set; the larger the overlapping area of two edge-following unit areas, the smaller the preset quantity is set.
[0014] Furthermore, whenever the robot repeatedly walks through the same batch of edge-following unit areas, the robot walks through each edge-following unit area in a preset clockwise direction or the opposite direction of the preset clockwise direction; during the robot's repetition of walking through the same batch of edge-following unit areas, each edge-following unit area in the same batch is walked through by the robot only once; wherein, all edge-following unit areas in the same batch are arranged in the working area in the preset clockwise direction.
[0015] Furthermore, when the robot's real-time recorded x-coordinate is greater than the minimum x-coordinate of the vertex of the edge-following unit region and less than the maximum x-coordinate of the vertex of the edge-following unit region, and the robot's real-time recorded y-coordinate is greater than the minimum y-coordinate of the vertex of the edge-following unit region and less than the maximum y-coordinate of the vertex of the edge-following unit region, the robot enters the edge-following unit region, and it is determined that the robot's edge-following trajectory passes through the edge-following unit region, and it is determined that the robot has walked through the edge-following unit region; wherein, the edge-following unit region is a planar region in the map.
[0016] Furthermore, after the robot enters the last untraveled edge-tracing unit area in a preset clockwise direction, it is determined that the robot's edge-tracing trajectory passes through all edge-tracing unit areas, and then the robot stops edge-tracing. The order of the edge-tracing unit areas in the preset clockwise direction is obtained first, so as to determine the relative positional relationship of one of the edge-tracing unit areas in the preset clockwise direction.
[0017] The beneficial technical effect of this invention lies in the fact that it first represents the outline of the work area by using a rectangular region or two corner points corresponding to two adjacent corner points in a preset clockwise direction. This allows the robot to identify its edge-walking status by determining whether its edge-walking trajectory passes through the rectangular region corresponding to the two corner points. Furthermore, it determines whether to stop edge-walking by judging whether the robot's edge-walking trajectory has sequentially covered the map outline segment corresponding to the entire work area in a preset clockwise direction. This not only facilitates the determination of the outline segment along which the robot has traversed the work area but also accurately determines whether to end the edge-walking mode, avoiding the robot repeatedly traversing local areas or prematurely ending edge-walking due to misjudgment, thus improving the robot's working efficiency within the work area.
[0018] In addition, when an abnormal situation occurs where the work area is partially blocked by obstacles or restricted by virtual walls, the robot will not be able to walk smoothly along the edge of the work area. In this case, it is only necessary to determine that the robot has repeatedly walked through a certain number of rectangular areas and that it does not linger in the same rectangular area each time. This will indicate that the robot has encountered an abnormality in the process of walking along the edge, so that it can stop walking along the edge in time to ensure work efficiency. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the corner points of the working area and the area of the edge-to-edge unit (a rectangular area surrounding two adjacent corner points) disclosed in an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the robot's edge-walking trajectory and the edge-traversing unit areas it passes through in a scenario where an indoor area is blocked by a virtual wall or obstacle, as disclosed in another embodiment of the present invention.
[0021] Figure 3 This is a flowchart of a robot edge-end control method disclosed in another embodiment of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. To further illustrate the embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, mainly used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention. The flowchart depicts a process or method. Although the flowchart describes the steps as sequential processes, many of the steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. The process can be terminated when its operation is complete, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0023] In general, the robot's edge-walking involves starting from any location within the room and searching for a wall, which can be considered the room's outline. Upon detecting a wall, the robot adjusts its direction of travel to be parallel to the wall. The wall can be divided into two adjacent parallel walls, and the room's outline, contour line, or contour segment can be considered the projection of the wall onto the horizontal ground. This detected wall location is then recorded as the edge-walking start point. The robot's coordinates and angle of travel (the angle of travel relative to the X-axis or Y-axis) are recorded in a real-time map. Starting from this edge-walking start point, the robot continues its edge-walking (traveling along the room's outline) while remaining parallel to the wall. The robot's direction of travel is adjusted to be parallel to the wall's extension direction, forming the posture the robot should maintain during edge-walking. In embodiments where the robot is a cleaning robot, there is a global edge-walking mode where the cleaning robot travels along the entire terrain's outline, with its direction of travel adjusted to be parallel to the entire terrain's outline. The cleaning robot performs global edge-walking within the indoor work area, for example, walking along the outline of a wall, with the robot's direction of movement parallel to the wall's outline. In this edge-walking mode, the robot marks each point it passes along the edge in a real-time constructed map, enabling the creation of a historical map of the room before executing the corner-based setting method and the robot's edge-walking termination control method disclosed in this invention.
[0024] As one embodiment, a method for setting map region contours is disclosed to simplify the existing method for setting map region contours. The execution subject of this method is a robot, specifically a robot that internally stores historical maps. This can be understood as a controller installed inside the robot capable of running program code. The map region contour describes the contour of the work area within the map and is suitable for robots preparing to perform edge walking, especially robots preparing to perform edge walking within a work area. The robot has pre-traversed the work area and has already constructed local maps of each partition within the work area, which are combined into a global map. The historical map of the work area is relative to the map currently constructed by the robot. In this embodiment, the historical map is used to represent the contour of the work area so that the robot can walk along the corresponding contour.
[0025] Specifically, the setting method includes: the robot searching for corner points of the work area from the map, that is, searching for the identified corner points in the work area from the historical map and forming a corner point map. The search method includes, but is not limited to, extracting all corner points from neighboring pixels using a corner point extraction algorithm. For example, if a pixel has a large difference in grayscale value (too bright or too dark) from its neighboring pixels, then it is more likely to be a corner point. The search method also includes graph search algorithms based on four-neighborhood, eight-neighborhood, etc., which is equivalent to the robot searching for corner points in the work area. After acquiring all corner points within the working area, the robot sets the rectangular areas containing two adjacent corner points with a specific geometric relationship as edge-following unit areas. Specifically, it sets the rectangular areas containing two adjacent corner points with a specific geometric relationship as edge-following unit areas according to a preset clockwise direction. This allows the robot to divide the working area into multiple edge-following unit areas along the preset clockwise direction. The preset clockwise direction can be considered as the direction of movement the robot relies on for edge walking. It can be set to be parallel to the extension direction of the outline of the working area. The preset clockwise direction can be clockwise or counterclockwise, corresponding to the edge cleaning direction in the edge-following mode of the cleaning robot. Two adjacent corner points are covered by the edge-following unit areas they belong to.
[0026] It should be noted that the robot can sequentially save each corner point and / or edge-following unit area into the linear storage space according to the preset clockwise acquisition order. This allows the robot to extract the corresponding corner point or edge-following unit area during edge-following movement in the preset clockwise direction. The order of each pair of adjacent corner points and their corresponding edge-following unit areas in the preset clockwise direction can simplify the representation of the order in which the robot traverses or moves through the areas.
[0027] Based on this, in this embodiment, the contour segment whose extension direction is consistent with that of the two adjacent corner points covered by each edge-following unit area is represented by the edge-following unit area or the two adjacent corner points covered by that edge-following unit area. Specifically, the contour segment whose extension direction in a preset clockwise direction is consistent with that of the two adjacent corner points covered by the edge-following unit area is represented by the edge-following unit area or the two adjacent corner points covered by that edge-following unit area, thereby simplifying the contour of the working area. Therefore, this embodiment represents the contour of the working area by using a rectangular area or two corner points corresponding to two adjacent corner points in a preset clockwise direction, so that the robot can identify the edge-following situation by judging whether the edge-following trajectory passes through the rectangular area corresponding to the two corner points.
[0028] It should be noted that the work area is the area to be cleaned, which can be a single room unit in a home, a portion of a room unit, a room area composed of multiple room units, or a home space. The area to be cleaned can also be an office in an office building, a large shopping mall, or a public place such as an airport. In this embodiment, the work area is not specifically limited.
[0029] In the work area, the robot uses visual sensors (cameras or depth cameras) installed on its body to collect position information in the environment, and then converts the collected position information into pixels, which are then configured one by one in a grid map composed of unit grids. Each unit grid corresponds to a pixel and is configured with corresponding map coordinates. The map coordinate system is different from the sensor coordinate system, but it is also configured with an origin, Y-axis and X-axis.
[0030] As one embodiment, the method for the robot to set the rectangular area containing two adjacent corner points as the area to be traversed includes: when the coordinate values of one dimension of two adjacent corner points are equal, selecting the line segment parallel to the line connecting the two adjacent corner points as the long side of the rectangular area, and setting the length of the long side of the rectangular area to be a first preset multiple of the straight-line distance between the two adjacent corner points to construct the rectangular area. Preferably, the length of the short side of the rectangular area is related to the robot's body width or the thickness of the wall to facilitate robot passage. The specific construction method of the rectangular area is as follows: when the x-coordinate values of two adjacent corner points are equal or the y-coordinate values of these two corner points are equal, the line segment parallel to the line connecting the two adjacent corner points is selected as the long side of the rectangular area, and the length of the long side of the rectangular area is set to be a first preset multiple of the straight-line distance between the two adjacent corner points. The length of the short side of the rectangular area is greater than the robot's body width or the wall thickness, and the rectangular area is set to cover only two corner points, which are the two adjacent corner points. Then, the rectangular area is set as the edge-following unit area, where the first preset multiple is greater than or equal to 1; the length of the long side of the rectangular area (generally the side belonging to the width direction of the rectangular area) is greater than or equal to the length of the short side of the rectangular area (generally the side belonging to the height direction of the rectangular area). In some embodiments, two edge-following unit areas set along a preset clockwise direction (which can be regarded as two adjacent edge-following unit areas) may have a large overlapping area, but this does not affect the representation of the outline in the map, nor does it affect the robot's edge-following movement based on the edge-following unit area and the corner points it covers. This process is repeated, setting the rectangular area containing every two adjacent corner points as the edge-following unit area. Specifically, this is done along a preset clockwise direction, setting the rectangular area containing every two adjacent corner points as the edge-following unit area, until all corner points are set within the working area. This allows each edge-following unit area to not completely overlap.
[0031] It should be noted that when two adjacent corner points have the same coordinate value in one dimension, the long side of the rectangular region includes two endpoints. The long side of the rectangular region can be considered as being formed by connecting these two endpoints, which are located outside the two adjacent corner points. One endpoint extends towards the other endpoint along a line parallel to the line connecting the two adjacent corner points, thus forming the long side of the rectangular region. The length of the line connecting the two endpoints is equal to a first preset multiple of the straight-line distance between the two adjacent corner points, and the projection of the line connecting the two adjacent corner points onto the line connecting the two endpoints does not extend beyond the line connecting the two endpoints. In this embodiment... The rectangular area covers two corner points, and these two adjacent corner points are the only two corner points covered by the rectangular area. In some embodiments, the long side of the rectangular area can extend from the left side to the right side of one of the two adjacent corner points, or it can extend from the right side to the left side of one of the two adjacent corner points. The two long sides of the rectangular area can both extend in the same direction or in opposite directions. The two long sides of the rectangular area are located on both sides of the line connecting the two adjacent corner points, so that the line connecting the two adjacent corner points is surrounded inside by the two short sides perpendicular to the long side of the rectangular area.
[0032] It should be noted that when the coordinate values of one dimension of two adjacent corner points are equal, there is a midpoint on the perpendicular line connecting the two adjacent corner points. This midpoint can be located above, below, to the left, or to the right of the line connecting the two adjacent corner points. Starting from this midpoint, extending along a direction parallel to the line connecting the two adjacent corner points to both sides of the midpoint, the long side of the rectangular region is obtained. The sum of the lengths extended to both sides of the midpoint is equal to a first preset multiple of the straight-line distance between the two adjacent corner points, that is, equal to the length of the long side of the rectangular region. The projection of the line connecting the two adjacent corner points onto the long side of the rectangular region does not exceed the long side of the rectangular region. In some embodiments, the long side of the rectangular region can be extended from the midpoint to the left and to the right of the midpoint, respectively. In some embodiments, the adjacent corner points... A first midpoint is set vertically above the line connecting the points, and a second midpoint is set vertically below the line connecting the two adjacent corner points. The long side of the rectangular area includes a first long side and a second long side. The first long side is located above the line connecting the two adjacent corner points, and the second long side is located below the line connecting the two adjacent corner points. Starting from the first midpoint, the first long side of the rectangular area is obtained by extending along the direction parallel to the line connecting the two adjacent corner points to both sides of the first midpoint. At the same time, starting from the second midpoint, the second long side of the rectangular area is obtained by extending along the direction parallel to the line connecting the two adjacent corner points to both sides of the second midpoint. The distance between the first and second long sides of the rectangular area is equal to the length of the short side of the rectangular area, so as to achieve the effect of combining the two short sides perpendicular to the long side of the rectangular area to enclose the line connecting the two adjacent corner points inside it.
[0033] In some embodiments, when two adjacent corner points have the same coordinate value in one dimension, the line connecting these two corner points is selected as the longer side of the rectangular region, making the length of the longer side of the rectangular region equal to the straight-line distance between the two adjacent corner points. This rectangular region is then set as the edge-following unit region. The rectangular region covers two corner points, which are the two adjacent corner points. These two adjacent corner points are uniquely covered by the rectangular region, ensuring that different edge-following unit regions do not completely overlap. For example, if the two closest corner points in a preset clockwise direction have equal x-coordinates or equal y-coordinates, the line connecting these two adjacent corner points is selected as the longer side of the rectangular region, making the length of the rectangular region equal to the straight-line distance between the two adjacent corner points. The length of the shorter side of the rectangular region is set to be greater than or equal to the robot's body width, and the two corner points covered by the rectangular region are set as the two adjacent corner points. This rectangular region is then marked as the edge-following unit region. This further simplifies the outline representation of the working area.
[0034] As one embodiment, the method for the robot to set the rectangular area containing two adjacent corner points as the area to be covered by the edge includes: when the coordinate values of the same dimension (the horizontal coordinate values are not equal and the vertical coordinate values are not equal) of two adjacent corner points are not equal, a line segment parallel to the line connecting the two adjacent corner points is selected as the diagonal of the rectangular area, and the length of the diagonal is set to a second preset multiple of the straight-line distance between the two adjacent corner points to construct a rectangular area, wherein the rectangular area covers only two corner points, and the two adjacent corner points are the only two corner points covered by the rectangular area. Preferably, the length of the short side of the rectangular area is related to the width of the robot's body or the thickness of the wall to facilitate the robot's passage. The specific construction method of the rectangular area is as follows: When the x-coordinates and y-coordinates of the two closest corner points in a preset clockwise direction are unequal, a line segment parallel to the line connecting the two adjacent corner points or intersecting the line connecting the two adjacent corner points is selected as the diagonal of the rectangular area. The length of this diagonal is set to a second preset multiple of the straight-line distance between the two adjacent corner points. The length of the shorter side of the rectangular area is greater than the robot's body width or the wall thickness. The two corner points covered by the rectangular area are set as the two adjacent corner points. Then, the rectangular area is set as the edge-following unit area. Here, the second preset multiple is greater than 1, and the length of the longer side (generally the side in the width direction of the rectangular area) is greater than or equal to the length of the shorter side (generally the side in the height direction of the rectangular area). In some embodiments, the second preset multiple can be equal to the first preset multiple, which may result in a large overlap between the two edge-following unit areas set along the preset clockwise direction, but this does not affect the representation of the outline in the map, nor does it affect the robot's edge-following movement based on the edge-following unit area and the corner points it covers. This process is repeated, setting the rectangular area containing every two adjacent corner points as the edge-following unit area. Specifically, this is done along a preset clockwise direction, setting the rectangular area containing every two adjacent corner points as the edge-following unit area, until all corner points are set within the working area. This allows each edge-following unit area to not completely overlap.
[0035] It should be noted that when the coordinate values of the same dimension of two adjacent corner points are not equal, the diagonal of the rectangular region includes two endpoints. The diagonal of the rectangular region can be regarded as being formed by connecting these two endpoints. These two endpoints are located outside the two adjacent corner points. One of these endpoints extends towards the other endpoint along a direction parallel to the line connecting the two adjacent corner points, or in a direction intersecting the line connecting the two adjacent corner points, to obtain the diagonal of the rectangular region. The length of the line connecting these two endpoints is equal to a second preset multiple of the straight-line distance between the two adjacent corner points. The projection of the line connecting two adjacent corner points onto the line connecting the two endpoints does not extend beyond the line connecting the two endpoints. The rectangular area covers two corner points, and the two adjacent corner points are the only two corner points covered by the rectangular area. In some embodiments, the diagonal of the rectangular area can extend from the lower left of one of the two adjacent corner points to its upper right, or it can extend from the upper right of one of the two adjacent corner points to its lower left. The included angle between the two diagonals of the rectangular area is not equal to 0 degrees or an integer multiple of 180 degrees.
[0036] It should be noted that when the coordinate values of the same dimension in two adjacent corner points are not equal, there is a midpoint on the perpendicular line connecting the two adjacent corner points. This midpoint can be located above, below, to the left, or to the right of the line connecting the two adjacent corner points. Starting from this midpoint, the lines extend to both sides of the midpoint in a direction parallel to or intersecting the line connecting the two adjacent corner points, respectively, to obtain the diagonal of the rectangular area. The sum of the lengths extended to both sides of the midpoint is equal to a second preset multiple of the straight-line distance between the two adjacent corner points, that is, equal to the length of the diagonal of the rectangular area. The projection of the line connecting the two adjacent corner points onto the diagonal of the rectangular area does not exceed the diagonal of the rectangular area. The rectangular area covers two corner points, and the two adjacent corner points are the only two corner points covered by the rectangular area. In some embodiments, the diagonal of the rectangular area can extend from the midpoint to the lower left and upper right of the midpoint, respectively. In some embodiments, a first midpoint is set vertically above the line connecting the two adjacent corner points, and a second midpoint is set on a line segment parallel to the line connecting the two adjacent corner points. The long side of the rectangular region includes a first diagonal and a second diagonal. The second diagonal intersects the line connecting the two adjacent corner points, and the first diagonal can be parallel to the line connecting the two adjacent corner points. Starting from the first midpoint, extending along the direction parallel to the line connecting the two adjacent corner points to both sides of the first midpoint, the first diagonal of the rectangular region is obtained. Simultaneously, starting from the second midpoint, extending along the direction intersecting the line connecting the two adjacent corner points to both sides of the second midpoint, the second diagonal of the rectangular region is obtained. The distance between the first and second diagonals of the rectangular region is equal to the length of the diagonal of the rectangular region, and they intersect at a point. The angle formed by the first and second diagonals is not equal to 0 degrees or an integer multiple of 180 degrees. The first and second diagonals are symmetrically arranged about the center point to achieve the effect of combining the rectangular region to surround the two adjacent corner points.
[0037] In some embodiments, when the coordinate values of the same dimension of two adjacent corner points are not equal, the line segment connecting the two adjacent corner points is selected as the diagonal of the rectangular area to construct a rectangular area. This rectangular area is then set as the area to be traversed. The rectangular area covers two corner points, which are the two adjacent corner points, and these two adjacent corner points are the only two corner points covered by the rectangular area. For example, if the x-coordinate values of two corner points closest in a preset clockwise direction are not equal, and their y-coordinate values are also not equal, the line segment connecting the two adjacent corner points is selected as the diagonal of the rectangular area. The length of the diagonal is set to be greater than or equal to the robot's body width or the wall thickness, and the length of the diagonal is greater than the length of the shorter side of the rectangular area. The two corner points covered by the rectangular area are then set as the two adjacent corner points, and the rectangular area is marked as the area to be traversed. This further simplifies the outline representation of the working area.
[0038] In the aforementioned embodiments, the length of the longer side (generally the side along the width of the rectangular area) is greater than or equal to the length of the shorter side (generally the side along the height of the rectangular area). The minimum side length of the area to be traversed is greater than or equal to the robot's body width, or greater than or equal to the wall thickness of the working area, to allow space for the robot to enter the area to be traversed. This makes the rectangular area constructed from a pair of adjacent corner points more consistent with the robot's walking habits. The robot sets an empirical width value (length of the longer side) and an empirical height value (length of the shorter side) of the rectangular area based on the relative positional relationship between the pair of adjacent corner points, ensuring that the extracted area to be traversed is accessible for the robot to walk through.
[0039] As one example, see Figure 1 As can be seen, within the robot's working area, the robot starts from corner point A1 and moves counterclockwise along the contour of the working area, i.e., along the edge, forming the edge-walking trajectory shown in the diagram. Figure 1In this embodiment, the robot starts from corner point A1 and constructs rectangles sequentially in a counter-clockwise direction, corresponding to the area to be traversed. On the map, the corner points searched in a counter-clockwise direction are, in order: corner point A1, corner point B1, corner point C1, corner point D1, corner point E1, corner point F1, corner point G1, corner point H1, corner point I1, corner point J1, corner point K1, corner point L1, corner point M1, corner point N1, corner point O1, corner point P1, corner point Q1, corner point R1, and corner point S1. The robot can begin traversing along the edge along the path extending counter-clockwise from corner point A1 to position point B1. From a counter-clockwise perspective, if corner point A1 is the first corner point searched, the last corner point searched can be corner point S1. This embodiment will... Figure 1 The horizontal direction is set as the x-axis direction. Figure 1 The vertical direction is set as the ordinate axis. The counterclockwise direction here is the edge direction set relative to the contour of the work area, so that the robot walks along the contour of the work area in a counterclockwise direction.
[0040] As one method for constructing the edge-to-edge unit region, for a pair of adjacent corner points, such as corner points A1 and B1, where the ordinate values of corner points A1 and B1 are equal, but the abscissa values of corner points A1 and B1 are not equal, then the line segment parallel to the line connecting corner points A1 and B1 is selected as the longer side of the rectangular region. Specifically... Figure 1 The selected rectangular region has its long sides as line segments a2a3 above the line connecting corner points A1 and B1, and line segments a4a5 below the line connecting corner points A1 and B1. The length of line segment a2a3 is set to be greater than or equal to the length of the line connecting corner points A1 and B1, while the length of line segment a4a5 is set to be equal to the length of line segment a2a3. Line segment a2a3 starts from point a2 and extends towards point a3 along a direction parallel to the line connecting corner points A1 and B1 (extending from left to right). Line segment a4a5 can be... Starting from point a4, extend towards point a5 along the line connecting corner points A1 and B1 (from right to left). Then connect line segments a2a5 and a3a4 to construct a rectangular region a2a3a4a5, which is the area to be edged. The length of the shorter side of this rectangular region is related to the robot's body width or the wall thickness. Line segments a2a5 and a3a4, as the shorter sides of the rectangular region a2a3a4a5, are perpendicular to the longer side of the rectangular region, allowing the rectangular region a2a3a4a5 to frame corner points A1 and B1. Based on this construction method, the pairs of adjacent corner points required to construct the area to be edged in a counterclockwise direction are as follows: corner point A1 and corner point B1, corner point C1 and corner point D1, corner point F1 and corner point G1, corner point I1 and corner point J1, corner point K1 and corner point L1, and corner point N1 and corner point O1.
[0041] As another method for constructing the region of the unit to be constructed along the edge, for a pair of adjacent corner points, such as corner point J1 and corner point K1, where the x-coordinate of corner point J1 is equal to the x-coordinate of corner point K1, but the y-coordinate of corner point J1 is not equal to the y-coordinate of corner point K1, then the line segment parallel to the line connecting corner points J1 and K1 is selected as the longer side of the rectangular region, corresponding to... Figure 1 Line segments b2b3 and b4b5 are located on the left and right sides of the line connecting corner points J1 and K1, respectively. The length of line segment b2b3 is set to be greater than the length of the line connecting corner points E1 and F1, while the length of line segment b4b5 is set to be equal to the length of line segment b2b3. Line segment b2b3 starts from point b2 and extends towards point b3 along a direction parallel to the line connecting corner points J1 and K1 (extending downwards). Line segment b4b5 can start from point b4 and extend along a direction parallel to the line connecting corner points J1 and K1. The line connecting point 1 extends towards point b5 (from bottom to top). Then, connecting line segments b2b5 and b3b4 constructs a rectangular region b2b3b4b5, which is the area to be edged. The length of the shorter side of this rectangular region is related to the robot's body width or the wall thickness. This rectangular region encloses corner points J1 and K1, and the length of the line connecting corner points J1 and K1 is greater than the length of the shorter side of the rectangle they belong to. Line segments b2b5 and b3b4 serve as the shorter sides of the rectangular region b2b3b4b5. Based on this construction method, following this construction method, the pairs of adjacent corner points in the area to be edged are constructed in a counterclockwise direction as follows: corner points B1 and C1, corner points E1 and F1, corner points G1 and H1, corner points J1 and K1, corner points M1 and N1, corner points O1 and P1, and corner points S1 and A1.
[0042] As another method for constructing the edge-forming unit region, for a pair of adjacent corner points, such as corner point L1 and corner point M1, where the x-coordinate of corner point L1 is not equal to the x-coordinate of corner point M1, and the y-coordinate of corner point L1 is not equal to the y-coordinate of corner point M1, then the line segment parallel to the line connecting corner points L1 and M1 is selected as the diagonal of the rectangular region, corresponding to... Figure 1The line segment connecting points c3 and c5 is parallel to the line connecting corner points D1 and E1, and its length is greater than the length of the line connecting corner points L1 and M1. The line segment c3c5 extends from point c3 towards point c5 along the line parallel to the line connecting corner points L1 and M1 (from the upper right to the lower left). Simultaneously, another diagonal line is drawn in a direction intersecting the line connecting points c3 and c5, specifically from point c2 towards point... A line segment extending from c4 is defined, with the length of line segment c2c4 being greater than the length of the line connecting corner points L1 and M1. Then, points c2 and c3, c3 and c4, c4 and c5, and c5 and c2 are connected sequentially to construct a rectangular region c2c3c4c5, which is the area to be bordered. The length of the shorter side of this rectangular region is greater than or equal to the robot's body width or the wall thickness, thus enclosing corner points L1 and M1. Line segments c2c3 and c4c5 serve as the shorter sides of the rectangular region c2c3c4c5. Based on this, following this construction method, the pairs of adjacent corner points of the area to be constructed along the edge unit region in a counterclockwise direction are as follows: corner point D1 and corner point E1, corner point L1 and corner point M1, corner point H1 and corner point I1, corner point P1 and corner point Q1, corner point Q1 and corner point R1, and corner point R1 and corner point S1.
[0043] In the three methods of constructing the edge-following unit regions described above, the robot moves along the contour of the working area in a counter-clockwise direction within the working area. The resulting edge-following trajectory will sequentially pass through each of the edge-following unit regions, corresponding to... Figure 1 A total of 19 edge-following unit regions are generated, and the number of edge-following unit regions is equal to the number of corner points searched within the same working area. When the robot's edge-following trajectory passes through one of the edge-following unit regions, it is determined that the robot has walked along a contour segment whose extension direction is consistent with that of the two adjacent corner points covered by the edge-following unit region. Specifically, it is determined that the robot has walked along a contour segment whose extension direction is consistent with that of the two adjacent corner points covered by the edge-following unit region in a preset clockwise direction. The contour of the working area is composed of multiple contour segments connected together; each contour segment corresponds to two adjacent corner points.
[0044] In one implementation, when each contour segment is represented in the map by the corresponding adjacent corner points and the area to be followed in a preset clockwise direction, the area to be followed in the map also shows its coordinate coverage within the working area and its order in the preset clockwise direction. The robot's memory then sequentially records the coordinate coverage within the working area and the order of each area to be followed in the preset clockwise direction. In another implementation, when each contour segment is represented in the map by the corresponding adjacent corner points, each pair of adjacent corner points in the map shows its coordinates within the working area and its order in the first preset clockwise direction, making the contour information presented on the map more refined. This embodiment further records the coordinates of each pair of adjacent corner points within the working area and their order in the preset clockwise direction in the robot's memory to facilitate subsequent identification of the edge-following walking state. This reduces the density of feature points or corresponding areas representing the actual contour.
[0045] Therefore, the robot can store the corner points found in the map in a linear list according to a preset clockwise direction (the direction of the edge walking or its opposite direction (counterclockwise)) and record the sorting of the corner points in the preset clockwise direction; and along the counterclockwise direction, divide the region containing each pair of adjacent corner points into rectangular regions with specific geometric relationships, and record the order of the divided rectangular regions in a linked list, which is called the sorting of the rectangular regions in the preset clockwise direction, so as to determine the relative positional relationship of one of the edge-walking unit regions in the preset clockwise direction, and also to determine the sorting of one pair of adjacent corner points relative to the first pair of adjacent corner points in the preset direction, or to determine the sorting of one corner point relative to the first corner point in the preset direction (the starting point of the edge walking).
[0046] It should be noted that linear lists include two types: linked lists and sequential lists. Sequential lists require contiguous storage space, while linked lists do not. "Contiguous" refers to the contiguousness of storage space. In a sequential storage structure, the storage address of each data element in the linear list is uniquely determined by its position index within the linear list. This ensures that the sorting of the corner points within the linear list matches the sorting of the edge-tracing unit regions, facilitating mapping onto a map to represent the extension direction of the working area in the preset clockwise direction.
[0047] It should be noted that the outline of the work area and the outline segments it comprises are essentially the outline lines that the robot needs to follow for edge-walking. However, the outline of the work area or all outline segments may not be completely traversed by the robot. The outline composed of corresponding grids or pixels in the robot's pre-stored map (historical map) approximates the outline of the obstacle or wall as closely as possible. In some implementation scenarios, when the robot walks along a low obstacle, the distance between the robot and the low obstacle is relatively large to prevent pushing and crashing into it. In this case, the outline line marked by the robot in the historical map may not follow the predicted direction. The prediction may not be accurate, but it at least indicates the approximate direction along the edge, and it should be as close as possible to the outline of the obstacle or wall, forming the preset clockwise direction. Preferably, the distance between the outline of the work area and the robot's edge-walking trajectory is greater than or equal to the robot's body radius to prevent frequent collisions with obstacles or walls during edge-walking.
[0048] It should be added that the robot walks along the walls of the room. For ease of description and understanding, in the map constructed by the robot, the actual outer wall or obstacles against the wall are regarded as the top-view projection lines of the walls and obstacles on the floor of the indoor working area (including the specific room floor). When there is an obstacle adjacent to the outer wall, the robot treats the surface of the obstacle that is not in contact with the outer wall as the outer wall when moving. The edge control method disclosed in this embodiment can be applied to multi-room scenarios. Because when the door is open, the walls of multiple rooms are continuous, and the robot moves along the room walls, it can choose to periodically go back and forth, eventually traversing multiple rooms.
[0049] Based on the above embodiments, during the process of setting the edge-following unit area in the working area, the robot first marks a pre-selected corner point as the current corner point. Starting from the current corner point, it selects the nearest corner point in the preset clockwise direction and marks it as the next corner point. The nearest corner point can be the four-neighbor or eight-neighbor area of the current corner point, or the nearest corner point in the preset clockwise direction relative to the current corner point. Then, the rectangular area where the two corner points are located is set as the edge-following unit area. The sorting and coordinate coverage of the edge-following unit area and the corresponding corner points in the preset clockwise direction are recorded, and the current corner point and the next corner point are marked as the two adjacent corner points. Then, the next corner point is updated to the current corner point. This process is repeated until the corresponding edge-following unit area is set at the location of all corner points. This determines that the corresponding edge-following unit area is set at the location of all two adjacent corner points, and obtains the coordinate coverage of all edge-following unit areas in the working area and their sorting in the first preset clockwise direction.
[0050] It should be noted that when the working area is described by a grid map, the neighborhood of a pixel or corner mentioned in this invention is the grid area adjacent to the grid cell occupied by the pixel or corner in the grid map, which is used to describe the area adjacent to the position of the pixel or corner, so as to facilitate searching the area around the pixel or corner.
[0051] As one embodiment, the method for the robot to search for corner points of the work area from the map includes: starting from a pre-set search starting point in the map, the robot obtains corner points through neighborhood search, including eight-neighbor search or four-neighbor search; wherein, the corner point is the intersection of a set of mutually perpendicular contour line segments in the map, and the intersection point is the endpoint of the contour line segment. In this embodiment, the search starting point is a pixel point used to represent an obstacle; in some embodiments, the endpoint is the corner point of a room wall, which is useful for constructing a rectangular area in the work area. The contour line segment is marked by the robot in advance when traversing the work area, realizing the use of two adjacent corner points to directly represent an obstacle or wall (which can be regarded as its projection line segment on the horizontal ground), simplifying the room outline to a certain extent, and only using endpoint information to make more state judgments for the robot's movement along the edge. In this embodiment, if two pixels used to represent obstacles are found successively from the pre-set search starting point and are not collinear with the search starting point, then the search starting point is a corner point. Specifically, when only one pixel representing an obstacle is found in the neighborhood of the search starting point, the search starting point is set as a corner point, and this pixel is marked as a current candidate point. Then, a search is performed in the neighborhood (which can be a four-neighbor or eight-neighbor neighborhood) of this current candidate point. If no pixel is collinear with both the current candidate point and the search starting point, the current candidate point is marked as a corner point found in the neighborhood of the search starting point, and the search starting point and the current candidate point are marked as adjacent corner points. If a pixel is collinear with both the current candidate point and the search starting point, the current candidate point is updated as a transition point, and this pixel is updated as the current candidate point. The search is then performed in the neighborhood of the current candidate point, and this process is repeated until no pixel is collinear with either the current candidate point or the transition point. At this point, the current candidate point is marked as a corner point. A pixel already marked as a search starting point is not allowed to be marked as a search starting point again, and a pixel already marked as a transition point is not allowed to be marked as a search starting point again. This yields a fine edge contour within the working area.
[0052] As one embodiment, the method by which the robot searches for corner points of the work area from a map includes: Step (1): First, select any pixel with a grayscale value of 1 as the seed point, denoted as Z1. Search its eight or four neighboring regions. If there is no pixel with a value of 1 in the neighboring region, terminate the neighboring region search. If there is only one pixel with a value of 1 around it, then mark the point as Z2, and mark Z1 as the corner point NM1. Then search the other neighboring regions of Z2. If there is no pixel that can be collinear with Z1 and Z2, then mark Z2 as the corner point NM2. If there is a pixel that can form a collinearity between these three points, then mark the pixel as Z3, and mark Z2 as the transition point. Then continue to search the neighboring regions of Z3, and so on, until there is no pixel in the neighboring region of Zn that can be collinear with Zn-1 and Zn. Then mark Zn as the corner point, and the straight line segment connecting Z1 and Zn forms a wall.
[0053] Step (2): If there are two or more pixels with a gray value of 1 around point Z1, then find two points that can form a line with Z1. If not, mark Z1 as a corner point and extend from each of these points, repeating step (1) until another corner point is reached. If there is a pair of pixels with a gray value of 1 that form a line with Z1, then mark Z1 as a transition point instead of a corner point, and extend from Z1 to these two points, repeating the previous step until a corner point is reached. If there are more than one pair of pixels with a gray value of 1 that form a line with Z1, then repeat the previous steps for each pair of points.
[0054] Step (3): After completing one search, the next seed point is selected. Seed points from previous steps cannot be used as seed points again, and transition points marked in previous steps cannot be used as seed points again. This continues until all pixels with a grayscale value of 1 are evaluated. Pixels representing obstacles or walls have a grayscale value of 1 in the map.
[0055] In summary, using the corner points found through the aforementioned steps makes it easier to determine whether the robot's edge-walking trajectory can follow the outline of the entire work area.
[0056] Based on the foregoing embodiments, the present invention also discloses a robot edge-tracing termination control method. This robot edge-tracing termination control method is executed on the basis that the robot has traversed the work area and obtained the map of the work area. The robot edge-tracing termination control method combines the corner information in the historical map and the robot's edge-tracing trajectory in the work area to determine whether the edge-tracing task in the predetermined edge direction should be terminated.
[0057] like Figure 3 As shown, the robot edge-end control method includes: Step S301: The robot searches for corner points of the work area from the map. Specifically, the robot searches for corner points from the historical map (a previously constructed map of the work area). The search range is the map area corresponding to the work area, which is equivalent to the robot searching for corner points within the work area. In step S301, the search method can be based on graph search algorithms such as four-neighbor or eight-neighbor to extract all corner points from the neighborhood point cloud or neighborhood pixels. Then, step S302 is executed.
[0058] Step S302: The robot sets the rectangular area containing two adjacent corner points as the edge-following unit area. Specifically, after acquiring all corner points in the working area, the robot sets the rectangular area containing each pair of adjacent corner points as the edge-following unit area in a preset clockwise direction, so that the robot divides multiple edge-following unit areas from the working area along the preset clockwise direction. Then, the robot starts to walk along the edge in the working area and starts to generate an edge-following trajectory, which is marked on the map; then, step S303 is executed; wherein, the preset clockwise direction can be regarded as the edge-following direction required for the robot to walk along the edge. The preset clockwise direction is either clockwise or counterclockwise, which corresponds to the edge-following cleaning direction in the edge-following mode of the cleaning robot; two adjacent corner points are covered by the edge-following unit area in which they are located. It should be noted that the robot can sequentially save each corner point and / or edge-following unit region into the linear storage space according to the preset clockwise acquisition order. The sorting direction of the edge-following unit regions from largest to smallest or smallest to largest in the preset clockwise direction simplifies the representation of the order in which the robot traverses or moves through the regions. This facilitates the robot's sequential extraction of corner points or edge-following unit regions at the corresponding edge-following stages during edge-following movement in the preset clockwise direction. In summary, the robot sets up multiple edge-following unit regions by executing the setting method disclosed in the aforementioned embodiments.
[0059] It should be noted that when each contour segment constituting the working area is expressed in the map by the corresponding two adjacent corner points in the edge-to-edge unit area in a preset clockwise direction, the edge-to-edge unit area in the map expresses its coordinate coverage range and its sorting in the preset clockwise direction within the working area. Then, the robot memory sequentially records the coordinate coverage range and its sorting in the preset clockwise direction for each edge-to-edge unit area in the working area. In another embodiment, when each contour segment is expressed in the map by the corresponding two adjacent corner points, each pair of adjacent corner points in the map expresses its coordinates in the working area and its sorting in the first preset clockwise direction in a preset clockwise direction, making the contour information presented by the map more refined. This embodiment further records the coordinates and its sorting in the preset clockwise direction for each pair of adjacent corner points in the working area in the robot memory to facilitate subsequent identification of the edge-to-edge walking state, such as whether the robot has entered one of the edge-to-edge unit areas.
[0060] Step S303: Determine whether the robot's edge-tracing trajectory has passed through all the edge-tracing unit areas or repeatedly traversed the same batch of edge-tracing unit areas. If yes, proceed to step S307; otherwise, proceed to step S304. In step S303, the robot determines whether it has traversed all the edge-tracing unit areas set in step S302 or repeatedly traversed the same batch of edge-tracing unit areas. If yes, proceed to step S307; otherwise, proceed to step S304. Whether the robot's edge-walking trajectory passes through all the edge-following unit areas can be determined by whether the robot's edge-following trajectory passes through all the edge-following unit areas in a preset clockwise direction at once; wherein, the same batch of edge-following unit areas are a preset number of different edge-following unit areas; during the process of the robot repeatedly walking through the same batch of edge-following unit areas, if the robot repeatedly walks through the same batch of edge-following unit areas once according to a certain work cycle, then the robot will not repeatedly walk through each edge-following unit area within the corresponding work cycle; the number of times the robot repeatedly walks through a batch of edge-following unit areas is preferably greater than 1 or less than 3; leaving sufficient judgment redundancy for the robot as a sign that the robot's edge-following movement has become abnormal. Each time the robot moves through the same batch of edge-tracing unit areas, it successively traverses each edge-tracing unit area in that batch without repeatedly traversing the same edge-tracing unit area. This indicates that the robot is trapped in a local area of the working area and cannot continue to move along the edge to areas outside that local area. It cannot traverse the part of the edge-tracing unit areas set in step S302 and the part of the corner points searched in step S301, so that the robot cannot complete the working area. Preferably, the larger the area where the robot is trapped, the larger the preset number is set, and the fewer times the robot repeatedly moves within the specified edge-tracing time; conversely, the smaller the preset number is set, the more times the robot repeatedly moves within the specified edge-tracing time.
[0061] Step S304: The robot performs edge-walking within the work area, generating an edge-walking trajectory and marking it on the map, such as... Figure 1 The closed, zigzagging trajectory shown in the diagram covers each of the small rectangular areas; then step S305 is executed. Specifically, the robot can move along the edge within the working area in the preset clockwise direction or the opposite direction. For example, if the preset clockwise direction is set to counterclockwise, the robot can move from... Figure 1 Point A1 or Figure 2 Starting from point A2, the robot moves along the edge in a counter-clockwise or clockwise direction. Since the corner points and the corresponding edge-tracing unit regions of the two adjacent corner points are marked in the robot's memory or map according to the preset clockwise direction, when the robot... Figure 1Point A1 or Figure 2 When the robot begins its clockwise edge-moving movement from point A2, after confirming the corner point in the robot's memory as the starting point, the relative position of the edge-moving unit region can be identified by swapping the order of the corner point or the edge-moving unit region in the memory. This includes the robot's current edge-moving position relative to the target edge region. Figure 1 Point A1 or Figure 2 The location information of point A2.
[0062] Step S305: Determine whether the robot's edge-walking trajectory passes through the edge-following unit area. If yes, proceed to step S306; otherwise, proceed to step S304. During the robot's edge-walking process within the working area, it needs to determine in real time whether it has entered one of the edge-following unit areas. Preferably, when the robot walks along the contour of the working area, its current forward direction is parallel to the contour segment it is currently following, forming an edge-walking posture. It can walk through the corner point or the edge-following unit areas corresponding to the two adjacent corner points. Since the path formed by the robot's edge-walking becomes more consistent with the contour segment, including its direction and length, existing technologies require matching and comparing many coordinate points on the map to locate the robot's edge-walking state. However, this embodiment uses the setting of edge-following unit areas to track and locate the robot's position, using the vertex information of rectangular areas to simplify the calculation.
[0063] It should be noted that when the preset clockwise direction is configured as the robot's edge-following direction, the robot's edge-following direction is configured as the left edge-following direction for the robot's movement, such that the position point in the outline of the obstacle or wall along which the robot moves is located to the left of the robot's forward direction, wherein the initial edge-following starting point is located to the left of the robot's forward direction. When the preset clockwise direction is configured as the robot's edge-following direction, the edge-following direction is configured as the right edge-following direction for the robot's movement, such that the position point in the outline of the obstacle or wall along which the robot moves is located to the right of the robot's forward direction, wherein the initial edge-following starting point is located to the right of the robot's forward direction.
[0064] Step S306: The robot marks the edge-traveling trajectory of the current edge-traveling unit area as an edge-traveling unit area that has been traversed, that is, it is determined that the robot's edge-traveling trajectory has passed through the edge-traveling unit area, and then step S303 is executed. Specifically, when the robot's real-time recorded x-coordinate is greater than the minimum x-coordinate of the vertex of the edge-following unit region and less than the maximum x-coordinate of the vertex of the edge-following unit region, and the robot's real-time recorded y-coordinate is greater than the minimum y-coordinate of the vertex of the edge-following unit region and less than the maximum y-coordinate of the vertex of the edge-following unit region, it is determined that the robot's current x-coordinate is within the coordinate coverage range of the x-coordinate of the edge-following unit region and the robot's current y-coordinate is within the coordinate coverage range of the y-coordinate of the edge-following unit region. Then, it is determined that the robot has entered the edge-following unit region, that the robot's edge-following trajectory passes through the edge-following unit region, and that the robot has walked through the edge-following unit region. Furthermore, it is determined that the robot has walked through the contour segment where the extension directions of the two adjacent corner points covered by the edge-following trajectory are consistent. The edge-following unit region is a planar region on the map, and the coordinates of the four vertices of the edge-following unit region can be obtained in step S302, including the maximum x-coordinate, minimum x-coordinate, maximum y-coordinate, and minimum y-coordinate, forming the coordinate coverage range of the edge-following unit region. Specifically, in the execution of the embodiment corresponding to the setting method, it can be calculated from the rectangular area with a specific geometric relationship where two adjacent corner points are located. Thus, the method of calculating whether the robot has passed through a certain small rectangle at a certain moment can be simplified to determining whether the robot's real-time coordinates are within the coordinate coverage range of the corresponding edge-following unit area; this not only effectively reduces the amount of data but also increases the correctness of subsequent edge-following termination.
[0065] In some embodiments, after the robot enters the coordinate coverage area of the edge-following unit region, it is further determined that the distance between the robot's current position coordinates and one of the two adjacent corner points covered by the edge-following unit region is greater than a preset distance threshold. Only then is it determined that the robot has entered the edge-following unit region, and that the robot's edge-following trajectory passes through the edge-following unit region. Furthermore, the larger the area occupied by the edge-following unit region, the larger the preset distance threshold is set, and the contour segment consistent with the extension direction of the two adjacent corner points covered by the edge-following unit region is considered. The longer the distance, the greater the minimum trajectory length required for the robot to walk along the edge, allowing for more contour segments to be followed during normal edge walking. This results in a larger area covered by the robot's edge walking, improving the integrity of its edge walking without increasing computational load. This is because identifying whether the robot has walked along the edge through contour segments with consistent extension directions between adjacent corner points does not require calculating coordinate information for each location point or pixel. Instead, it calculates and compares the coordinate information of individual vertices of the corresponding edge-to-edge unit region. Moreover, the coordinate coverage range of each edge-to-edge unit region in the working area can be obtained from step S302. Preferably, the preset distance is greater than or equal to the robot's body width to facilitate robot passage.
[0066] Step S307: The robot stops its edge-walking within the working area. Specifically, when the robot's edge-walking trajectory passes through all the edge-tracing unit areas, it is determined that the robot has completed the outline of the working area. The robot has traversed all the edge-tracing unit areas set in step S302, and it can traverse all the edge-tracing unit areas set in step S302 in one go according to the preset clockwise direction. The robot's edge-walking trajectory has traversed and covered the entire area. Figure 1 The 19 small rectangular regions indicate when edge-walking can end, avoiding the misjudgment issues mentioned in the background technology. This controls the robot to prevent premature termination of edge-walking, improving the accuracy and timeliness of the robot's judgment on ending edge-walking. Specifically, after the robot starts edge-walking from a starting point, when the robot's edge-walking trajectory passes through all the edge-walking unit regions, it is determined that the robot has completed a full circle of edge-walking within the working area, but may not necessarily return to the starting point. Therefore, it is not necessary to calculate the specific pose information (including angle and coordinate information) on the edge-walking trajectory; instead, it is only necessary to determine whether the robot's real-time measured position coordinates have entered the last edge-walking unit region, simplifying the calculation complexity. The traversal order of the last edge-walking unit region by the robot in the preset clockwise direction can be set in step S302; corresponding to... Figure 1In this process, the robot starts from corner point A1 and moves counterclockwise along the edge of the working area. In steps S301 and S302, corner point A1 is searched first, and then other corner points are searched in the working area counterclockwise, and the corresponding edge-to-edge unit areas are set in sequence. Therefore, the two adjacent corner points corresponding to the edge-to-edge unit areas traversed by the robot counterclockwise are, in sequence: corner point A1 and corner point B1, corner point B1 and corner point C1, and corner point C1 and corner point D. 1. Corner points D1 and E1, E1 and F1, F1 and G1, G1 and H1, H1 and I1, I1 and J1, J1 and K1, K1 and L1, L1 and M1, M1 and N1, N1 and O1, O1 and P1, P1 and Q1, Q1 and R1, R1 and S1, and S1 and A1. Then, the robot moves along the edge of the work area in a counter-clockwise direction, and the resulting edge-moving trajectory passes sequentially through each of the edge-moving unit areas, corresponding to... Figure 1 The robot has walked through a total of 19 edge-following unit regions. At this point, the number of edge-following unit regions constructed is equal to the number of corner points searched in the same working area. The robot's edge-following trajectory has passed through all generated edge-following unit regions, but the robot may not return to corner point A1. It will only be in the edge-following unit region where corner point S1 and corner point A1 are located. Preferably, in this process, each edge-following unit region is walked through by the robot only once.
[0067] Furthermore, when it is determined that the robot's edge-walking trajectory repeatedly passes through the same batch of edge-walking unit areas multiple times, the robot stops its edge-walking within the working area. Specifically, each time the robot repeatedly walks through the same batch of edge-walking unit areas, it walks through each edge-walking unit area in a preset clockwise direction or the opposite direction. During this round of walking through the same batch of edge-walking unit areas, each edge-walking unit area in the same batch is walked through by the robot only once. All edge-walking unit areas in the same batch are arranged in the working area in the preset clockwise direction. In some embodiments, each edge-walking action of the robot can be considered as an edge-walking behavior occurring within an edge-walking cycle. Within each edge-walking cycle, the robot successively traverses a preset number of different edge-walking unit regions along the preset clockwise direction or the opposite direction. Each edge-walking unit region in the same batch is distributed within the working area according to the preset clockwise direction, ensuring that the robot can traverse each edge-walking unit region in the same batch without repetition, following the preset clockwise direction. It is worth noting that the robot sets up multiple edge-walking unit regions by executing the setting method disclosed in the foregoing embodiments. These edge-walking unit regions can be arranged in the working area according to the preset clockwise direction. The number of edge-walking unit regions set up by the setting method is greater than the preset number. The preset number can be specifically determined based on the size of the area where the robot performs repeated edge-walking behavior. Since the robot only performs repeated edge-walking behavior when trapped, the number of edge-walking unit regions set up by the setting method cannot be equal to the preset number. For example, if a user uses a virtual wall to separate the work area on a mobile terminal, or if there are obstacles in the actual environment that block the work area and prevent the robot from smoothly traversing the entire work area, the robot's edge-walking trajectory repeatedly passes through the preset number of edge-walking unit areas, and the robot does not repeatedly walk through the same edge-walking unit area in each iteration. In this case, the robot obtains the geometric information of the contour associated with the trapped state. It does not need to traverse all corners and all edge-walking unit areas to promptly identify the edge-walking anomaly and stop edge-walking, thus preventing the robot's edge-walking trajectory from looping in the same local area and ensuring the robot's work efficiency.
[0068] In summary, this invention first represents the outline of the work area by using a rectangular region or two corner points corresponding to two adjacent corner points in a preset clockwise direction. This allows the robot to identify its edge-walking status by determining whether its edge-walking trajectory passes through the rectangular region corresponding to the two corner points. Then, by determining whether the robot's edge-walking trajectory has sequentially covered the map outline segment corresponding to the entire work area in a preset clockwise direction, it decides whether to stop edge-walking. When the robot is a cleaning robot, considering the cleaning coverage within the work area and the purpose of cleaning up corners and hard-to-reach areas, the invention selects an appropriate edge-walking stage to stop by referencing the number of traversals of the edge-walking unit area. This not only facilitates the determination of the outline segment the robot is traversing within the work area but also accurately determines whether to end the edge-walking mode, reducing the number of times the robot repeatedly traverses local areas or prematurely ends edge-walking due to misjudgment, thereby improving the robot's working efficiency within the work area.
[0069] In addition, when an abnormal situation occurs, such as the work area being blocked by obstacles or restricted by virtual walls, the robot will not be able to walk smoothly along the edge of the work area. In this case, by judging whether the robot has repeatedly walked through a batch of rectangular areas, it can be determined that the robot has encountered an abnormality in the process of walking along the edge, so that it can stop walking along the edge in time to ensure work efficiency and reduce the number of times the robot repeatedly traverses the same local area.
[0070] As one embodiment, when the size of the obstacles in the work area is larger, and / or the work restricted area set by the virtual wall is larger, the area separated from the robot in the work area is larger. Therefore, the preset number is set smaller, and the number of edge-tracing unit areas that the robot can traverse without repetition within the passable area decreases. When the size of the obstacles in the work area is smaller, and / or the work restricted area set by the virtual wall is smaller, the area separated from the robot in the work area is smaller. Therefore, the preset number is set larger, and the number of edge-tracing unit areas that the robot can traverse within the passable area increases. However, the robot cannot traverse the corresponding edge-tracing unit area within the separated area. The larger the overlap between two edge-tracing unit areas, the smaller the preset number is set. Generally, in the corner area, there is a large overlap between two edge-tracing unit areas. In order to determine whether the robot is trapped in this corner area during edge-tracing, that is, to determine whether the robot's edge-tracing trajectory repeatedly passes through a batch of edge-tracing unit areas, it is only necessary to set the preset number to a relatively small value. The preset number is preferably 2.
[0071] In some embodiments, when a robot may be obstructed by movable objects in a room (such as the opening and closing of doors, the movement of tables and chairs), and become trapped in a localized area, judging whether the robot has walked around the outline of the work area solely based on its motion angle and posture may lead to misjudgment. Specifically, in some embodiments, before the robot returns to the effective starting point along the edge, it may spin or become trapped in a localized area, such as the bottom of a dining table in a restaurant (where there is a lot of dirt). The robot repeatedly performs edge-walking behavior in this localized area, resulting in a path loop in the edge-walking trajectory marked on the map, which may cause the robot to rotate by an angle that reaches or exceeds 360 degrees. However, whether it's the first or second circle of walking along the edge, if the robot gets stuck, spins, or slips due to the aforementioned obstacles and cannot continue walking along the wall, the robot detects a path loop in a local area. In this case, the robot will choose to stop walking along the edge to avoid affecting work efficiency. Alternatively, when the robot walks along the edge in the global area (equivalent to the work area), it is equivalent to walking along the wall outline in the entire indoor work area. If the same path loop exists in one of the local areas, the robot will stop walking along the edge in time to avoid repeated traversal.
[0072] As one example, see Figure 2 It can be seen that within the robot's working area, the robot starts from corner point A2 and moves counterclockwise along the contour of the working area, that is, along the edge, but is subject to... Figure 2 The virtual walls or obstacles shown correspond to the formation of Figure 2 The closed, zigzagging trajectory in the middle, as the robot in Figure 2 The path along the edge within. Figure 2 In the process of executing steps S301 and S302, the robot starts from corner point A2 and constructs rectangular frames in a counter-clockwise direction, corresponding to the area of the edge to be traversed. Figure 2 In the corresponding map, the corner points searched counterclockwise are, in order: corner point A2, corner point B2, corner point C2, corner point D2, corner point E2, corner point F2, corner point G2, corner point H2, corner point I2, corner point J2, corner point K2, corner point L2, corner point M2, corner point N2, corner point O2, corner point P2, corner point Q2, and corner point R2. The robot can then begin its movement along the edge on a path extending counterclockwise from corner point A2 towards position point B2. From a counterclockwise perspective, if corner point A2 is the first corner point searched, the last corner point searched could be corner point R2. Figure 1 Remove one corner point, which is already covered by the obstacle or virtual wall shown in the diagram.
[0073] exist Figure 2In this embodiment, the robot walks along the edge to the outline segment defined by the obstacle or virtual wall shown in the figure. Figure 2 After encountering a thick black horizontal line segment (with corner point R2 below and corner point M above), the robot cannot move along the edge to the area to be edged. Instead, it moves along the outline segment to the area to be edged where corner point R2 is located. Here, corner points M2 and R2 are not set as the two adjacent corner points; instead, corner points M2 and N2 are set as the two adjacent corner points to construct the area to be edged (since the robot has not actually moved this way, therefore...). Figure 2 (No corresponding rectangular area is marked in the text). Specifically, it is a movement trajectory extending counterclockwise from corner point M2 to corner point R2, but it is not the line connecting corner points M2 and R2. Viewed counterclockwise, after the robot moves along the edge to the area containing corner points R2 and A2, it can connect with the previously formed edge-moving trajectory to form a closed movement trajectory, serving as a complete edge-moving trajectory within the working area. However, this does not mean the robot has moved along the entire outline within the working area. Specifically, within the closed area enclosed by the aforementioned edge-moving trajectory, the robot may repeat... The robot repeatedly enters each corresponding edge-tracing unit area within the closed area along the previously generated edge-tracing trajectory. Each time the robot enters an edge-tracing unit area, it is automatically identified based on whether the robot's current position coordinates are within the coordinate coverage area of that edge-tracing unit area. The coordinate coverage area of the edge-tracing unit area and its positional relationship relative to corner point A2 are recorded in step S302 and can be sequentially read from the robot's memory according to the preset clockwise direction (e.g., when counter-clockwise is set as the edge-tracing direction). Furthermore, each time the robot completes one lap along the edge, it moves counter-clockwise sequentially, without repeatedly traversing the same edge-tracing unit area. The number of edge-tracing unit areas traversed by the robot in each lap is equal to... Figure 2 The number of marked edge-tracing unit regions is less than the total number of edge-tracing unit regions set in step S302 (the number of edge-tracing unit regions corresponding to all corner points that need to be traversed along the edge). This embodiment allows the robot to repeatedly traverse multiple circles along the edge in areas obstructed by the outline segments set by the obstacles or virtual walls shown in the figure before determining that the robot's edge-tracing is in an abnormal state. This allows for a more accurate determination of whether the robot's edge-tracing trajectory is in an abnormal state. Figure 2 The corresponding area is in a loop state, at which point the robot is controlled to stop walking along the edge.
[0074] As one method for constructing the edge-to-edge unit region, for a pair of adjacent corner points, such as corner point K2 and corner point L2, if the ordinate values of corner point K2 and corner point L2 are equal, but the abscissa values of corner point K2 and corner point L2 are not equal, then the line segment parallel to the line connecting corner points K2 and L2 is selected as the longer side of the rectangular region. Specifically... Figure 2 The selected rectangular region has two long sides: the line segment d3d4 above the line connecting corner points K2 and L2, and the line segment d5d6 below the line connecting corner points K2 and L2. The length of line segment d3d4 is set to be greater than or equal to the length of the line connecting corner points K2 and L2, and the length of line segment d5d6 is set to be equal to the length of line segment d3d4. Line segment d3d4 starts from point d3 and extends towards point d4 along a direction parallel to the line connecting corner points K2 and L2 (extending from left to right). Then, line segments d4d5 and d6d3 are connected to construct the rectangular region d3d4d5d6, which is the area to be bordered. The rectangular region d3d4d5d6 encloses corner points K2 and L2. Based on this, according to this construction method, the pairs of adjacent corner points required to construct the edge unit region in the counterclockwise direction are as follows: corner point A2 and corner point B2, corner point C2 and corner point D2, corner point E2 and corner point F2, corner point I2 and corner point J2, and corner point K2 and corner point L2.
[0075] As another way to construct the edge-following unit region, for a pair of adjacent corner points, such as corner point D2 and corner point E2, the x-coordinate value of corner point D2 is equal to the x-coordinate value of corner point E2, but the y-coordinate value of corner point D2 is not equal to the y-coordinate value of corner point E2. Then, the line segment parallel to the line connecting corner points D2 and E2 is selected as the long side of the rectangular region, and the length of this long side is set to be greater than the length of the line connecting corner points D2 and E2. The corresponding rectangular region is constructed, that is, the edge-following unit region. The length of the short side of this rectangular region is related to the width of the robot's body or the thickness of the wall, so that the rectangular region frames corner points D2 and E2, and the length of the line connecting corner points D2 and E2 is greater than the length of the short side of the rectangle in which it is located.
[0076] As another method for constructing the edge-forming unit region, for a pair of adjacent corner points, such as corner point L2 and corner point M2, where the x-coordinate of corner point L2 is not equal to the x-coordinate of corner point M2, and the y-coordinate of corner point L2 is not equal to the y-coordinate of corner point M2, then the line segment parallel to the line connecting corner points L2 and M2 is selected as the diagonal of the rectangular region, corresponding to... Figure 2The line segment connecting points e4 and e6 is parallel to the line connecting corner points L2 and M2, and its length is greater than the length of the line connecting corner points L2 and M2. The line segment e4e6 extends from point e4 towards point e6 along the line parallel to the line connecting corner points L2 and M2 (from the upper right to the lower left). Simultaneously, another diagonal line is drawn in a direction intersecting the line connecting points e3 and e5, specifically from point e3 towards point... Extend a line segment from e5, and set the length of line segment e3e5 to be greater than the length of the line connecting corner points L2 and M2; then connect points e3 and e4, e4 and e5, e5 and e6, and e6 and e3 sequentially to construct a rectangular region e3e4e5e6, which is the area to be edged. The length of the shorter side of this rectangular region is greater than or equal to the robot's body width or the wall thickness, so that the rectangular region encloses corner points L2 and M2. Among them, line segments e3e4 and e5e6 serve as the shorter sides of the rectangular region e3e4e5e6. Based on this, following this construction method, construct each pair of adjacent corner points of the area to be edged in a counterclockwise direction as follows: corner point G2 and corner point H2, corner point H2 and corner point I2, and corner point L2 and corner point M2.
[0077] Because the robot is defined by the outline segment set by the illustrated obstacle or virtual wall ( Figure 2A thick black horizontal line segment (with corner point R2 below and corner point M above) blocks the robot's movement along the edge, thus dividing the work area into upper and lower sections. Therefore, the robot cannot continue along the edge to corner points N2, O2, P2, and Q2, that is, it cannot walk counterclockwise along the edge through the corresponding edge-to-edge unit area of the aforementioned corner points and then return to corner point R2. At this time, after passing the edge-to-edge unit areas where corner points L2 and M2 are located, the robot walks along the outline segment set by the obstacle or virtual wall to corner point R2 to enter the edge-to-edge unit area where corner points R2 and A2 are located. At this time, the number of edge-to-edge unit areas that the robot has walked through in the work area is less than the total number of edge-to-edge unit areas set in step S302, that is, the robot is blocked by the obstacle or virtual wall. Within the local area blocked by the simulated wall, the number of edge-tracing unit areas traversed during a complete loop is less than the total number of edge-tracing unit areas set in step S302. Then, without triggering a stop edge-tracing command, the robot continues to walk along the contour of the work area and begins a new loop in the work area in a counter-clockwise direction, repeating the previous loop of edge-tracing unit areas. After repeating this loop twice, the robot stops edge-tracing within the work area. Although it does not traverse the edge-tracing unit areas corresponding to the corner points above the contour segments set by the virtual wall shown in the figure, it avoids the robot endlessly walking along the edge within the work area, eliminates the influence of misjudgment factors on edge-tracing behavior, stops edge-tracing in time, ensures the robot's working efficiency, and reduces the number of repeated traversals.
[0078] As one embodiment, after the robot enters the last untraveled edge-tracing unit area in the preset clockwise direction, it is determined that the robot has traversed the edge-tracing unit area. The edge-tracing trajectory of the robot within the working area passes through all edge-tracing unit areas, and then the robot stops edge-tracing. In this embodiment, the order of the edge-tracing unit areas in the preset clockwise direction is obtained first to determine the relative position of one of the edge-tracing unit areas in the preset clockwise direction, thereby facilitating the robot to traverse all edge-tracing unit areas in one go in the preset clockwise direction. If there are no obstacles or virtual walls blocking or separating the working area, in this embodiment, the traversal order of the last untraveled edge-tracing unit area by the robot in the preset clockwise direction can be set in step S302. Figure 1In the process, the robot starts from corner point A1 and moves counterclockwise along the edge of the working area. In steps S301 and S302, corner point A1 is searched first, and then other corner points are searched in the working area counterclockwise, and the corresponding edge-to-edge unit areas are set in sequence. Therefore, the two adjacent corner points corresponding to the edge-to-edge unit areas set by the robot in the counterclockwise direction are, in sequence: corner point A1 and corner point B1, corner point B1 and corner point C1, corner point C1 and corner point D1, corner point D1 and corner point E1, corner point E1 and corner point F1, corner point F1 and corner point G1, and so on. Point G1 and corner points H1, H1 and I1, I1 and J1, J1 and K1, K1 and L1, L1 and M1, M1 and N1, N1 and O1, O1 and P1, P1 and Q1, Q1 and R1, R1 and S1, and S1 and A1 are used to determine the relative positional relationship of each edge-following unit region in the working area in a preset clockwise direction, i.e., to determine the order and coordinate coverage range of each edge-following unit region in the counterclockwise direction. Then, the robot moves along the contour of the working area in a counterclockwise direction. The resulting edge-following trajectory will sequentially pass through each edge-following unit region. Corner points S1 and A1 are the last edge-following unit regions that have not been visited. Figure 1 The rectangular region enclosing corner points S1 and A1.
[0079] In some embodiments, if there are no obstacles or virtual walls blocking the way or no separate work areas, corresponding to Figure 1In the process, the robot starts from corner point A1 and moves clockwise along the edge within the working area. In steps S301 and S302, corner point A1 is searched first, and then other corner points are searched counter-clockwise within the working area, with corresponding edge-following unit regions set sequentially. Therefore, the corner points searched counter-clockwise by the robot are, in order: corner point A1, corner point B1, corner point C1, corner point D1, corner point E1, corner point F1, corner point G1, corner point H1, corner point I1, corner point J1, corner point K1, corner point L1, corner point M1, corner point N1, corner point O1, corner point P1, corner point Q1, corner point R1, and corner point S1. Then, the relative positional relationship of each edge-following unit region in the clockwise direction within the working area is determined, i.e., the order and coordinate coverage of each edge-following unit region in the clockwise direction are determined. The order of each edge-following unit region in the clockwise direction is relative to its position in the counter-clockwise direction. The clockwise order is reversed; the adjacent two corner points corresponding to the edge unit area that the robot walks through in a clockwise direction are, in order: corner point A1 and corner point S1, corner point S1 and corner point R1, corner point R1 and corner point Q1, corner point Q1 and corner point P1, corner point P1 and corner point O1, corner point O1 and corner point N1, corner point N1 and corner point M1, corner point M1 and corner point L1, corner point L1 and corner point K1, corner point K1 and corner point J1, corner point J1 and corner point I1, and so on. Point I1 and corner H1, corner H1 and corner G1, corner G1 and corner F1, corner F1 and corner E1, corner E1 and corner D1, corner D1 and corner C1, corner C1 and corner B1, and corner B1 and corner A1. Therefore, within the working area, the last untraveled edge-following unit region the robot reaches, following the contour of the working area in a clockwise direction, is the edge-following unit region containing corner B1 and corner A1. (Corresponding to...) Figure 1 The rectangular region enclosing corner points S1 and A1.
[0080] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0081] In the above embodiments, a robot capable of performing sweeping tasks (hereinafter referred to as a sweeping robot) is used as an example to illustrate the technical solution of this application, but it is not limited to sweeping robots. The robot in the various embodiments of this application refers to any mechanical device capable of highly autonomous spatial movement in its environment, such as a sweeping robot, a companion robot, or a guide robot, or it can be an air purifier, a self-driving vehicle, etc. Of course, the tasks performed by different robot forms will vary, and this is not limited thereto.
[0082] To understand the embodiments corresponding to the boundary configuration methods described herein, it is possible to implement them using hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementations, the processing unit may be implemented within one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, other electronic units designed to perform the functions described herein, or combinations thereof. When embodiments are implemented using software, firmware, middleware, or microcode, program code, or code segments, they may be stored in a machine-readable medium such as a storage component.
[0083] To understand the embodiments corresponding to the work area planning method described in this application, it is necessary to understand that they can be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processing unit can be implemented within one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, other electronic units designed to perform the functions described herein, or combinations thereof. When embodiments are implemented in software, firmware, middleware, or microcode, program code, or code segments, they can be stored in a machine-readable medium such as a storage component.
[0084] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for setting map region outlines, characterized in that, Before executing this setup method, the robot acquires a map of the work area, which represents the outline of the work area so that the robot can walk along the outline; The setting method includes: The robot searches for corner points of the work area from the map; Then the robot sets the rectangular area where two adjacent corner points are located as the edge-following unit area, where the two adjacent corner points are covered by the edge-following unit area where they are located. In a map, the outline that corresponds to the extension direction of the two adjacent corner points covered by each edge-to-edge cell region is represented by the edge-to-edge cell region or the two adjacent corner points covered by that edge-to-edge cell region. When the robot's edge-walking trajectory passes through the area to be edge-walked, it is determined that the robot has walked along the contour segment that is consistent with the extension direction of the two adjacent corner points covered by the area to be edge-walked. The outline of the working area is formed by connecting multiple outline segments; each outline segment corresponds to two adjacent corner points; When each contour segment is expressed in the map by the edge-to-be-followed unit area where the corresponding two adjacent corner points are located in a preset clockwise direction, the coordinate coverage range of each edge-to-be-followed unit area in the working area and the sorting of each edge-to-be-followed unit area in the preset clockwise direction are recorded in the robot's memory in sequence. When each contour segment is represented on the map by two adjacent corner points in a preset clockwise direction, the coordinates of each pair of adjacent corner points within the working area and the order of each pair of adjacent corner points in the preset clockwise direction are recorded sequentially in the robot's memory.
2. The setting method according to claim 1, characterized in that, The method by which the robot sets the rectangular region containing two adjacent corner points as the region to be edged includes: When two adjacent corner points have the same coordinate value in one dimension, select the line segment parallel to the line connecting the two adjacent corner points as the long side of the rectangular region, and set the length of the long side of the rectangular region to be a first preset multiple of the straight-line distance between the two adjacent corner points to construct the rectangular region; then set the rectangular region as the area to be edged; where the first preset multiple is greater than or equal to 1. When the coordinate values of the same dimension in two adjacent corner points are not equal, select the line segment parallel to the line connecting the two adjacent corner points or the line segment intersecting the line connecting the two adjacent corner points as the diagonal of the rectangular region, and set the length of the diagonal of the rectangular region to be a second preset multiple of the straight-line distance between the two adjacent corner points to construct the rectangular region; then set the rectangular region as the area to be edged; wherein, the second preset multiple is greater than 1; The two adjacent corner points are the two corner points that are uniquely covered by the rectangular area.
3. The setting method according to claim 2, characterized in that, During the process of setting the area to be edged within the working area, the following situations may occur: When two adjacent corner points have the same coordinate value in one dimension, the long side of the rectangular region includes two endpoints. One endpoint extends along the direction parallel to the line connecting the two adjacent corner points to the other endpoint to obtain the long side of the rectangular region. The length of the line connecting the two endpoints is equal to a first preset multiple of the straight-line distance between the two adjacent corner points. The projection line segment of the line connecting the two adjacent corner points onto the line connecting the two endpoints does not exceed the line connecting the two endpoints. When two adjacent corner points have the same coordinate value in one dimension, there is a midpoint on the perpendicular line connecting the two adjacent corner points. Starting from this midpoint, the line extends parallel to the line connecting the two adjacent corner points to both sides of the midpoint to obtain the long side of the rectangular region. The sum of the lengths extended to both sides of the midpoint is equal to a first preset multiple of the straight-line distance between the two adjacent corner points. The projection of the line connecting the two adjacent corner points onto the long side of the rectangular region does not exceed the long side of the rectangular region. When the coordinate values of the same dimension in two adjacent corner points are not equal, the diagonal of the rectangular area includes two endpoints. One endpoint extends to the other endpoint along the direction parallel to the line connecting the two adjacent corner points or in the direction intersecting the line connecting the two adjacent corner points, thus obtaining the diagonal of the rectangular area. The length of the line connecting the two endpoints is equal to a second preset multiple of the straight-line distance between the two adjacent corner points, and the projection line segment of the line connecting the two adjacent corner points onto the line connecting the two endpoints does not exceed the line connecting the two endpoints. When the coordinate values of the same dimension in two adjacent corner points are not equal, there is a midpoint on the perpendicular line connecting the two adjacent corner points. Starting from this midpoint, the line extends to both sides of the midpoint in a direction parallel to or intersecting the line connecting the two adjacent corner points, to obtain the diagonal of the rectangular area. The sum of the lengths extended to both sides of the midpoint is equal to a second preset multiple of the straight-line distance between the two adjacent corner points. The projection of the line connecting the two adjacent corner points onto the diagonal of the rectangular area does not exceed the diagonal of the rectangular area.
4. The setting method according to claim 1, characterized in that, The method by which the robot sets the rectangular region containing two adjacent corner points as the region to be edged includes: When two adjacent corner points have the same coordinate value in one dimension, the line connecting the two adjacent corner points is set as the long side of the rectangular region so that the length of the rectangular region is equal to the straight-line distance between the two adjacent corner points, thus constructing a rectangular region. The two adjacent corner points are the only two corner points covered by the rectangular region. Then, the rectangular region is set as the region to be edged. When the coordinate values of the same dimension of two adjacent corner points are not equal, the line connecting the two adjacent corner points is selected as the diagonal of the rectangular region to construct the rectangular region. The two adjacent corner points are the only two corner points covered by the rectangular region. Then, the rectangular region is set as the region to be used as the edge unit.
5. The setting method according to claim 2 or 4, characterized in that, The minimum side length of the area to be edged is greater than or equal to the robot's body width, or greater than or equal to the wall thickness of the work area, so as to reserve space for the robot to enter the area to be edged.
6. The setting method according to claim 2 or 4, characterized in that, In the process of setting the edge-following unit area within the working area, a pre-selected corner point is first marked as the current corner point. Starting from the current corner point, the nearest corner point is selected according to the preset clockwise direction and marked as the next corner point. Then, the rectangular area where the two corner points are located is set as the edge-following unit area. The sorting and coordinate coverage of the edge-following unit area and the corresponding corner points in the preset clockwise direction are recorded, and the current corner point and the next corner point are marked as the two adjacent corner points. Then, the next corner point is updated to the current corner point. This process is repeated until the corresponding edge-following unit areas are set at the locations of all two adjacent corner points, and the coordinate coverage of all edge-following unit areas in the working area and their sorting in the preset clockwise direction are obtained.
7. The setting method according to claim 1, characterized in that, The method by which the robot searches for corner points of the work area from the map includes: In the map, the robot starts from a pre-set search starting point and obtains corner points through neighborhood search; where the search starting point is a pixel used to represent an obstacle. The corner point is the intersection of a set of mutually perpendicular contour line segments in the map, and the intersection point is the endpoint of the contour line segment; the contour line segment is marked by the robot in advance when traversing the work area.
8. The setting method according to claim 7, characterized in that, If only one pixel representing an obstacle is found in the neighborhood of the search starting point, the search starting point is set as a corner point and the pixel is marked as a current candidate point. Then, a search is performed in the neighborhood of the current candidate point. If there is no pixel collinear with the current candidate point and the search starting point, the current candidate point is marked as a corner point found in the neighborhood of the search starting point, and the search starting point and the current candidate point are marked as the two adjacent corner points. If there is a pixel that is collinear with the current candidate point and the search starting point, the current candidate point is updated to a transition point, and the pixel is updated to the current candidate point. Then, a search is performed in the neighborhood of the current candidate point. This process is repeated until there are no pixels that are collinear with the current candidate point and the transition point. At this point, the current candidate point is marked as a corner point.
9. A robot edge-tracing termination control method, characterized in that, Robot edge termination control methods include: The robot executes the method for setting up a map region outline as described in any one of claims 1 to 8, and sets up a plurality of the edge-following unit regions; The robot then moves along the edge within the work area; When the robot has traversed all the areas of the units to be traversed, the robot stops traversing the edge; When the robot repeatedly walks over the same batch of edge-following unit areas, the robot stops walking along the edge; wherein, the same batch of edge-following unit areas are a preset number of different edge-following unit areas. Wherein, the number of edge-following unit regions set by the setting method is greater than the preset number.
10. The robot edge-tracing termination control method according to claim 9, characterized in that, The larger the size of the obstacles in the work area, and / or the larger the work restricted area set by the virtual wall, the smaller the preset number is set; The smaller the size of the obstacles in the work area, and / or the smaller the work restricted area set by the virtual wall, the larger the preset number should be; The larger the overlap between two edge-following unit regions, the smaller the preset quantity should be.
11. The robot edge-tracing termination control method according to claim 9, characterized in that, Whenever the robot repeats the same batch of edge-following unit areas, the robot moves through each edge-following unit area in a preset clockwise direction or the opposite direction of the preset clockwise direction. During the process of the robot walking through the same batch of edge-to-edge unit areas, each edge-to-edge unit area in the same batch of edge-to-edge unit areas is walked by the robot only once. Among them, all the edge-to-edge unit areas in the same batch are set in the working area in the preset clockwise direction.
12. The robot edge-tracing termination control method according to claim 9, characterized in that, When the robot's real-time recorded x-coordinate is greater than the minimum x-coordinate of the vertex of the edge-following unit region and less than the maximum x-coordinate of the vertex of the edge-following unit region, and the robot's real-time recorded y-coordinate is greater than the minimum y-coordinate of the vertex of the edge-following unit region and less than the maximum y-coordinate of the vertex of the edge-following unit region, the robot enters the edge-following unit region, and it is determined that the robot's edge-following trajectory passes through the edge-following unit region, and it is determined that the robot has walked through the edge-following unit region. The area to be edged is a planar area in the map.
13. The robot edge-tracing termination control method according to claim 12, characterized in that, Once the robot enters the last untraveled edge-tracing unit area in a preset clockwise direction, it is determined that the robot's edge-tracing trajectory has passed through all edge-tracing unit areas. Then, the robot stops its edge-tracing. The order of the edge-following unit regions in the preset clockwise direction is obtained first, so as to determine the relative positional relationship of one of the edge-following unit regions in the preset clockwise direction.
Citation Information
Patent Citations
Turn-minimizing or turn-reducing robot coverage
US20200089255A1
