Pixel-based work area planning method, chip and robot
By using a pixel-based work area planning method, the cleaning robot can plan a regular work area indoors, solving the problems of complex paths and incomplete cleaning, and achieving a more efficient cleaning effect.
Patent Information
- Application Number
- CN202210083374.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-01-25
AI Technical Summary
The unstable docking positions of cleaning robots in indoor work areas lead to complex navigation paths and may result in not cleaning more effective areas, especially open areas.
The pixel-based work area planning method expands the robot's work area by counting the number of obstacle pixels row by row and column by column, and then uses the number and location information of obstacle pixels to plan the regular work area boundary.
It simplifies the path planning in the indoor work area, ensuring that the robot can traverse more open areas over the longest possible distance, thus improving cleaning efficiency.
Smart Images

Figure CN116540684B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of laser mapping positioning, and particularly to a working area planning method based on pixel points, a chip and a robot. BACKGROUND
[0002] When a cleaning robot with laser navigation works in an indoor working area, the indoor working area is divided into multiple MxN sub-areas, which are generally 4m x 4m areas in the physical environment.
[0003] The parking position of the cleaning robot in the indoor working area is unstable. If the first sub-area is formed by simply taking the coordinate position of the cleaning robot as the center and extending 2m in length in four directions symmetrical to the center of the coordinate position of the cleaning robot, the position distribution characteristics of the obstacles framed in the first sub-area are random, which results in that the obstacles framed in the first sub-area are not necessarily complete or regular. Therefore, the navigation path planned by the cleaning robot in the first sub-area is relatively complex, and more effective areas (including open areas) may not be cleaned. SUMMARY
[0004] To solve the above technical problems, the present application discloses a map working area planning method based on laser data, a chip and a robot, which solves the problem of planning a working area for a mobile robot with map navigation function. The specific technical solutions are as follows:
[0005] The working area planning method based on pixel points comprises: in the map constructed by the robot, counting the number of obstacle pixels in the preconfigured map area row by row and column by column; and expanding the working area of the robot according to the number of obstacle pixels in the corresponding row and the number of obstacle pixels in the corresponding column.
[0006] Further, the method for expanding the robot working area according to the number of obstacle pixels in the corresponding row and the number of obstacle pixels in the corresponding column comprises: in the preconfigured map area, expanding a column preset boundary distance along the corresponding column direction according to the number of obstacle pixels included in the boundary obstacle row to obtain a first effective row boundary and a second effective row boundary; wherein the first effective row boundary and the second effective row boundary respectively belong to a corresponding row of pixel points of the preconfigured map area; in the preconfigured map area, expanding a row preset boundary distance along the corresponding row direction according to the number of obstacle pixels included in the boundary obstacle column to obtain a first effective column boundary and a second effective column boundary; wherein the first effective column boundary and the second effective column boundary respectively belong to a corresponding column of pixel points of the preconfigured map area; and then setting the area surrounded by the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary as the robot working area.
[0007] Further, the boundary obstacle row comprises a first boundary obstacle row and a second boundary obstacle row; when the number of obstacle pixels included in the first boundary obstacle row is greater than the number of obstacle pixels included in the second boundary obstacle row, or when the robot searches for the first boundary obstacle row but fails to search for the second boundary obstacle row in the preconfigured map area, starting from the first boundary obstacle row, the column preset boundary distance is traversed along a first column direction to obtain a row boundary; then the first boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary; when the number of obstacle pixels included in the first boundary obstacle row is less than the number of obstacle pixels included in the second boundary obstacle row, or when the robot searches for the second boundary obstacle row but fails to search for the first boundary obstacle row in the preconfigured map area, starting from the second boundary obstacle row, the column preset boundary distance is traversed along a second column direction to obtain a row boundary; then the second boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary; wherein the first column direction is opposite to the second column direction.
[0008] Further, the boundary obstacle column includes a first boundary obstacle column and a second boundary obstacle column; when the number of obstacle pixel points included in the first boundary obstacle column is greater than the number of obstacle pixel points included in the second boundary obstacle column, or when the robot searches for the first boundary obstacle column but not the second boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in a corresponding row direction from the first boundary obstacle column; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; when the number of obstacle pixel points included in the first boundary obstacle column is less than the number of obstacle pixel points included in the second boundary obstacle column, or when the robot searches for the second boundary obstacle column but not the first boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in a corresponding row direction from the second boundary obstacle column; then the second boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; wherein the first row direction is opposite to the second row direction.
[0009] Further, the boundary obstacle column includes a first boundary obstacle column and a second boundary obstacle column; when the number of obstacle pixel points included in the first boundary obstacle column is greater than the number of obstacle pixel points included in the second boundary obstacle column, or when the robot searches for the first boundary obstacle column but not the second boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in a corresponding row direction from the first boundary obstacle column; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; when the number of obstacle pixel points included in the first boundary obstacle column is less than the number of obstacle pixel points included in the second boundary obstacle column, or when the robot searches for the second boundary obstacle column but not the first boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in a corresponding row direction from the second boundary obstacle column; then the second boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; wherein the first row direction is opposite to the second row direction.
[0010] Further, the boundary obstacle column includes a first boundary obstacle column and a second boundary obstacle column; when the number of obstacle pixel points included in the first boundary obstacle column is greater than the number of obstacle pixel points included in the second boundary obstacle column, or when the robot searches for the first boundary obstacle column but not the second boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in a corresponding row direction from the first boundary obstacle column; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; when the number of obstacle pixel points included in the first boundary obstacle column is less than the number of obstacle pixel points included in the second boundary obstacle column, or when the robot searches for the second boundary obstacle column but not the first boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in a corresponding row direction from the second boundary obstacle column; then the second boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; wherein the first row direction is opposite to the second row direction.
[0011] Further, when the robot fails to search for the boundary obstacle column in the preconfigured map area, there are steps to set a column boundary perpendicular to the first row direction at a first preset position point at a distance of half the preset boundary distance from the extension starting point of the robot position point along the first row direction, and set the column boundary perpendicular to the first row direction as the first effective column boundary; set a column boundary perpendicular to the second row direction at a second preset position point at a distance of half the preset boundary distance from the extension starting point of the robot position point along the second row direction, and set the column boundary perpendicular to the second row direction as the second effective column boundary; wherein the first row direction is opposite to the second row direction.
[0012] Further, when the robot fails to search for the boundary obstacle column in the preconfigured map area, there are steps to set a column boundary perpendicular to the first row direction at a first preset position point at a distance of half the preset boundary distance from the extension starting point of the robot position point along the first row direction, and set the column boundary perpendicular to the first row direction as the first effective column boundary; set a column boundary perpendicular to the second row direction at a second preset position point at a distance of half the preset boundary distance from the extension starting point of the robot position point along the second row direction, and set the column boundary perpendicular to the second row direction as the second effective column boundary; wherein the first row direction is opposite to the second row direction.
[0013] Further, the second boundary obstacle row is divided into a second boundary obstacle row segment by the first effective column boundary and the second effective column boundary, wherein the length of the second boundary obstacle row segment is equal to the preset boundary distance in the row; the first boundary obstacle row is divided into a first boundary obstacle row segment by the first effective column boundary and the second effective column boundary, wherein the length of the first boundary obstacle row segment is equal to the preset boundary distance in the row; the first boundary obstacle column is divided into a first boundary obstacle column segment by the first effective row boundary and the second effective row boundary, wherein the length of the first boundary obstacle column is equal to the preset boundary distance in the column; the second boundary obstacle column is divided into a second boundary obstacle column segment by the first effective row boundary and the second effective row boundary, wherein the length of the second boundary obstacle column is equal to the preset boundary distance in the column.
[0014] Further, the method of counting the number of obstacle pixel points in the preconfigured map region row by row and column by column comprises image processing on the preconfigured map region; marking obstacle pixel points and non-obstacle pixel points in the preconfigured map region after image processing, wherein the obstacle pixel points are pixel points used to represent obstacles in the preconfigured map region, and the non-obstacle pixel points are pixel points used to represent non-obstacles in the preconfigured map region; marking boundary obstacle rows by counting the number of obstacle pixel points in the preconfigured map region row by row; and marking boundary obstacle columns by counting the number of obstacle pixel points in the preconfigured map region column by column.
[0015] Further, the method of marking boundary obstacle rows by counting the number of obstacle pixel points in the preconfigured map region row by row comprises the following steps: in the preconfigured map region after image processing, whenever the number of obstacle pixel points in a row is greater than a row number threshold, marking the row as an obstacle row; whenever a row of pixel points is traversed or an obstacle row is marked, continuing to traverse the next row of pixel points; repeating the above steps until all rows in the preconfigured map region after image processing are traversed, and then marking the two obstacle rows with the maximum linear distance in the column direction as boundary obstacle rows; wherein the row number threshold is a preset multiple of the linear length of the preconfigured map region in the row direction; and the preset multiple is greater than 0 and less than 1.
[0016] Further, the column direction is the longitudinal coordinate axis direction of the preconfigured map region, and the row direction is the horizontal coordinate axis direction of the preconfigured map region; in the preconfigured map region, two boundary obstacle rows are marked, one of which has the maximum longitudinal coordinate among the longitudinal coordinates of all obstacle rows, and the other of which has the minimum longitudinal coordinate among the longitudinal coordinates of all obstacle rows; wherein the longitudinal coordinates of all pixel points in each obstacle row are equal; and the row number threshold is a preset multiple of the length of the preconfigured map region in the horizontal coordinate axis direction.
[0017] Further, the pixels in the preconfigured map region after image processing are traversed row by row along the first column direction, and each time the number of obstacle pixels in a row is greater than the row number threshold, the row is marked as an obstacle row; each time a row of pixels is traversed or an obstacle row is marked, the next row of pixels is traversed along the first column direction; this is repeated, and if an obstacle row is detected, the obstacle row farthest from the robot's position point is marked as the first boundary obstacle row; if no obstacle row is detected, it is determined that the robot cannot find the first boundary obstacle row; the pixels in the preconfigured map region after image processing are traversed row by row along the second column direction, and each time the number of obstacle pixels in a row is greater than the row number threshold, the row is marked as an obstacle row; each time a row of pixels is traversed or an obstacle row is marked, the next row of pixels is traversed along the second column direction; this is repeated, and if an obstacle row is detected, the obstacle row farthest from the robot's position point is marked as the second boundary obstacle row; if no obstacle row is detected, it is determined that the robot cannot find the second boundary obstacle row; wherein the first column direction is opposite to the second column direction; wherein the first boundary obstacle row and the second boundary obstacle row both belong to the boundary obstacle row.
[0018] Further, when the second column direction is the positive direction of the longitudinal coordinate axis, the first column direction is the negative direction of the longitudinal coordinate axis; or when the second column direction is the negative direction of the longitudinal coordinate axis, the first column direction is the positive direction of the longitudinal coordinate axis.
[0019] Further, the method of marking the boundary obstacle column by counting the number of obstacle pixels in the preconfigured map region column by column specifically includes that in the preconfigured map region after image processing, each time the number of obstacle pixels in a column is greater than the column number threshold, the column is marked as an obstacle column; each time a column of pixels is traversed or an obstacle column is marked, the next column of pixels is traversed; this is repeated until all columns in the preconfigured map region after image processing are traversed, and then the two obstacle columns with the maximum straight-line distance in the row direction are both marked as boundary obstacle columns; wherein the column number threshold is a preset multiple of the straight-line length of the preconfigured map region in the column direction; the preset multiple is greater than 0 and less than 1.
[0020] Further, the row direction is the horizontal coordinate axis direction of the preconfigured map region; in the preconfigured map region, two boundary obstacle columns are marked, one of which has the maximum horizontal coordinate of all obstacle column pixels, and the other of which has the minimum horizontal coordinate of all obstacle column pixels; wherein all the horizontal coordinates of the pixels in each obstacle column are equal; wherein the column number threshold is a preset multiple of the width of the preconfigured map region in the longitudinal coordinate axis direction.
[0021] Further, the pixels in the preconfigured map region after image processing are traversed column by column along the first row direction, and each time the number of obstacle pixels in a column of pixels is greater than the column number threshold, the column is marked as an obstacle column; each time a column of pixels is traversed or an obstacle column is marked, the next column of pixels is continued to be traversed along the first row direction; this is repeated, if an obstacle column is detected, the obstacle column farthest from the position point of the robot is marked as the first boundary obstacle column; if no obstacle column is detected, it is determined that the first boundary obstacle column cannot be searched by the robot; the pixels in the preconfigured map region after image processing are traversed column by column along the second row direction, and each time the number of obstacle pixels in a column of pixels is greater than the column number threshold, the column is marked as an obstacle column; each time a column of pixels is traversed or an obstacle column is marked, the next column of pixels is continued to be traversed along the second row direction; this is repeated, if an obstacle column is detected, the obstacle column farthest from the position point of the robot is marked as the second boundary obstacle column; if no obstacle column is detected, it is determined that the second boundary obstacle column cannot be searched by the robot; wherein the first row direction is opposite to the second row direction; wherein the first boundary obstacle column and the second boundary obstacle column both belong to the boundary obstacle column.
[0022] Further, when the second row direction is the positive direction of the horizontal coordinate axis, the first row direction is the negative direction of the horizontal coordinate axis; or, when the second row direction is the negative direction of the horizontal coordinate axis, the first row direction is the positive direction of the horizontal coordinate axis.
[0023] Further, the position point of the robot is located inside the preconfigured map region; among all the marked obstacle rows, the boundary obstacle row is the obstacle row farthest from the position point of the robot in the corresponding column direction; among all the marked obstacle columns, the boundary obstacle column is the obstacle column farthest from the position point of the robot in the corresponding row direction.
[0024] Further, the preconfigured map region is a map region with the position point of the robot as the center of symmetry; wherein the preconfigured map region is a rectangular region.
[0025] Further, the method for image processing on the preconfigured map region comprises: performing a closing operation on the preconfigured map region, so that the contour line of the obstacle marked in the preconfigured map region is completely described, wherein the closing operation is used to connect the connected domains in the preconfigured map region; wherein the preconfigured map region is an image region of a specific size belonging to the robot constructed to describe the position characteristics of the obstacle.
[0026] Further, the closing operation comprises binarizing the preconfigured map region to obtain a binarized map; then performing image dilation processing on the binarized map, and then performing image erosion processing on the binarized map after the image dilation processing, so that part of the pixel points representing non-obstacles are configured as pixel points representing obstacles; wherein the pixel value of the pixel points representing obstacles and the pixel value of the pixel points representing non-obstacles in the binarized map are different.
[0027] A chip, which is built-in with a control program, the control program being used to control a robot to perform the work area planning method.
[0028] A robot, which is built-in with the chip.
[0029] The beneficial technical effect of the present application is that, according to the number information of the pixel points representing obstacles in the map constructed by the robot, the boundary obstacle rows and the boundary obstacle columns that are most edges and intersect with each other are extracted in a specific map region, a robot work area is framed, and the robot work area is the optimal work area of the robot in the corresponding work environment, so that the planning of the first work area according to the number of the pixel points representing obstacles in each row and each column and the distance information from the position point of the robot makes the contour line of the obstacles framed in the first work area as complete or regular as possible, which not only simplifies the planning of the work path of the indoor work area, but also traverses to as many open areas as possible at the farthest distance, so that the robot moves to more effective work areas in the first work area. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is a flowchart of the work area planning method based on pixel points disclosed by an embodiment of the present application.
[0031] Figure 2 is a distribution diagram of obstacle pixel points in a preconfigured map region disclosed by an embodiment of the present application, wherein the obstacle pixel points are black, and the open area is white; the position point O is the position point of the robot.
[0032] Figure 3 is a distribution diagram of obstacle pixel points in a preconfigured map region after image processing disclosed by an embodiment of the present application, wherein the line segment AB and the line segment CD are in the same boundary obstacle row, the line segment EF and the line segment MN are in the same boundary obstacle column, and the line segment AB, the line segment CD, the line segment EF and the line segment MN are all line segments connected by obstacle pixel points in sequence.
[0033] Figure 4 is a flowchart of the work area planning method based on pixel points disclosed by an embodiment of the present application. Figure 3A schematic view of a robot working area PQRS determined by the boundary obstacle row and the boundary obstacle column in the robot working area PQRS, wherein the robot working area PQRS comprises a first effective row boundary PQ, a second effective row boundary RS, a first effective column boundary QS and a second effective column boundary PR. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application. In order to further illustrate the embodiments, the present application provides drawings. These drawings are part of the disclosure of the present application, which mainly serve to illustrate the embodiments and can be used to explain the operating principle of the embodiments in conjunction with the related description of the specification. Those of ordinary skill in the art should be able to understand other possible implementations and advantages of the present application by referring to these contents. As a flowchart depicts a process or method. Although the flowchart describes each step as a sequential process, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0035] It should be understood that the orientations or positional relationships indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. are based on the map orientation or pixel position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the indicated devices, boundaries, pixels, unit grids, line segments or elements must have a particular orientation, be constructed in a particular orientation and be traversed in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first" and "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features.
[0036] As an embodiment, the embodiment of the present application provides a pixel-based working area planning method, which is executed by a pixel processing device, the pixel processing device can be realized by software and / or hardware, and is generally arranged in a robot provided with a ranging sensor, so that the robot can serve as an execution subject of the working area planning method to plan a working area before starting to move. The ranging sensor includes a visual sensor and / or a laser sensor, wherein the visual sensor and / or the laser sensor can detect an obstacle, and a commonly used scenario is that point cloud data of a surrounding object is formed by data reflected back to a laser beam emitted by the laser sensor and scanning a surface of the surrounding object around the body of the robot, so that the surrounding object around the body can be identified as an obstacle and converted and marked into a map, wherein the point cloud data includes position information of an obstacle surface scanned by the laser beam of the laser sensor, and the map is a map (including a map coordinate system) constructed in advance by the robot, which can be attributed to a grid map constructed by a SLAM technology for a surrounding environment of the robot.
[0037] As shown in Figure 1 , the working area planning method basically includes:
[0038] Step S1: In a map constructed by the robot, a preconfigured map area associated with a position point of the robot is framed, and then step S2 is executed. Before starting to perform a working task, the robot frames a preconfigured map area in the map constructed in advance, so as to perform the working task from a first working area (a local map area planned in a subsequent step) in the preconfigured map area. Preferably, in order to facilitate the robot to start to perform edge walking in the first working area, the position point of the robot is set as a center of the preconfigured map area, and a reasonable area boundary and a first working area surrounded thereby in the preconfigured map area are marked.
[0039] It should be noted that the working area where the robot is located is an indoor working area, for example, when the robot is a cleaning robot or an intelligent security robot, the working area where the robot is located is an indoor working area, which is generally a home environment area and is not completely occupied by an obstacle. In the working area, the more complete obstacle or the more regular obstacle occupies a larger area, and the more free area is reserved, and vice versa. At this time, the embodiment obtains the first working area with more free areas by executing the working area planning method, so as to facilitate the robot to move in the first working area according to the planned path, and simplify the difficulty of path planning.
[0040] On the other hand, the selection of the first working area is relatively important. For example, in a 4m by 4m room, if the first working area of the cleaning robot covers the entire planar area of the room, the robot only needs to walk along the edge once and clean once to complete the cleaning task. In contrast, in a 4m by 4m room, the room is forced to be divided into four sub-areas for cleaning tasks, which requires walking along the edge four times and cleaning four times in succession, and three navigation paths. Therefore, the overall cleaning path planned is definitely more complex than the path planned in the first working area. The length and width of the first working area are adaptively configured according to the size of the actual working environment and the working range of the robot.
[0041] In step S2, the number of obstacle pixel points in the preconfigured map area is counted row by row and column by column, and then the robot performs step S3. In the process of performing step S2, the robot counts the number of obstacle pixel points in the preconfigured map area row by row and column by column. When the number of obstacle pixel points in a specific row and a specific column reaches the corresponding preset threshold, it can be determined that the robot has traversed to the boundary of the required working area. At this time, a rectangular area is framed in the specific row and the specific column, which is equivalent to a rectangular area surrounded by a line segment.
[0042] Specifically, the controller inside the robot reads the laser point cloud data or depth image including the laser point cloud data collected by the laser sensor in real time, constructs a point cloud model to create a point cloud map, converts from the laser radar coordinate system or pixel coordinate system to the world coordinate system, projects and converts the point cloud map into a two-dimensional grid map that can be used for navigation, i.e., the preconfigured map area, which is a two-dimensional point cloud map reflecting the environmental information detected by the robot in the travel plane. The preconfigured map area is a map image to facilitate related image processing operations on the pixel points in the map image. In the map coordinate system of the preconfigured map area, i.e., the two-dimensional grid coordinate system, the origin of the map coordinate system of the preconfigured map area can be defined at the driving wheel, the assembly position of the laser sensor, or the center position of the robot body, which is not limited here.
[0043] Preferably, each pixel point in the preconfigured map region can be represented by a unit cell of a specific size, where the unit cell of the specific size is each cell in the aforementioned two-dimensional grid map, and the pixel point is a unit pixel in the preconfigured map region, i.e., the cell is a unit cell in the preconfigured map region, so that one pixel point corresponds to one cell; further, under the map configuration condition of configuring the pixel point as the cell, the robot configures one pixel point as a 5 cm by 5 cm unit cell as the cell filling the preconfigured map region, at this time, the cell is equivalent to the 5 cm by 5 cm unit cell, and one pixel point corresponds to one unit cell. Preferably, in the preconfigured map region, the coordinates of each cell are the coordinates of the lower left corner point of the cell, the coordinates of the upper left corner point of the cell, or the coordinates of the lower right corner point of the cell, in some implementation scenarios, the center position of the cell is used to represent the real geographical position of the scanned region, and the coordinates of each cell are represented by the coordinates of the center position of the cell. The coordinates of the related corner points and the center position of the cell can also represent the row number and the column number of the cell in the preconfigured map region, the horizontal coordinate is equal to the column number, and the vertical coordinate is equal to the row number. Therefore, the row-by-row statistics of the number of obstacle pixel points in the preconfigured map region is equivalent to the statistics of the number of cell coordinates (pixel point coordinates) with equal vertical coordinates, and the column-by-column statistics of the number of obstacle pixel points in the preconfigured map region is equivalent to the statistics of the number of cell coordinates (pixel point coordinates) with equal horizontal coordinates.
[0044] In some embodiments, each cell corresponding to a laser point collected by the laser sensor of the robot or each cell corresponding to a landmark collected by the visual sensor is represented by a pixel point in the preconfigured map region; the coordinates of the cell corresponding to the pixel point are the coordinates of the laser point converted into the preconfigured map, also known as the map coordinates of the laser point, accordingly, the cell corresponding to the laser point is the map coordinate point corresponding to the laser point or directly understood as the map coordinate point corresponding to the laser point; the coordinates of the cell corresponding to the laser point are directly understood as the map coordinates of the laser point.
[0045] Step S3, according to the number of obstacle pixel points in the corresponding row and the number of obstacle pixel points in the corresponding column, the robot working area is expanded. Wherein, the obstacle pixel points in the corresponding row can be represented by using the obstacle pixel points with a specific longitudinal coordinate, which is equivalent to using a horizontal line to represent; the obstacle pixel points in the corresponding column can be represented by using the obstacle pixel points with a specific transverse coordinate, which is equivalent to using a vertical line to represent. In this embodiment, in order to expand a rectangular robot working area, two horizontal lines and two vertical lines that meet the number of obstacle pixel points statistical requirements need to be searched and expanded, so that the contour boundary of the robot working area (a working partition in the preconfigured map area) is reasonable, and the obstacles framed in the robot working area tend to be complete or regular.
[0046] It should be noted that the expansion can be selected to start from a row including a specific number of obstacle pixel points, and to traverse each pixel in each column until a column preset boundary distance is reached, wherein the column preset boundary distance is correspondingly configured as the width of the rectangular robot working area; the expansion can also be selected to start from a column including a specific number of obstacle pixel points, and to traverse each pixel in each row until a row preset boundary distance is reached, wherein the row preset boundary distance is correspondingly configured as the length of the rectangular robot working area. In summary, the working area planning method described in the foregoing steps S1 to S3 not only simplifies the planning of the working path of the indoor working area, but also traverses as far as possible to a sufficient number of open areas.
[0047] In this embodiment, the robot working area is the first working area map area constructed by the robot, which can be marked with the farthest obstacle in the room area where the robot is located, so that there is a large enough passable area (i.e. open area) in the first working area of the robot, wherein the area of the first working area of the robot is smaller than the area of the room area where the robot is located. Preferably, the preconfigured map area is a rectangular map area. In some embodiments, the preconfigured map area is a specific size image mapped by the laser points collected by the laser sensor of the robot, which is composed of elements in units of pixel points, and each pixel point can be regarded as a grid (a unit grid of a specific size).
[0048] It should be noted that in the preconfigured map area, each obstacle is composed of pixel points with the same pixel value and adjacent to each other, so that each obstacle in the preconfigured map area can be combined by adjacent grids, wherein the pixel points constituting the obstacle are obstacle pixel points, specifically, the pixel points in the projection area of the obstacle in the two-dimensional map.
[0049] Specifically, the preconfigured map area is processed using the connected domain analysis disclosed in the prior art, and the obstacles at different positions are marked as pixel points composed of different pixel values, and the obstacles at different positions are composed of pixel points of different colors. It should be noted that the connected domain is an image region composed of pixel points with equal pixel values and adjacent positions. When the pixel points are used to represent the grids in the preconfigured map area in the embodiment, the connected domain is a grid set composed of adjacent grids with the same pixel value. Preferably, one pixel point is configured as a 5 cm by 5 cm cell as a grid filling the preconfigured map area. In addition, each grid or each pixel point in the same connected domain has the same number of connected pixels. The size of a connected domain is the number of connected pixels, and the number of pixel points constituting the connected domain can reflect the size of the obstacle. Corresponding to Figure 2 and Figure 3 In the above, the obstacles are composed of black pixel points and belong to a set of black pixel points, which simplifies the statistical operation of the obstacle pixel points in the preconfigured map area.
[0050] As an embodiment, the method for expanding the robot working area according to the number of obstacle pixel points in the corresponding row and the number of obstacle pixel points in the corresponding column comprises:
[0051] The robot expands the column preset boundary distance along the corresponding column direction according to the number of obstacle pixel points included in the boundary obstacle row in the preconfigured map area, obtains the first effective row boundary and the second effective row boundary, which is essentially that starting from the pixel point on the boundary obstacle row, the longitudinal coordinate difference between two adjacent pixel points can be set as the preset expansion step, the pixel point expansion operation is performed along the corresponding column direction, and the map area framed between the first effective row boundary and the second effective row boundary is obtained. The boundary obstacle row or the pixel point set of a specific length in the boundary obstacle row is configured as the first effective row boundary, which can be a straight line or a line segment. The second effective row boundary is obtained by expanding from the pixel point on the boundary obstacle row, and the distance between each pixel point in the first effective row boundary and the pixel point in the corresponding column direction of the second effective row boundary is equal. The second effective row boundary can be a straight line or a line segment. It should be noted that the first effective row boundary and the second effective row boundary belong to the corresponding row of pixel points of the preconfigured map area.
[0052] The robot expands the row preset boundary distance along the corresponding row direction according to the number of obstacle pixel points included in the boundary obstacle column in the preconfigured map area, obtains the first effective column boundary and the second effective column boundary, and in essence, starts from the pixel point on the boundary obstacle column, expands the pixel point along the corresponding row direction according to the preset expansion step, which can be to set the horizontal coordinate difference between the adjacent two pixel points as the preset expansion step, and obtains the map area framed between the first effective column boundary and the second effective column boundary; the boundary obstacle column or the pixel point set of a specific length in the boundary obstacle column is configured as the first effective column boundary, which can be a straight line or a line segment; and the second effective column boundary is obtained by expanding from the pixel point on the boundary obstacle column, and the distance between each pixel point in the first effective column boundary and the pixel point of the second effective column boundary in the corresponding row direction is equal, and the second effective column boundary can be a straight line or a line segment. It should be noted that the first effective column boundary and the second effective column boundary respectively belong to the corresponding one column of pixel points of the preconfigured map area. It should be noted that the first effective column boundary and the second effective column boundary respectively belong to the corresponding one column of pixel points of the preconfigured map area.
[0053] On this basis, the first effective row boundary intersects the first effective column boundary and the second effective column boundary at the same time, and the second effective row boundary intersects the first effective column boundary and the second effective column boundary at the same time; the robot sets the area surrounded by the intersection of the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary as the robot working area; at this time, the second effective row boundary is divided by the first effective column boundary and the second effective column boundary into a second boundary obstacle row segment, wherein the length of the second boundary obstacle row segment is equal to the length of the boundary obstacle row expanded along the corresponding column direction; the first effective row boundary is divided by the first effective column boundary and the second effective column boundary into a first boundary obstacle row segment, wherein the length of the first boundary obstacle row segment is equal to the length of the boundary obstacle row expanded along the corresponding column direction; the first effective column boundary is divided by the first effective row boundary and the second effective row boundary into a first boundary obstacle column segment, wherein the length of the first boundary obstacle column segment is equal to the length of the boundary obstacle column expanded along the corresponding row direction; and the second effective column boundary is divided by the first effective row boundary and the second effective row boundary into a second boundary obstacle column segment, wherein the length of the second boundary obstacle column segment is equal to the length of the boundary obstacle column expanded along the corresponding row direction. The robot working area planned by the embodiment has a regular and reasonable boundary. The robot working area mentioned in the embodiment is surrounded by the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary, but in fact it is a closed area surrounded by the intersection of the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary. The actual coverage area of the robot working area is the closed area, which specifically includes the set of all pixel points in the closed area, and the pixel points of the overlapping part of the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary in the boundary of the closed area.
[0054] As an embodiment one, the boundary obstacle rows include a first boundary obstacle row and a second boundary obstacle row. When the first boundary obstacle row includes more obstacle pixels than the second boundary obstacle row, or when the robot searches for the first boundary obstacle row but not the second boundary obstacle row in the corresponding column direction in the preconfigured map area, the control unit inside the robot traverses a preset boundary distance in the corresponding column direction from the first boundary obstacle row, which can be understood as traversing the preset boundary distance in the first column direction. Then, the row boundary is obtained in the preconfigured map area, and the distance between the pixel of the row boundary and the corresponding pixel of the first boundary obstacle row in each column (corresponding column direction) is equal to the preset boundary distance. Then, the first boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary. It should be noted that the first boundary obstacle row, the first effective row boundary, the second boundary obstacle row, and the second effective row boundary can all be represented by a straight line, which is represented by a longitudinal coordinate value in the preconfigured map area. Preferably, the specific source of the corresponding column direction is that in the corresponding coordinate system of the preconfigured map area, the longitudinal coordinates of all the pixels in the first boundary obstacle row are equal. When the longitudinal coordinate of the pixel in the first boundary obstacle row is the maximum longitudinal coordinate among the longitudinal coordinates of all the pixels in the boundary rows, the first boundary obstacle row is close to the uppermost edge of the preconfigured map area. In order to more completely traverse the preconfigured map area, the corresponding column direction is the negative direction of the longitudinal coordinate axis, and the longitudinal coordinate of the pixel in the second boundary obstacle row is the minimum longitudinal coordinate among the longitudinal coordinates of all the pixels in the boundary rows. In the traversal process, the pixels traversed by the control unit inside the robot are not necessarily included in the working area of the robot. In some embodiments, the area defined between the first boundary obstacle row and the second boundary obstacle row is far enough to accommodate a sufficient number of empty areas between the first effective row boundary and the second effective row boundary, so that the robot can traverse more effective working areas in the corresponding area. The preset boundary distance is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area. It is worth noting that when the area where the robot is located is relatively empty in the extension area in the corresponding column direction, the robot cannot search for the second boundary obstacle row in the corresponding column direction within its effective detection range, but can only search for the first boundary obstacle row in the opposite direction of the corresponding column direction. Therefore, the traversal can only start from the first boundary obstacle row and proceed in the column direction from the first boundary obstacle row to the second boundary obstacle row.
[0055] As an example two, when the number of obstacle pixels included in the first boundary obstacle row is less than the number of obstacle pixels included in the second boundary obstacle row, or when the robot searches the second boundary obstacle row but does not search the first boundary obstacle row in the preconfigured map area, the control unit inside the robot traverses a column preset boundary distance along the corresponding column direction starting from the second boundary obstacle row, which can be understood as traversing the column preset boundary distance along the second column direction, to obtain a row boundary, and the pixel points of the row boundary are at a distance equal to the column preset boundary distance from the corresponding pixel points of the second boundary obstacle row in each column (corresponding column direction); then the second boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary. It should be noted that the second boundary obstacle row and the second effective row boundary can both be represented by a straight line, which is represented by a longitudinal coordinate value in the preconfigured map area; wherein the second column direction is opposite to the first column direction, and both are perpendicular to the column direction. Preferably, the specific source of the corresponding column direction is that in the coordinate system corresponding to the preconfigured map area, the longitudinal coordinates of all pixel points in the second boundary obstacle row are equal, and when the longitudinal coordinate of the pixel point in the second boundary obstacle row is the minimum longitudinal coordinate among the longitudinal coordinates of all pixel points in the obstacle rows, the second boundary obstacle row is close to the lowermost edge of the preconfigured map area, and in order to more completely traverse the preconfigured map area, the corresponding column direction is the positive direction of the longitudinal coordinate axis, and if the first boundary obstacle row is searched in advance, the corresponding column direction is the direction from the second boundary obstacle row to the first boundary obstacle row, wherein the longitudinal coordinate of the pixel point in the first boundary obstacle row is the maximum longitudinal coordinate among the longitudinal coordinates of all pixel points in the obstacle rows. In the traversal process, the pixel points traversed by the control unit inside the robot are not necessarily all included in the robot working area; the column direction from the second boundary obstacle row to the first boundary obstacle row is perpendicular to the first boundary obstacle row or the second boundary obstacle row, and in some examples, the area defined between the first boundary obstacle row and the second boundary obstacle row is far enough to accommodate a sufficient number of empty areas, so that the robot moves in the area defined by the corresponding row boundary line through more effective working areas. The column preset boundary distance is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area. It is worth noting that when the area where the robot is located is relatively empty in the extension area in the corresponding column direction, the robot does not search the first boundary obstacle row in its effective detection range along the corresponding column direction.
[0056] From the above embodiments, it can be seen that the number of obstacle pixels included in the boundary obstacle row is used to expand the column preset boundary distance along the corresponding column direction, which can be in the opposite direction of the direction in which the boundary obstacle row is searched, to obtain the first effective row boundary and the second effective row boundary, and to obtain the boundary line or the vertical coordinate information at the corresponding row position. It should be noted that the above traversal is actually an operation of detecting pixels by the robot along the column direction. Each time a pixel is detected, the count is incremented by one, and the coordinate distance from the previous pixel to the current pixel is recorded, and the previously obtained coordinate distance is accumulated to obtain the vertical distance from the first boundary obstacle row to the current pixel (the distance between the current pixel and the pixel of the first boundary obstacle row in a column direction), or to obtain the vertical distance from the second boundary obstacle row to the current pixel (the distance between the current pixel and the pixel of the second boundary obstacle row in a column direction). In some implementation scenarios, when the number of obstacle pixels in a pixel row of the map region meets the threshold condition, and the position of the obstacle pixel is at a certain boundary position (a position far away from the robot), it is determined that the boundary contour of the obstacle covered in the working area required to be framed by the robot is complete or regular.
[0057] As an example, the boundary obstacle column includes a first boundary obstacle column and a second boundary obstacle column. When the first boundary obstacle column includes a greater number of obstacle pixels than the second boundary obstacle column, or when the robot searches for the first boundary obstacle column but not the second boundary obstacle column in the preconfigured map area along the corresponding column direction, the control unit inside the robot traverses a preset boundary distance along the corresponding row direction from the first boundary obstacle column, which can be understood as traversing a preset boundary distance along the first row direction, to obtain a column boundary in the preconfigured map area, and the pixel of the column boundary is a distance equal to the preset boundary distance from the corresponding pixel of the first boundary obstacle column in each row (corresponding row direction). Then, the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary. It should be noted that the first boundary obstacle column and the first effective column boundary can both be represented by a straight line, which is represented by the horizontal coordinate value in the preconfigured map area. Preferably, the specific source of the corresponding row direction is that in the corresponding coordinate system of the preconfigured map area, the horizontal coordinates of all pixels in the first boundary obstacle column are equal, and when the horizontal coordinate of the pixel in the first boundary obstacle column is the minimum horizontal coordinate among the horizontal coordinates of all obstacle rows, the first boundary obstacle column is close to the leftmost edge of the preconfigured map area. In order to more completely traverse the preconfigured map area, the corresponding row direction is the positive direction of the horizontal coordinate axis, and the horizontal coordinate of the pixel of the second boundary obstacle column is the minimum horizontal coordinate among the horizontal coordinates of all obstacle columns. In the traversal process, the traversed pixels may not all be included in the robot working area; in some examples, the area defined between the first boundary obstacle column and the second boundary obstacle column is far enough to accommodate a sufficient number of empty areas between the first effective column boundary and the second effective column boundary, so that the robot can traverse more effective working areas in the corresponding area. The preset boundary distance is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area. It is worth noting that when the area where the robot is located is relatively empty in the corresponding column direction, the robot cannot search for the second boundary obstacle row in the corresponding column direction within its effective detection range, but can only search for the first boundary obstacle row in the opposite direction of the corresponding column direction. Therefore, the robot can only start from the first boundary obstacle column and traverse along the row direction from the first boundary obstacle column to the second boundary obstacle column.
[0058] As an embodiment four, when the number of obstacle pixels included in the first boundary obstacle column is less than the number of obstacle pixels included in the second boundary obstacle column, or when the robot searches for the second boundary obstacle column but does not search for the first boundary obstacle column in the preconfigured map area, the control unit inside the robot traverses a preset boundary distance along a corresponding row direction starting from the second boundary obstacle column, which can be understood as traversing a preset boundary distance along the second row direction to obtain a column boundary, wherein the pixel points of the column boundary are at a distance equal to the preset boundary distance from the corresponding pixel points of the second boundary obstacle column in each row (corresponding row direction); then the second boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary. It should be noted that the second boundary obstacle column and the second effective column boundary can both be represented by a straight line, which is represented by the horizontal coordinate value in the preconfigured map area. The first column direction and the second column direction are opposite and perpendicular to the row direction. Preferably, the specific source of the corresponding row direction is that in the coordinate system corresponding to the preconfigured map area, the horizontal coordinates of all pixel points in the second boundary obstacle column are equal, when the horizontal coordinate of the pixel point in the second boundary obstacle row is the maximum horizontal coordinate among the horizontal coordinates of all obstacle rows, the second boundary obstacle column is close to the rightmost edge of the preconfigured map area, in order to more completely traverse the preconfigured map area, the corresponding row direction is the negative direction of the horizontal coordinate axis, wherein the horizontal coordinate of the pixel point of the first boundary obstacle column is the minimum horizontal coordinate among the horizontal coordinates of all obstacle rows. During the traversal process, the traversed pixel points may not all be included in the robot working area; the row direction from the second boundary obstacle column to the first boundary obstacle column is perpendicular to the first boundary obstacle column or the second boundary obstacle column, and in some embodiments, the area defined between the first boundary obstacle column and the second boundary obstacle column is far enough to accommodate a sufficient number of empty areas between the first effective column boundary and the second effective column boundary, so that the robot moves through more effective working areas in the area framed by the corresponding column boundary. The preset boundary distance is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area. It is worth noting that when the area where the robot is located is relatively empty in the extension area in the corresponding column direction, the robot cannot search for the first boundary obstacle column in its effective detection range along the corresponding row direction. Therefore, the traversal can only start from the second boundary obstacle column along the row direction from the second boundary obstacle column to the first boundary obstacle column.
[0059] In combination of Embodiment Three and Embodiment Four, the first effective column boundary and the second effective column boundary are obtained according to the number of barrier pixels included in the boundary barrier column, and the row preset boundary distance is extended along the corresponding row direction, which can be extended in the direction opposite to the direction in which the boundary barrier column is searched. The boundary line or the horizontal coordinate information at the corresponding column position is obtained. It should be noted that the aforementioned traversal is actually the operation of detecting the pixel points by the robot along the row direction. Each time a pixel point is detected, the count is incremented once, and the coordinate distance from the previous pixel point to the current pixel point is recorded, and the previously obtained coordinate distance is accumulated to obtain the vertical distance from the first boundary barrier column to the current pixel point (the distance of the current pixel point from the pixel point of the first boundary barrier column in a row direction), or to obtain the vertical distance from the second boundary barrier column to the current pixel point (the distance of the current pixel point from the pixel point of the second boundary barrier column in a row direction). In some implementation scenarios, when the number of barrier pixel points in a pixel column of the map region meets the threshold condition, and the position of the barrier pixel point is at a certain boundary position (a position far away from the robot), it is determined that the boundary contour of the barrier covered in the working area required to be framed by the robot is complete or regular.
[0060] It should be noted that when the second row direction is the positive direction of the horizontal coordinate axis, the first row direction is the negative direction of the horizontal coordinate axis; or, when the second row direction is the negative direction of the horizontal coordinate axis, the first row direction is the positive direction of the horizontal coordinate axis.
[0061] As an example five, the boundary obstacle row includes a first boundary obstacle row and a second boundary obstacle row; when the number of obstacle pixels included in the first boundary obstacle row is equal to the number of obstacle pixels included in the second boundary obstacle row, the control unit inside the robot traverses a preset boundary distance in the first column direction from the first boundary obstacle row to obtain a row boundary; preferably, when the vertical coordinate of the pixel in the first boundary obstacle row is the maximum vertical coordinate among the vertical coordinates of the pixels in all the obstacle rows, the first boundary obstacle row is close to the uppermost edge of the preconfigured map area, and in order to more completely traverse the preconfigured map area, the first column direction is the negative direction of the vertical coordinate axis, wherein the vertical coordinate of the pixel in the second boundary obstacle row is the minimum vertical coordinate among the vertical coordinates of the pixels in all the obstacle rows. In this embodiment, the first boundary obstacle row and the second boundary obstacle row are both searched in advance; the pixel of the row boundary is at a distance equal to the preset column boundary distance from the corresponding pixel of the first boundary obstacle row in each column (corresponding to the column direction); then the first boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary; it should be noted that the first boundary obstacle row and the first effective row boundary can both be represented by a straight line, which is represented by a vertical coordinate value in the preconfigured map area; in some embodiments, the area defined between the first boundary obstacle row and the second boundary obstacle row is far enough to accommodate a sufficient number of empty areas between the first effective row boundary and the second effective row boundary. The preset column boundary distance is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area or the actual outline boundary size of the room area. In some embodiments, when the area where the robot is located is relatively empty in the extension area in the corresponding column direction, the robot cannot search for the second boundary obstacle row but only searches for the first boundary obstacle row in its effective detection range along the corresponding column direction, so it can only start from the first boundary obstacle row and traverse in the opposite direction of the corresponding column direction (the column direction from the first boundary obstacle row to the second boundary obstacle row). Thus, the first effective row boundary and the second effective row boundary are obtained by extending the preset column boundary distance in the corresponding column direction according to the number of obstacle pixels included in the boundary obstacle row.
[0062] As Embodiment Six, when the number of obstacle pixels included in the first boundary obstacle row is equal to the number of obstacle pixels included in the second boundary obstacle row, the control unit inside the robot traverses the column preset boundary distance along the second column direction from the second boundary obstacle row to obtain the row boundary; preferably, when the vertical coordinate of the pixel in the second boundary obstacle row is the minimum vertical coordinate among the vertical coordinates of the pixels in all the obstacle rows, the second boundary obstacle row is close to the lowermost edge of the preconfigured map area, and to more completely traverse the preconfigured map area, the second column direction is the positive direction of the vertical coordinate axis, wherein the vertical coordinate of the pixel in the first boundary obstacle row is the minimum vertical coordinate among the vertical coordinates of the pixels in all the obstacle rows. In this embodiment, the first boundary obstacle row and the second boundary obstacle row are both searched in advance; the distance between the pixel in the row boundary and the corresponding pixel in the second boundary obstacle row in each column (corresponding column direction) is equal to the column preset boundary distance; then the second boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary. It should be noted that the second boundary obstacle row and the second effective row boundary can both be represented by a straight line, which is represented by a vertical coordinate value in the preconfigured map area; in the traversal process, the pixels traversed by the control unit inside the robot are not necessarily all included in the working area of the robot; the column direction from the second boundary obstacle row to the first boundary obstacle row is perpendicular to the first boundary obstacle row or the second boundary obstacle row, and in some embodiments, the area defined between the first boundary obstacle row and the second boundary obstacle row is far enough to accommodate a sufficient number of empty areas between the first effective row boundary and the second effective row boundary. The column preset boundary distance is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area or determined by the coverage range of the profile boundary of the room area. In some embodiments, when the area where the robot is located is relatively empty in the extension area in the corresponding column direction, the robot cannot search for the first boundary obstacle row in its effective detection range along the corresponding column direction, but can only search for the second boundary obstacle row in the opposite direction of the corresponding column direction, so the traversal can only start from the second boundary obstacle row along the column direction from the second boundary obstacle row to the first boundary obstacle row. Thus, the column preset boundary distance is expanded along the corresponding column direction according to the number of obstacle pixels included in the boundary obstacle row to obtain the first effective row boundary and the second effective row boundary.
[0063] As an embodiment seven, the boundary obstacle columns include a first boundary obstacle column and a second boundary obstacle column; when the first boundary obstacle column includes the same number of obstacle pixels as the second boundary obstacle column, the control unit inside the robot traverses a preset boundary distance along a first row direction from the first boundary obstacle column to obtain a column boundary, preferably, when the horizontal coordinate of the pixel in the first boundary obstacle column is the smallest horizontal coordinate among the horizontal coordinates of all the pixels in the obstacle columns, the first boundary obstacle column is close to the leftmost edge of the preconfigured map area, and in order to more completely traverse the preconfigured map area, the first row direction is the positive direction of the horizontal coordinate axis, wherein the horizontal coordinate of the pixel in the second boundary obstacle column is the smallest horizontal coordinate among the horizontal coordinates of all the pixels in the obstacle columns. In this embodiment, the first boundary obstacle column and the second boundary obstacle column are both searched in advance; the distance between the pixel in the column boundary and the corresponding pixel in the first boundary obstacle column in each row (corresponding to the row direction) is equal to the preset boundary distance of the row; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; it should be noted that the first boundary obstacle column and the first effective column boundary can both be represented by a straight line, which is represented by a horizontal coordinate value in the preconfigured map area; in the traversal process, the pixels traversed by the first boundary obstacle column are not necessarily all included in the working area of the robot; in some embodiments, the area defined between the first boundary obstacle column and the second boundary obstacle column is far enough to accommodate a sufficient number of empty areas between the first effective column boundary and the second effective column boundary. The preset boundary distance of the row is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area. It is worth noting that when the area where the robot is located is relatively empty in the extension area in the corresponding row direction, the robot cannot search for the second boundary obstacle column in its effective detection range along the corresponding row direction, but can only search for the first boundary obstacle column, so it can only start from the first boundary obstacle column and traverse along the row direction from the first boundary obstacle column to the second boundary obstacle column.
[0064] As an embodiment eight, when the number of obstacle pixels included in the first boundary obstacle column is equal to the number of obstacle pixels included in the second boundary obstacle column, the control unit inside the robot traverses a preset boundary distance along a second row direction from the second boundary obstacle column to obtain a column boundary, preferably, when the horizontal coordinate of the pixel in the second boundary obstacle column is the maximum horizontal coordinate among the horizontal coordinates of the pixels in all the obstacle columns, the second boundary obstacle column is close to the rightmost edge of the preconfigured map area, in order to more completely traverse the preconfigured map area, the second row direction is the negative direction of the horizontal coordinate axis, wherein the horizontal coordinate of the pixel in the first boundary obstacle column is the minimum horizontal coordinate among the horizontal coordinates of the pixels in all the obstacle columns. In this embodiment, the first boundary obstacle column and the second boundary obstacle column are both searched in advance; then the robot identifies the pixel of the column boundary, which is equal to the distance between the corresponding pixel of the second boundary obstacle column in each row (corresponding to the row direction) and the preset boundary distance of the row; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary. It should be noted that the second boundary obstacle column and the second effective column boundary can both be represented by a straight line, which is represented by a horizontal coordinate value in the preconfigured map area; in the traversal process, the traversed pixels are not necessarily all included in the working area of the robot; the row direction from the second boundary obstacle column to the first boundary obstacle column is perpendicular to the first boundary obstacle column or the second boundary obstacle column, in some embodiments, the area defined between the first boundary obstacle column and the second boundary obstacle column is far enough to accommodate a sufficient number of empty areas between the first effective column boundary and the second effective column boundary. The preset boundary distance of the row is preset by the robot, which can be set according to the characteristics of the robot walking along the edge in the room area. It should be noted that when the area where the robot is located is relatively empty in the extension area in the corresponding column direction, the robot cannot search for the first boundary obstacle column in its effective detection range along the corresponding row direction, so it can only start from the second boundary obstacle column and traverse along the row direction from the second boundary obstacle column to the first boundary obstacle column.
[0065] In the embodiments 1-8, the first effective column boundary, the second effective column boundary, the third effective column boundary and the fourth effective column boundary intersect to form a rectangular region, the length of the rectangular region is equal to the row preset boundary distance, and the width of the rectangular region is equal to the column preset boundary distance. In the embodiments 1-8, according to the extension distance in the same row direction or column direction, a reasonable number of pixel rows (one row of adjacent pixel points) and pixel columns (one column of adjacent pixel points) in the preconfigured map region are selected, and the first effective column boundary, the second effective column boundary, the third effective column boundary and the fourth effective column boundary are marked to form a rectangular region, that is, the robot working region, so that the contour boundaries of the robot working region can be aligned with each other to make the room region division more reasonable and regular, and to ensure that the contour boundaries of the robot working region can frame a rectangular working region for the robot to continuously walk along the edge.
[0066] As an embodiment 9, for the scenario that the robot cannot search for the boundary obstacle column in the preconfigured map region, that is, the robot cannot search for the first boundary obstacle column and the second boundary obstacle column in the preconfigured map region, which is irrelevant to the traversal mentioned in the foregoing embodiments, but is a search operation before the traversal mentioned in the foregoing embodiments. When the robot determines that there is no boundary obstacle row in the preconfigured map region, the following steps are performed: taking the position point of the robot as an extension starting point, setting a column boundary perpendicular to the first row direction at a first preset position point located at a distance of half the row preset boundary distance from the extension starting point along the first row direction, and setting the column boundary perpendicular to the first row direction as the first effective column boundary. In some embodiments, the first preset position point can be configured as the midpoint of the first effective column boundary. Taking the position point of the robot as an extension starting point, setting a column boundary perpendicular to the second row direction at a second preset position point located at a distance of half the row preset boundary distance from the extension starting point along the second row direction, and setting the column boundary perpendicular to the second row direction as the second effective column boundary. In some embodiments, the second preset position point can be configured as the midpoint of the second effective column boundary. In this embodiment, the first row direction is opposite to the second row direction, specifically, when the second row direction is the positive direction of the horizontal coordinate axis, the first row direction is the negative direction of the horizontal coordinate axis; or, when the second row direction is the negative direction of the horizontal coordinate axis, the first row direction is the positive direction of the horizontal coordinate axis; thereby describing the local region contour feature in the X-axis direction of the preconfigured map region, which can be used as the boundary line of the first working region of the robot.
[0067] As an example ten, for the scenario that the robot fails to search the boundary obstacle row in the preconfigured map area, i.e. the robot fails to search the first boundary obstacle row and the second boundary obstacle row in the preconfigured map area, but is irrelevant to the traversal mentioned in the foregoing examples, but is a search operation before the traversal mentioned in the foregoing examples. When the robot determines that the boundary obstacle column does not exist in the preconfigured map area, there are the following steps: taking the position point of the robot as an expansion starting point, setting a row boundary perpendicular to the first column direction at a third preset position point away from the expansion starting point by half of the column preset boundary distance along the first column direction, and setting the row boundary perpendicular to the first column direction as the first effective row boundary, and in some examples, the third preset position point can be configured as the midpoint of the first effective row boundary; taking the position point of the robot as an expansion starting point, setting a row boundary perpendicular to the second column direction at a fourth preset position point away from the expansion starting point by half of the column preset boundary distance along the second column direction, and setting the row boundary perpendicular to the second column direction as the second effective row boundary, and in some examples, the fourth preset position point can be configured as the midpoint of the second effective row boundary; wherein the first column direction is opposite to the second column direction, specifically, when the second column direction is the positive direction of the longitudinal coordinate axis, the first column direction is the negative direction of the longitudinal coordinate axis; or, when the second column direction is the negative direction of the longitudinal coordinate axis, the first column direction is the positive direction of the longitudinal coordinate axis; so as to describe the local area contour feature of the Y axis direction of the preconfigured map area, which can be used as the boundary line of the first working area of the robot.
[0068] In the foregoing examples, the second boundary obstacle row is divided into a second boundary obstacle row segment by the first effective column boundary and the second effective column boundary, wherein the length of the second boundary obstacle row segment is equal to the row preset boundary distance. And / or the first boundary obstacle row is divided into a first boundary obstacle row segment by the first effective column boundary and the second effective column boundary, wherein the length of the first boundary obstacle row segment is equal to the row preset boundary distance; and / or the first boundary obstacle column is divided into a first boundary obstacle column segment by the first effective row boundary and the second effective row boundary, wherein the length of the first boundary obstacle column is equal to the column preset boundary distance. And / or the second boundary obstacle column is divided into a second boundary obstacle column segment by the first effective row boundary and the second effective row boundary, wherein the length of the second boundary obstacle column is equal to the column preset boundary distance. Corresponding to Figure 4 In the foregoing examples, the second boundary obstacle row is divided into a second boundary obstacle row segment by the first effective column boundary and the second effective column boundary, wherein the length of the second boundary obstacle row segment is equal to the row preset boundary distance. And / or the first boundary obstacle row is divided into a first boundary obstacle row segment by the first effective column boundary and the second effective column boundary, wherein the length of the first boundary obstacle row segment is equal to the row preset boundary distance; and / or the first boundary obstacle column is divided into a first boundary obstacle column segment by the first effective row boundary and the second effective row boundary, wherein the length of the first boundary obstacle column is equal to the column preset boundary distance. And / or the second boundary obstacle column is divided into a second boundary obstacle column segment by the first effective row boundary and the second effective row boundary, wherein the length of the second boundary obstacle column is equal to the column preset boundary distance. Corresponding to Figure 3 and Figure 4The line segment AB and the line segment CD are in the same boundary obstacle row, the line segment EF and the line segment MN are in the same boundary obstacle column, and the line segment AB, the line segment CD, the line segment EF and the line segment MN are line segments sequentially connected by obstacle pixel points. Thus, a regular and reasonable rectangular area is enclosed by the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary.
[0069] As an embodiment, the method for counting the number of obstacle pixel points in the preconfigured map area row by row and column by column includes that the robot performs image processing on the preconfigured map area, i.e., processing the map area shown in FIG. 1 into the map area shown in FIG. 2. Figure 2 As an embodiment, the method for counting the number of obstacle pixel points in the preconfigured map area row by row and column by column includes that the robot performs image processing on the preconfigured map area, i.e., processing the map area shown in FIG. 1 into the map area shown in FIG. 2. Figure 3 As an embodiment, the method for counting the number of obstacle pixel points in the preconfigured map area row by row and column by column includes that the robot performs image processing on the preconfigured map area, i.e., processing the map area shown in FIG. 1 into the map area shown in FIG. 2. Figure 3 As an embodiment, the method for counting the number of obstacle pixel points in the preconfigured map area row by row and column by column includes that the robot performs image processing on the preconfigured map area, i.e., processing the map area shown in FIG. 1 into the map area shown in FIG. 2. Figure 3 As an embodiment, the method for counting the number of obstacle pixel points in the preconfigured map area row by row and column by column includes that the robot performs image processing on the preconfigured map area, i.e., processing the map area shown in FIG. 1 into the map area shown in FIG. 2.
[0070] As an embodiment, the method of marking the boundary obstacle row by counting the number of obstacle pixels in the preconfigured map region row by row specifically comprises that, when the robot is in the preconfigured map region after image processing, if the number of obstacle pixels in a row is greater than the row number threshold, the robot marks the row as an obstacle row; then the robot continues to traverse the remaining pixels in the row or directly changes the row to continue to traverse. When the robot traverses a row of pixels or marks an obstacle row, the robot continues to traverse the next row of pixels. This process is repeated until all rows in the preconfigured map region after image processing are traversed, including traversing all pixels in the preconfigured map region after image processing along the column direction, or not traversing all rows in the preconfigured map region after image processing but having marked all obstacle rows. Then, the two obstacle rows with the maximum straight-line distance in the column direction are marked as boundary obstacle rows; wherein the row number threshold is a preset multiple of the straight-line length of the preconfigured map region in the row direction; the preset multiple is greater than 0 and less than 1, and is associated with the size of the obstacle as the region boundary; preferably, the preset multiple is 0.1. The row number threshold is used to represent the minimum length of the line segment formed by the obstacle pixels of the preset obstacle distributed along the row direction in the preconfigured map region, so that when the number of obstacle pixels in a row is greater than the row number threshold, the row can be identified as a boundary of the robot working area formed by the pixels in the row, wherein the preset obstacle is a relatively long obstacle, which can be a continuous obstacle, such as a wall or the two ends of a wall gap, the gap can be a door opening, the obstacles on both sides of the door opening are the four walls in the same room, and the four walls are continuous and integral, not isolated obstacles.
[0071] It should be noted that the column direction is the longitudinal coordinate axis direction of the preconfigured map region, and the row direction is the transverse coordinate axis direction of the preconfigured map region; in the preconfigured map region, when two boundary obstacle rows are marked in the embodiment, the longitudinal coordinate of the pixel points of one of the two boundary obstacle rows is the maximum longitudinal coordinate among the longitudinal coordinates of the pixel points of all obstacle rows, and the longitudinal coordinate of the pixel points of the other boundary obstacle row is the minimum longitudinal coordinate among the longitudinal coordinates of the pixel points of all obstacle rows; wherein the longitudinal coordinates of all pixel points in each obstacle row are equal; wherein the row number threshold is a preset multiple of the length of the preconfigured map region in the transverse coordinate axis direction. In summary, the embodiment can obtain the two uppermost and lowermost obstacle rows along the column direction in the preconfigured map region, extract the two boundary obstacle rows that are the most marginal, and cover the relatively complete or regular contour line of the obstacle farthest from the robot position point between the two boundary obstacle rows, so that the first working area constructed by the robot covers more open areas along the column direction, thereby simplifying the path planning mode of the robot.
[0072] As an embodiment of traversing the pixels row by row, the pixels in the preconfigured map region processed by image are traversed row by row along the first column direction, which is optionally from top to bottom starting from the top edge of the preconfigured map region, and the first column direction is the negative direction of the longitudinal coordinate axis of the preconfigured map region. Whenever the number of obstacle pixels in a row of pixels is greater than the row number threshold, the row is marked as an obstacle row. Whenever a row of pixels is traversed or whenever an obstacle row is marked, the next row of pixels is continued to be traversed along the first column direction. This is repeated, and if an obstacle row is detected, the obstacle row farthest from the position point of the robot in the vertical direction is marked as the first boundary obstacle row. In Figure 3 , the lengths of the line segments AB and CD are obviously greater than the discrete black line segments below them, and they are far from the position point O of the robot in the column direction in the preconfigured map region, so the row in which the line segments AB and CD are located is marked as the first boundary obstacle row in the preconfigured map region shown in Figure 3 . If no obstacle row is detected along the first column direction, it is determined that the first boundary obstacle row cannot be found by the robot, at which time the robot has traversed all the pixels in the preconfigured map region processed by image. The position point O is the position point of the robot.
[0073] It should be noted that when the second column direction is the positive direction of the longitudinal coordinate axis, the first column direction is the negative direction of the longitudinal coordinate axis, or when the second column direction is the negative direction of the longitudinal coordinate axis, the first column direction is the positive direction of the longitudinal coordinate axis. The longitudinal coordinates of all pixels in each obstacle row are equal. The row number threshold is a preset multiple of the length of the preconfigured map region in the horizontal coordinate axis direction. Preferably, the preset multiple is 0.1.
[0074] As another embodiment of traversing the pixels row by row, the pixels in the preconfigured map region processed by image are traversed row by row along the second column direction, which is optionally from bottom to top starting from the bottom edge of the preconfigured map region, and the second column direction is the positive direction of the longitudinal coordinate axis of the preconfigured map region. Whenever the number of obstacle pixels in a row of pixels is greater than the row number threshold, the row is marked as an obstacle row. Whenever a row of pixels is traversed or whenever an obstacle row is marked, the next row of pixels is continued to be traversed along the second column direction. This is repeated, and if an obstacle row is detected, the obstacle row farthest from the position point of the robot is marked as the second boundary obstacle row. If no obstacle row is detected along the second column direction, it is determined that the second boundary obstacle row cannot be found by the robot, at which time the robot has traversed all the pixels in the preconfigured map region processed by image.
[0075] In summary, according to the pixel point quantity information representing the obstacles in the map constructed by the robot, the boundary obstacle row farthest from the edge is extracted in the specific map region, and the lateral boundary of the robot working region in the map region is framed, so as to walk along the edge of the contour of the obstacle as far as possible, and also make the first working region constructed by the robot cover more open areas along the corresponding column direction, so as to simplify the path planning mode of the robot.
[0076] As an embodiment, the method of obtaining the boundary obstacle column by counting the number of obstacle pixels in the preconfigured map region by column specifically includes that, when the robot is in the preconfigured map region after image processing, if the number of obstacle pixels existing in a column of pixel points is greater than the column quantity threshold value, the column is marked as an obstacle column; when a column of pixel points is traversed or when an obstacle column is marked, the pixel points in the next column are continued to be traversed; the counting is repeated in this way until all columns in the preconfigured map region after image processing are traversed, including all pixel points in the preconfigured map region after image processing are traversed along the row direction, or all obstacle columns are marked without traversing all columns of pixel points in the preconfigured map region after image processing. Then, the two obstacle columns with the maximum straight line distance in the row direction are marked as boundary obstacle columns; wherein, the column quantity threshold value is a preset multiple of the straight line length occupied by the preconfigured map region in the column direction; the preset multiple is greater than 0 and less than 1, and preferably, the preset multiple is 0.1. The column quantity threshold value is used to represent the minimum length of the line segment formed by the obstacle pixels of the preset obstacle distributed along the column direction in the preconfigured map region, so that when the number of obstacle pixels existing in a column of pixel points is greater than the column quantity threshold value, the column of pixel points can be identified as being able to form the boundary of the robot working region. The preset obstacle is a relatively long obstacle, which can be a continuous obstacle, such as a wall or two ends of a wall gap. The gap can be a door opening, and the obstacles on both sides of the door opening are the four walls in the same room, which are continuous and integral and do not belong to isolated obstacles.
[0077] It should be noted that the row direction is the horizontal coordinate axis direction of the preconfigured map area, and in the case of marking two boundary obstacle columns in the embodiment, the horizontal coordinate of the pixel point of one of the two boundary obstacle columns is the maximum horizontal coordinate among the horizontal coordinates of the pixel points of all the obstacle columns, and the horizontal coordinate of the pixel point of the other boundary obstacle column is the minimum horizontal coordinate among the horizontal coordinates of the pixel points of all the obstacle columns; wherein the horizontal coordinates of all the pixel points in each obstacle column are equal; wherein the column quantity threshold is a preset multiple of the width of the preconfigured map area in the vertical coordinate axis direction. In summary, the embodiment can obtain the leftmost and rightmost two obstacle columns in the preconfigured map area along the row direction, extract the two boundary obstacle columns that are the most edge, and cover the relatively complete or regular contour line of the obstacle farthest from the position point of the robot between the two boundary obstacle columns, so that the first working area constructed by the robot covers more open areas along the corresponding row direction, thereby simplifying the path planning mode of the robot.
[0078] As an embodiment of traversing the pixel points column by column, the pixel points in the preconfigured map area processed by the image are traversed row by row along the first row direction, and the traversal is optional from the leftmost boundary of the preconfigured map area to the right. The first row direction is the positive direction of the horizontal coordinate axis of the preconfigured map area. Whenever the number of obstacle pixel points existing in a column of pixel points is greater than the column quantity threshold, the column is marked as an obstacle column; whenever a column of pixel points is traversed or whenever an obstacle column is marked, the next column of pixel points is continuously traversed along the first row direction; and the process is repeated. If an obstacle column is detected, the obstacle column farthest from the vertical distance of the position point of the robot is marked as the first boundary obstacle column; if no obstacle column is detected along the first row direction, it is determined that the robot cannot search for the first boundary obstacle column. Figure 3 In the preconfigured map area shown in FIG. 17, the lengths of the line segments EF and MN are obviously greater than those of the discrete black line segments on the left, and the line segments EF and MN are far from the position point O of the robot in the row direction in the preconfigured map area, so the column in which the line segments EF and MN are located is marked as the first boundary obstacle column in the preconfigured map area shown in FIG. 17. Figure 3
[0079] It should be noted that the second column direction is the positive direction of the vertical coordinate axis, and the first column direction is the negative direction of the vertical coordinate axis; or the second column direction is the negative direction of the vertical coordinate axis, and the first column direction is the positive direction of the vertical coordinate axis; wherein the vertical coordinates of all the pixel points in each obstacle row are equal; wherein the row quantity threshold is a preset multiple of the length of the preconfigured map area in the horizontal coordinate axis direction. Preferably, the preset multiple is 0.1.
[0080] As another embodiment of traversing the pixel points column by column, the pixel points in the preconfigured map region processed by the image are traversed row by row along a second row direction, which is a negative direction of the horizontal coordinate axis of the preconfigured map region, and optionally, the traversal starts from the rightmost boundary of the preconfigured map region. Whenever the number of obstacle pixel points in a column of pixel points is greater than the column number threshold, the column is marked as an obstacle column. Whenever a column of pixel points is traversed or whenever an obstacle column is marked, the next column of pixel points is traversed along the second row direction. This is repeated. If an obstacle column is detected, the obstacle column farthest from the position point of the robot is marked as a second boundary obstacle column. If no obstacle column is detected along the second row direction, it is determined that the robot cannot find the second boundary obstacle column, and the robot has traversed all the pixel points in the preconfigured map region processed by the image.
[0081] In summary, according to the embodiment of traversing the pixel points column by column, the boundary obstacle column farthest from the edge is extracted in a specific map region according to the number information of the pixel points representing obstacles in the map constructed by the robot, and the longitudinal boundary of the working region of the robot in the map region is framed, so as to perform edge following along the contour of the obstacle as far as possible, and also to make the first working region constructed by the robot cover more open areas along the corresponding row direction, so as to simplify the path planning mode of the robot.
[0082] Preferably, the position point of the robot is located inside the preconfigured map region, for example, Figure 4 As shown, the position point of the robot is located in the robot working region PQRS which has been framed. Specifically, among all the marked obstacle rows, the boundary obstacle row is the obstacle row farthest from the position point of the robot in the corresponding column direction. Among all the marked obstacle columns, the boundary obstacle column is the obstacle column farthest from the position point of the robot in the corresponding row direction. Thus, the two uppermost and lowermost obstacle rows and the two leftmost and rightmost obstacle columns are obtained in the same map region.
[0083] Preferably, the preconfigured map region is a map region with the position point of the robot as the center of symmetry; and the preconfigured map region is a rectangular region. In this way, the region expansion in different coordinate axis directions (including the row direction and the column direction) is performed from the position point of the robot as the expansion starting point until the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary are respectively reached, and a regular and reasonable rectangular region is enclosed by the intersection, and the robot can navigate to the first effective row boundary, the second effective row boundary, the first effective column boundary or the second effective column boundary from the center of symmetry of the preconfigured map region, and then perform edge following in the corresponding rectangular region, but the first effective row boundary, the second effective row boundary, the first effective column boundary or the second effective column boundary are not necessarily walls.
[0084] In the foregoing embodiments, the method for image processing of a pre-configured map region includes: performing a closing operation on the pre-configured map region to completely describe the outlines of the marked obstacles in the pre-configured map region. The closing operation is configured to be performed between steps S1 and S2. The closing operation connects connected components in the pre-configured map region; the pre-configured map region is a specific-sized image region constructed by the robot to describe the positional characteristics of the obstacles. Preferably, the pre-configured map region can be a 3.5m x 3.5m rectangular region symmetrically centered on the robot's position point, and is a local map region extracted from a pre-constructed global map by the robot.
[0085] Specifically, the closing operation includes: the robot first binarizing the pre-configured map region to obtain a binarized map; then performing image dilation on the binarized map; and then performing image erosion on the binarized map after image dilation, so that some pixels representing non-obstacles are configured as pixels representing obstacles, thereby filling the gaps in the outlines of obstacles in the binarized map that has not undergone image dilation and image erosion. Figure 2 The set of discrete points between pixel A and pixel B becomes after the closing operation. Figure 3 line segment AB, Figure 2 The set of discrete points between pixels C and D becomes after the closing operation. Figure 3 line segment CD, Figure 2 The set of discrete points between pixels E and F becomes after the closing operation. Figure 3 line segment EF, Figure 2 The set of discrete points between pixels M and N becomes after the closing operation. Figure 3 The line segment MN is defined. In the binarized map, the pixel values representing obstacles and the pixel values representing non-obstacles are different. Generally, pixels with a value of 255 are configured as obstacles, and pixels with a value of 0 are configured as non-obstacles. Because the same obstacle that was originally connected may be divided into multiple segments in the binarized map, possibly due to instability in the pre-built map by the robot or unstable laser data, causing the map to fail to reflect reality; this embodiment repairs the missing parts between the same obstacles through the aforementioned closing operation.
[0086] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a product of "tangible" fabrication, or it can be a "transitory" propagation signal. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electronic connection having one or more wires (electronic devices), a portable computer diskette (magnetic devices), a random-access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber (optical devices), and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and stored in a computer memory.
[0087] In the above embodiments, the robot capable of performing the sweeping task (referred to as a sweeping robot for short) is taken as an example to illustrate the technical solutions of the present application, but the present application is not limited to the sweeping robot. The robot in the embodiments of the present application refers to any mechanical device capable of highly autonomously moving in the environment where the robot is located, for example, can be a sweeping robot, a companion robot, a guiding robot, or the like, and can also be a purifier, an unmanned vehicle, or the like. Of course, for different robot forms, the work tasks performed by the robots will also be different, and no limitation is made in this regard.
[0088] It is to be understood that the work area planning method described herein corresponds to an embodiment that can be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof, in a stationary state of the robot. For a 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, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof. When the 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.
[0089] On the basis of the foregoing embodiment, another embodiment of the present application further discloses a chip, which is internally provided with a control program for controlling a robot to perform the work area planning method described in the foregoing embodiment. The chip extracts, according to the number information of the pixel points representing obstacles in the map constructed by the robot, the boundary obstacle rows and the boundary obstacle columns that are most edge and intersect with each other in a specific map area, frames a robot work area as an optimal work area of the robot in the corresponding work environment, so that the planning of the first work area according to the number of the pixel points representing obstacles in each row and each column and the distance information from the position point of the robot makes the contour line of the obstacles framed in the first work area as complete or regular as possible, which not only simplifies the planning of the work path of the indoor work area, but also enables the robot to traverse as many open areas as possible at the farthest distance, so that the robot moves to more effective work areas in the first work area.
[0090] It should be understood that the work area planning method described in the present application corresponds to an embodiment that can be realized by hardware, software, firmware, middleware, microcode or any combination thereof. For the hardware implementation, the processing unit can be realized in 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 a combination thereof. When the embodiment is realized by software, firmware, middleware or microcode, program code or code segments, they can be stored in a machine-readable medium such as a storage component.
[0091] Another embodiment of the present application further discloses a robot, the top of the body of which can be equipped with a laser sensor supporting 360-degree detection, and the robot is internally provided with the chip described in the foregoing embodiment, which is used to count the number of obstacle pixel points in each row and each column in the preconfigured map area in the map constructed by the robot, and then expand the work area of the robot according to the number of obstacle pixel points in the corresponding row and the number of obstacle pixel points in the corresponding column to obtain an optimal work area of the robot in the corresponding work environment. The specific planning method is described in the foregoing embodiment and will not be described here. Generally, according to the implementation requirements of edge navigation, the robot can be equipped with multiple laser radars and visual sensors arranged at different positions to achieve the purpose of obtaining the obstacle point cloud data around the body. Among them, the laser sensor supports real-time scanning and constructing a laser map, which is stored in the chip internally provided in the robot.
[0092] The above examples are only for illustrating the technical concept and characteristics of the present application, and the purpose is to enable the skilled in the art to understand the content of the present application and to implement it, and cannot limit the protection scope of the present application. Any equivalent transformation or modification made according to the spirit and essence of the present application shall be covered within the protection scope of the present application.
Claims
1. A pixel-based work area planning method, characterized by, The work area planning method comprises: In the map constructed by the robot, the number of obstacle pixel points in the preconfigured map area is counted row by row and column by column; According to the number of obstacle pixel points in the corresponding row and the number of obstacle pixel points in the corresponding column, the robot work area is expanded; The method for counting the number of obstacle pixel points in the preconfigured map area row by row and column by column comprises: image processing is performed on the preconfigured map area; In the preconfigured map area after image processing, obstacle pixel points and non-obstacle pixel points are marked, wherein the obstacle pixel points are pixel points for indicating obstacles in the preconfigured map area, and the non-obstacle pixel points are pixel points for indicating non-obstacles in the preconfigured map area; The number of obstacle pixel points in the preconfigured map area is counted row by row to mark the boundary obstacle row; The number of obstacle pixel points in the preconfigured map area is counted column by column to mark the boundary obstacle column.
2. The work area planning method according to claim 1, characterized in that, The method for expanding the robot work area according to the number of obstacle pixel points in the corresponding row and the number of obstacle pixel points in the corresponding column comprises: In the preconfigured map area, according to the number of obstacle pixel points included in the boundary obstacle row, a column preset boundary distance is expanded along the corresponding column direction to obtain a first effective row boundary and a second effective row boundary; wherein the first effective row boundary and the second effective row boundary respectively belong to a corresponding row of pixel points of the preconfigured map area; In the preconfigured map area, according to the number of obstacle pixel points included in the boundary obstacle column, a row preset boundary distance is expanded along the corresponding row direction to obtain a first effective column boundary and a second effective column boundary; wherein the first effective column boundary and the second effective column boundary respectively belong to a corresponding column of pixel points of the preconfigured map area; Then, the area surrounded by the first effective row boundary, the second effective row boundary, the first effective column boundary and the second effective column boundary is set as the robot work area.
3. The work area planning method according to claim 2, wherein The boundary obstacle row comprises a first boundary obstacle row and a second boundary obstacle row; When the number of obstacle pixel points included in the first boundary obstacle row is greater than the number of obstacle pixel points included in the second boundary obstacle row, or the robot searches for the first boundary obstacle row but not the second boundary obstacle row in the preconfigured map area, a row boundary is obtained by traversing a column preset boundary distance along a first column direction from the first boundary obstacle row; then the first boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary; When the number of obstacle pixel points included in the first boundary obstacle row is less than the number of obstacle pixel points included in the second boundary obstacle row, or the robot searches for the second boundary obstacle row but not the first boundary obstacle row in the preconfigured map area, a row boundary is obtained by traversing a column preset boundary distance along a second column direction from the second boundary obstacle row; then the second boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary; The first column direction is opposite to the second column direction.
4. The work area planning method according to claim 2, wherein The boundary obstacle column comprises a first boundary obstacle column and a second boundary obstacle column; When the number of obstacle pixel points included in the first boundary obstacle column is greater than the number of obstacle pixel points included in the second boundary obstacle column, or the robot searches for the first boundary obstacle column but fails to search for the second boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in the row direction from the first boundary obstacle column; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary; When the number of obstacle pixel points included in the first boundary obstacle column is less than the number of obstacle pixel points included in the second boundary obstacle column, or the robot searches for the second boundary obstacle column but fails to search for the first boundary obstacle column in the preconfigured map area, a column boundary is obtained by traversing a preset boundary distance in the row direction from the second boundary obstacle column; then the second boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary. The first row direction is opposite to the second row direction.
5. The work area planning method according to claim 2, characterized by, The boundary obstacle row includes a first boundary obstacle row and a second boundary obstacle row. When the number of obstacle pixel points included in the first boundary obstacle row is equal to the number of obstacle pixel points included in the second boundary obstacle row, a row boundary is obtained by traversing a preset boundary distance in the column direction from the first boundary obstacle row; then the first boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary. When the number of obstacle pixel points included in the first boundary obstacle row is equal to the number of obstacle pixel points included in the second boundary obstacle row, a row boundary is obtained by traversing a preset boundary distance in the column direction from the second boundary obstacle row; then the second boundary obstacle row is set as the first effective row boundary, and the row boundary is set as the second effective row boundary. The first column direction is opposite to the second column direction.
6. The work area planning method according to claim 2, wherein The boundary obstacle column includes a first boundary obstacle column and a second boundary obstacle column. When the number of obstacle pixel points included in the first boundary obstacle column is equal to the number of obstacle pixel points included in the second boundary obstacle column, a column boundary is obtained by traversing a preset boundary distance in the row direction from the first boundary obstacle column; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary. When the number of obstacle pixel points included in the first boundary obstacle column is equal to the number of obstacle pixel points included in the second boundary obstacle column, a column boundary is obtained by traversing a preset boundary distance in the row direction from the second boundary obstacle column; then the first boundary obstacle column is set as the first effective column boundary, and the column boundary is set as the second effective column boundary. The first row direction is opposite to the second row direction.
7. The work area planning method according to claim 2, wherein When the robot fails to search for the boundary obstacle column in the preconfigured map area, the following steps exist: A column boundary perpendicular to the first row direction is set at a first preset position point at a half of the preset boundary distance in the row direction from the expansion starting point, and the column boundary perpendicular to the first row direction is set as the first effective column boundary. The second preset position point is located at a half of the row preset boundary distance from the extension starting point along the second row direction, a column boundary perpendicular to the second row direction is set, and the column boundary perpendicular to the second row direction is set as the second effective column boundary; The first row direction is opposite to the second row direction.
8. The work area planning method according to claim 2, wherein When the robot fails to search for the boundary obstacle row in the preconfigured map region, the following steps are included: The third preset position point is located at a half of the column preset boundary distance from the extension starting point along the first column direction, a row boundary perpendicular to the first column direction is set, and the row boundary perpendicular to the first column direction is set as the first effective row boundary; The fourth preset position point is located at a half of the column preset boundary distance from the extension starting point along the second column direction, a row boundary perpendicular to the second column direction is set, and the row boundary perpendicular to the second column direction is set as the second effective row boundary; The first column direction is opposite to the second column direction.
9. The work area planning method according to any one of claims 3 to 8, characterized in that, The second boundary obstacle row is divided into a second boundary obstacle row segment by the first effective column boundary and the second effective column boundary, and a length of the second boundary obstacle row segment is equal to the row preset boundary distance; The first boundary obstacle row is divided into a first boundary obstacle row segment by the first effective column boundary and the second effective column boundary, and a length of the first boundary obstacle row segment is equal to the row preset boundary distance; The first boundary obstacle column is divided into a first boundary obstacle column segment by the first effective row boundary and the second effective row boundary, and a length of the first boundary obstacle column is equal to the column preset boundary distance; The second boundary obstacle column is divided into a second boundary obstacle column segment by the first effective row boundary and the second effective row boundary, and a length of the second boundary obstacle column is equal to the column preset boundary distance.
10. The method of claim 3 to 8, wherein The method for marking the boundary obstacle row by counting the number of obstacle pixel points in the preconfigured map region row by row specifically includes: When the number of obstacle pixel points existing in a row of pixel points is greater than a row number threshold value in the preconfigured map region after image processing, the row is marked as an obstacle row; When a row of pixel points is traversed or an obstacle row is marked, the next row of pixel points is continuously traversed; the process is repeated until all rows in the preconfigured map region after image processing are traversed, and then the two obstacle rows with the maximum straight-line distance in the column direction are both marked as boundary obstacle rows; The row number threshold value is a preset multiple of the straight-line length occupied by the preconfigured map region in the row direction; the preset multiple is greater than 0 and less than 1.
11. The work area planning method according to claim 10, wherein The column direction is the longitudinal coordinate axis direction of the preconfigured map region, and the row direction is the transverse coordinate axis direction of the preconfigured map region; In the preconfigured map region, two boundary obstacle rows are marked, a pixel point of one boundary obstacle row is the maximum longitudinal coordinate among the pixel points of all obstacle rows, and a pixel point of the other boundary obstacle row is the minimum longitudinal coordinate among the pixel points of all obstacle rows; The longitudinal coordinates of all pixel points in each obstacle row are equal. The row quantity threshold is a preset multiple of the length of the preconfigured map region in the horizontal coordinate axis direction.
12. The work area planning method according to claim 11, wherein The pixel points in the preconfigured map region are traversed row by row along the first column direction, and each time the number of obstacle pixel points in a row is greater than the row quantity threshold, the row is marked as an obstacle row; each time a row of pixel points is traversed or an obstacle row is marked, the next row of pixel points is traversed along the first column direction; this is repeated, and if an obstacle row is detected, the obstacle row farthest from the position point of the robot is marked as a first boundary obstacle row; if no obstacle row is detected, it is determined that the first boundary obstacle row cannot be searched by the robot. The pixel points in the preconfigured map region are traversed row by row along the second column direction, and each time the number of obstacle pixel points in a row is greater than the row quantity threshold, the row is marked as an obstacle row; each time a row of pixel points is traversed or an obstacle row is marked, the next row of pixel points is traversed along the second column direction; this is repeated, and if an obstacle row is detected, the obstacle row farthest from the position point of the robot is marked as a second boundary obstacle row; if no obstacle row is detected, it is determined that the second boundary obstacle row cannot be searched by the robot. The first column direction is opposite to the second column direction. The first boundary obstacle row and the second boundary obstacle row both belong to the boundary obstacle row.
13. The work area planning method according to claim 12, wherein, When the second column direction is the positive direction of the vertical coordinate axis, the first column direction is the negative direction of the vertical coordinate axis; or, when the second column direction is the negative direction of the vertical coordinate axis, the first column direction is the positive direction of the vertical coordinate axis.
14. The work area planning method of claim 10, wherein, The method for marking the boundary obstacle column by counting the number of obstacle pixel points in the preconfigured map region column by column specifically includes: In the preconfigured map region after image processing, each time the number of obstacle pixel points in a column is greater than the column quantity threshold, the column is marked as an obstacle column; each time a column of pixel points is traversed or an obstacle column is marked, the next column of pixel points is traversed; this is repeated until all columns in the preconfigured map region after image processing are traversed, and then the two obstacle columns with the maximum straight-line distance in the row direction are both marked as boundary obstacle columns; The column quantity threshold is a preset multiple of the straight-line length occupied by the preconfigured map region in the column direction; the preset multiple is greater than 0 and less than 1.
15. The method of claim 14, wherein: The row direction is the horizontal coordinate axis direction of the preconfigured map region. In the preconfigured map region, two boundary obstacle columns are marked, and the horizontal coordinates of the pixel points of one of the boundary obstacle columns are the maximum horizontal coordinates among the horizontal coordinates of the pixel points of all obstacle columns, and the horizontal coordinates of the pixel points of the other boundary obstacle column are the minimum horizontal coordinates among the horizontal coordinates of the pixel points of all obstacle columns. The horizontal coordinates of all pixel points in each obstacle column are equal. The column quantity threshold is a preset multiple of the width of the preconfigured map region in the vertical coordinate axis direction.
16. The work area planning method according to claim 15, wherein The pixel points in the preconfigured map region after image processing are traversed column by column along the first row direction, and each time the number of obstacle pixel points existing in a column of pixel points is greater than the column number threshold, the column is marked as an obstacle column; each time a column of pixel points is traversed or an obstacle column is marked, the next column of pixel points is continued to be traversed along the first row direction; this is repeated, if an obstacle column is detected, the obstacle column farthest from the position point of the robot is marked as the first boundary obstacle column; if no obstacle column is detected, it is determined that the first boundary obstacle column cannot be searched by the robot. The pixel points in the preconfigured map region after image processing are traversed column by column along the second row direction, and each time the number of obstacle pixel points existing in a column of pixel points is greater than the column number threshold, the column is marked as an obstacle column; each time a column of pixel points is traversed or an obstacle column is marked, the next column of pixel points is continued to be traversed along the second row direction; this is repeated, if an obstacle column is detected, the obstacle column farthest from the position point of the robot is marked as the second boundary obstacle column; if no obstacle column is detected, it is determined that the second boundary obstacle column cannot be searched by the robot. The first row direction is opposite to the second row direction. The first boundary obstacle column and the second boundary obstacle column both belong to the boundary obstacle column.
17. The work area planning method according to claim 16, wherein When the second row direction is the positive direction of the horizontal coordinate axis, the first row direction is the negative direction of the horizontal coordinate axis; or, when the second row direction is the negative direction of the horizontal coordinate axis, the first row direction is the positive direction of the horizontal coordinate axis.
18. The work area planning method of claim 14, wherein, The position point of the robot is located inside the preconfigured map region. Among all the marked obstacle rows, the boundary obstacle row is the obstacle row farthest from the position point of the robot in the corresponding column direction. Among all the marked obstacle columns, the boundary obstacle column is the obstacle column farthest from the position point of the robot in the corresponding row direction.
19. The method of claim 18, wherein: The preconfigured map region is a map region with the position point of the robot as the center of symmetry. The preconfigured map region is a rectangular region.
20. The method of claim 3 to 8, wherein The method for image processing on the preconfigured map region comprises: performing a closing operation on the preconfigured map region, so that the outline of the marked obstacle in the preconfigured map region is completely described, wherein the closing operation is used to connect the connected domains in the preconfigured map region. The preconfigured map region is an image region of a specific size belonging to the robot and describing the position characteristics of the obstacle.
21. The method of claim 20, wherein: The closing operation comprises: The preconfigured map region is subjected to binaryzation processing to obtain a binaryzation map; then the binaryzation map is subjected to image dilation processing, and then the binaryzation map after image dilation processing is subjected to image erosion processing, so that part of the pixel points representing non-obstacles are configured as pixel points representing obstacles; In the binaryzation map, the pixel value of the pixel point representing the obstacle and the pixel value of the pixel point representing the non-obstacle are different.
22. A chip built-in control program, the control program being used to control a robot to perform the work area planning method of any one of claims 1 to 21.
23. A robot characterized by The robot is built-in with the chip of claim 22.
Citation Information
Patent Citations
Working area construction method of laser navigation robot
CN111595356A