Map processing method and device, equipment and storage medium
By processing the initial cleaning information obtained by the sweeping robot, extracting the contour inflection point coordinates and partition boundary lines of the occupied area, as well as necessary trajectory points, the map and trajectory information are simplified, the problem of data storage pressure is solved, and the information is readable and Storage efficiency.
Patent Information
- Application Number
- CN202411016946.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-29
AI Technical Summary
The amount of initial cleaning information obtained by the sweeping robot is huge, resulting in excessive pressure on data storage, and it is urgent to simplify processing to reduce the pressure on data storage.
By obtaining the initial cleaning information of the sweeping robot when performing a cleaning task in the target scene, the processing is to determine the simplified map information and trajectory information, including the set of contour inflection point coordinates and partition boundaries of the occupied area, as well as necessary trajectory point information, thereby reducing data redundancy. and store pressure.
It effectively reduces the amount of data of the initial cleaning information obtained by the sweeping robot, solves the problem of data storage pressure, and at the same time, the optimized information is more readable, and there are no problems such as puncture, boundary burrs and superposition.
Smart Images

Figure CN119033286A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of map technology, and in particular to a map processing method, device, equipment and storage medium. Background Art
[0002] A sweeper is a smart home cleaning device that automatically completes floor sweeping, vacuuming, mopping and other cleaning tasks through built-in sensors, motors and control systems. When performing cleaning tasks, the sweeper can determine the indoor home environment and the sweeper's current position (such as location and direction) and other cleaning information based on the built-in sensors of the sweeper, and draw a map based on the scanning information and display it to the user.
[0003] Normally, the amount of cleaning information is huge. For example, the cleaning information may include a raster map, multiple partitions on the raster map, cleaning trajectories, etc. Since the map is stored in the form of a raster map, as many bits as the number of pixels in the raster map need to be stored. And the cleaning trajectory may need to record all the track points of the sweeping robot in the target scene. If all this data is saved in its original form, it will take up a lot of storage space, causing pressure on data storage. Therefore, it is urgent to simplify the cleaning information to reduce the pressure on data storage. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and storage medium for map processing, which is used to solve the technical problem of a large amount of data in the initial cleaning information obtained by a sweeping robot.
[0005] In a first aspect, an embodiment of the present application provides a method for map processing, the method comprising: obtaining initial cleaning information obtained by a sweeping robot when performing a cleaning task in a target scene, the initial cleaning information comprising an initial cleaning map of the target scene and an initial cleaning trajectory of the sweeping robot when performing a cleaning task in the target scene; the initial cleaning map is at least used to reflect the occupied area of the target scene. Process the initial cleaning information to determine simplified map information and / or simplified trajectory information corresponding to the target scene; the simplified map information comprises a set of inflection point coordinates of the contour of the occupied area and n-1 partition boundary lines, the simplified trajectory information comprises information of one or more trajectory points on each necessary trajectory in the initial cleaning trajectory, and the partition boundary lines are used to divide any two adjacent partitions in the initial cleaning map, where n represents the number of partitions in the target scene, and n is an integer greater than or equal to 1.
[0006] The embodiment of the present application provides a method for map processing, after obtaining the initial cleaning information obtained by the sweeping robot when performing the cleaning task in the target scene, the contour information of the occupied area is determined according to the initial cleaning map, thereby reducing the data redundancy caused by the idle area, thereby reducing the data volume; and since the contour information of the occupied area can be represented by the inflection point coordinates, the initial cleaning map can be simplified to the inflection point coordinates of the contour information of the occupied area; secondly, since there may be n partitions in the partition map. n is an integer greater than or equal to 1, the partition boundary line can be used to divide any two adjacent partitions in the initial cleaning map, so that the storage of multiple partitions can be simplified by at least one partition boundary line, thereby effectively reducing the pressure of data storage; in addition, by extracting at least one necessary track from the initial cleaning track, and the necessary track can be represented by one or more track points, the pressure of data storage can also be reduced by the track points of each necessary track; based on this, the embodiment of the present application can simplify the initial cleaning information obtained by the sweeping robot, and obtain the simplified map information and / or simplified track information of the target scene, and the data volume of the simplified map information and / or simplified track information is less than the data volume of the initial cleaning information, thereby solving the technical problem of the large initial data volume obtained by the sweeping robot.
[0007] In a possible implementation of the present application, after obtaining the initial cleaning information obtained by the sweeping robot when performing a cleaning task in the target scene, the method provided in the embodiment of the present application also includes: performing map optimization processing on the initial cleaning map and / or performing trajectory optimization processing on the initial cleaning trajectory to obtain first cleaning information, and the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing, and boundary optimization processing; the first cleaning information includes the necessary trajectory in the initial cleaning trajectory and / or the first grid map obtained by optimizing the initial cleaning map. Display the first cleaning information. By performing map optimization processing on the initial cleaning information, problems such as penetration, boundary burrs, and superposition can be eliminated in the obtained first grid map. In addition, trajectory optimization processing on the initial cleaning trajectory can make the cleaning behavior more readable.
[0008] In a possible implementation of the present application, the initial cleaning information is processed to obtain simplified map information and / or simplified trajectory information corresponding to the target scene, including: performing map optimization processing on the initial cleaning map and / or performing trajectory optimization processing on the initial cleaning trajectory to obtain first cleaning information, wherein the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing, and boundary optimization processing; the first cleaning information includes necessary trajectories in the initial cleaning trajectory and / or a first grid map obtained by optimizing the initial cleaning map. The first cleaning information is compressed to obtain simplified map information and / or simplified trajectory information corresponding to the target scene. This solution can enable the sweeping robot to determine the simplified map information and / or simplified trajectory information corresponding to the target scene based on the optimized initial cleaning information.
[0009] In a possible implementation of the present application, the initial cleaning information is subjected to map optimization processing, including: performing the penetration optimization processing and / or the rotation processing on the initial cleaning information, and then performing the boundary optimization processing.
[0010] In a possible implementation of the present application, the performing of the penetration optimization processing on the initial cleaning map includes:
[0011] Binarizing the initial cleaned map to determine free grids in the initial cleaned map;
[0012] After the idle grid in the initial cleaning map is corroded by taking the idle grid in the foreground, a plurality of connected domains with different marks are obtained, wherein the plurality of connected domains include a penetrated area and an idle area;
[0013] Performing expansion processing on at least one of the multiple connected domains through which the initial cleaning trajectory passes, so as to restore the size of at least one of the connected domains;
[0014] The free grids and occupied grids located in the connected domain in the initial cleaning map, as well as the occupied grids adjacent to the connected domain, are retained to obtain the first grid map in the first cleaning information.
[0015] In a possible implementation of the present application, performing the rotation process on the initial cleaning map includes:
[0016] Determining a plurality of outer contour straight lines in the initial cleaning map;
[0017] Clustering the plurality of outer contour straight lines to determine the angle to be rotated according to the clustering result;
[0018] Rotating at least one turning point existing in the plurality of outer contour straight lines in the initial cleaning map according to the angle to be rotated;
[0019] After the rotation is completed, the plurality of outer contour straight lines are filled internally, and unknown grids inside the plurality of outer contour straight lines are expanded.
[0020] In a possible implementation of the present application, clustering the plurality of outer contour straight lines to determine the angle to be rotated according to the clustering result includes: clustering the plurality of outer contour straight lines in the initial cleaning map to determine a plurality of category straight lines, wherein the category straight line is a straight line obtained by fitting at least one outer contour straight line;
[0021] Based on the angle between the first category straight line and the second category straight line, the angle to be rotated is determined so that the first category straight line is parallel or perpendicular to the display boundary, the total length of at least one outer contour straight line fitted in the first category straight line is the longest, and the second category straight line is perpendicular to the first category straight line.
[0022] In a possible implementation of the present application, the inflection point coordinate set of the contour of the occupied area includes: an outer contour inflection point coordinate set and a plurality of inner contour inflection point coordinate sets of the occupied area. After obtaining the simplified map information corresponding to the target scene, the method further includes:
[0023] According to the inflection point coordinate set of the contour of the occupied area, a target grid map is drawn, wherein the outer contour of the occupied area in the target grid map is drawn by the outer contour inflection point coordinate set, the interior of the outer contour is represented by free grids, and the outer contour is represented by occupied grids; the inner contour of the occupied area is drawn by the multiple inner contour inflection point coordinate sets, and the interior of the inner contour is represented by unknown grids;
[0024] Filling the partition boundary line as unknown in the idle area represented by the idle grid in the target grid map;
[0025] Connected domain analysis is performed on the idle area, different connected domains are assigned different partition information, and idle areas in different partitions are drawn with different colors. Partition boundary lines are uniformly assigned the right side information of the boundary to obtain a partition map of the target grid map.
[0026] In a possible implementation of the present application, the initial cleaning map is subjected to boundary optimization processing, including:
[0027] Extracting the outer contour of the idle area in the initial cleaning map;
[0028] Expanding the outer contour and straightening the boundary occupied by the single-pixel obstacle surrounding the idle area;
[0029] The obstacle contour inside the outer contour is indented to restore the boundary of the internal obstacle.
[0030] In a possible implementation of the present application, the performing trajectory optimization processing on the initial cleaning trajectory includes:
[0031] Determining the coordinates of the necessary track and the coordinates of the unnecessary track in the initial cleaning track based on whether the specific behavior of the cleaning robot is effective cleaning;
[0032] The necessary trajectory of the first cleaning information is drawn according to the coordinates of the necessary trajectory and the type of the necessary trajectory.
[0033] In a second aspect, an embodiment of the present application provides a map processing device, which can implement the method in the first aspect or any possible implementation of the first aspect, and thus can also achieve the beneficial effects in the first aspect or any possible implementation of the first aspect. The map processing device can be an electronic device (for example, a sweeping robot), or it can be a device that supports an electronic device to implement the method in the first aspect or any possible implementation of the first aspect, such as a chip or control circuit used in an electronic device. The map processing device can implement the above method through software, hardware, or by executing corresponding software through hardware.
[0034] As an example, an embodiment of the present application provides a map processing device, which is a sweeping robot or a chip used in a sweeping robot, and the map processing device includes: an acquisition unit and a processing unit. The acquisition unit is used to acquire initial cleaning information obtained when the sweeping robot performs a cleaning task in a target scene, and the initial cleaning information includes an initial cleaning map of the target scene and an initial cleaning trajectory of the sweeping robot when performing a cleaning task in the target scene; the initial cleaning map is at least used to reflect the occupied area of the target scene; the processing unit is used to process the initial cleaning information to obtain simplified map information and / or simplified trajectory information corresponding to the target scene; the simplified map information includes a set of inflection point coordinates of the contour of the occupied area and n-1 partition boundary lines, the simplified trajectory information includes information on one or more trajectory points on each necessary trajectory in the initial cleaning trajectory, and the partition boundary lines are used to divide any two adjacent partitions in the initial cleaning map, and n is an integer greater than or equal to 1.
[0035] In a possible implementation of the present application, the processing unit includes an optimization module, which is used to perform map optimization processing on the initial cleaning map and / or perform trajectory optimization processing on the initial cleaning trajectory to obtain first cleaning information, and the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing and boundary optimization processing; the first cleaning information includes the necessary trajectory in the initial cleaning trajectory and / or the first grid map obtained by optimizing the initial cleaning map. A display unit is used to display the first cleaning information. By performing map optimization processing on the initial cleaning information, problems such as penetration, boundary burrs and superposition can be eliminated in the obtained first grid map. In addition, trajectory optimization processing on the initial cleaning trajectory can make the cleaning behavior more readable.
[0036] In a possible implementation of the present application, the processing unit includes an optimization module and a compression module. The optimization module is used to perform map optimization processing on the initial cleaning map and / or perform trajectory optimization processing on the initial cleaning trajectory to obtain first cleaning information, and the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing and boundary optimization processing; the first cleaning information includes the necessary trajectory in the initial cleaning trajectory and / or the first grid map obtained by optimizing the initial cleaning map. The compression module is used to compress the first cleaning information to obtain simplified map information and / or simplified trajectory information corresponding to the target scene. This solution can enable the sweeping robot to determine the simplified map information and / or simplified trajectory information corresponding to the target scene based on the optimized initial cleaning information.
[0037] In a possible implementation of the present application, the optimization module is used to perform map optimization processing on the initial cleaning information, including:
[0038] After the penetration optimization processing and / or the rotation processing are performed on the initial cleaning information, the boundary optimization processing is performed.
[0039] In a possible implementation of the present application, the optimization module, for performing a penetration optimization process on the initial cleaning map, comprises: performing a binarization process on the initial cleaning map to determine an idle grid in the initial cleaning map;
[0040] After the idle grid in the initial cleaning map is corroded by taking the idle grid in the foreground, a plurality of connected domains with different marks are obtained, wherein the plurality of connected domains include a penetrated area and an idle area;
[0041] Performing expansion processing on at least one of the multiple connected domains through which the initial cleaning trajectory passes, so as to restore the size of at least one of the connected domains;
[0042] The free grids and occupied grids located in the connected domain in the initial cleaning map, as well as the occupied grids adjacent to the connected domain, are retained to obtain the first grid map in the first cleaning information.
[0043] In a possible implementation of the present application, the optimization module is used to perform the rotation processing on the initial cleaning map, including:
[0044] Determining a plurality of outer contour straight lines in the initial cleaning map;
[0045] Clustering the plurality of outer contour straight lines to determine the angle to be rotated according to the clustering result;
[0046] Rotating at least one turning point existing in the plurality of outer contour straight lines in the initial cleaning map according to the angle to be rotated;
[0047] After the rotation is completed, the plurality of outer contour straight lines are filled internally, and unknown grids inside the plurality of outer contour straight lines are expanded.
[0048] In a possible implementation of the present application, the optimization module is used to cluster the multiple outer contour straight lines in the initial cleaning map to determine a plurality of category straight lines, where the category straight lines are straight lines obtained by fitting at least one outer contour straight line;
[0049] Based on the angle between the first category straight line and the second category straight line, the angle to be rotated is determined so that the first category straight line is parallel or perpendicular to the display boundary, the total length of at least one outer contour straight line fitted in the first category straight line is the longest, and the second category straight line is perpendicular to the first category straight line.
[0050] In a possible implementation of the present application, the inflection point coordinate set of the contour of the occupied area includes: an outer contour inflection point coordinate set and a plurality of inner contour inflection point coordinate sets of the occupied area. After obtaining the simplified map information corresponding to the target scene, the drawing unit is further used to:
[0051] According to the inflection point coordinate set of the contour of the occupied area, a target grid map is drawn, wherein the outer contour of the occupied area in the target grid map is drawn by the outer contour inflection point coordinate set, the interior of the outer contour is represented by free grids, and the outer contour is represented by occupied grids; the inner contour of the occupied area is drawn by the multiple inner contour inflection point coordinate sets, and the interior of the inner contour is represented by unknown grids;
[0052] A filling unit, configured to fill the partition boundary line as unknown in the idle area represented by the idle grid in the target grid map;
[0053] The drawing unit is also used to perform connected domain analysis on the idle area, assign different partition information to different connected domains, draw different colors on the idle areas of different partitions, and uniformly assign the partition boundary lines to the right side of the boundary to obtain the partition map of the target grid map.
[0054] In a possible implementation of the present application, the processing unit is used to perform boundary optimization processing on the initial cleaning map, including: extracting the outer contour of the idle area in the initial cleaning map;
[0055] Expanding the outer contour and straightening the boundary occupied by the single-pixel obstacle surrounding the idle area;
[0056] The obstacle contour inside the outer contour is indented to restore the boundary of the internal obstacle.
[0057] In a possible implementation of the present application, the performing trajectory optimization processing on the initial cleaning trajectory includes:
[0058] Determining the coordinates of the necessary track and the coordinates of the unnecessary track in the initial cleaning track based on whether the specific behavior of the cleaning robot is effective cleaning;
[0059] The necessary trajectory of the first cleaning information is drawn according to the coordinates of the necessary trajectory and the type of the necessary trajectory.
[0060] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed on a computer, the computer executes a map processing method as described in any possible implementation of the first aspect to the first aspect.
[0061] In a fourth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a map processing method described in the first aspect or various possible implementations of the first aspect.
[0062] In a fifth aspect, an embodiment of the present application provides a map processing device for implementing the various methods in the above-mentioned first aspect or various possible designs. The map processing device can be the above-mentioned sweeping robot, or a device including the above-mentioned sweeping robot, or a component (e.g., a chip) used in the sweeping robot.
[0063] The map processing device described in the fifth aspect includes modules and units corresponding to the above method, which can be implemented by hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0064] In a sixth aspect, an embodiment of the present application provides a map processing device, the map processing device comprising: at least one processor and a communication interface. Wherein, when the map processing device is running, the processor executes the computer execution instructions or programs stored in the map processing device, so that the map processing device performs a method as any one of the various possible designs of the first aspect above. For example, the map processing device can be a sweeping robot, or a component used in a sweeping robot. For example, the map processing device can be a receiving device, or a component used in a receiving device.
[0065] It should be understood that the map processing device described in the sixth aspect may also include: a bus and a memory, the memory being used to store codes and data. Optionally, at least one processor communication interface and the memory are coupled to each other.
[0066] In a seventh aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, the processor is used to run a computer program or instruction to implement a map processing method described in the first aspect or various possible implementations of the first aspect. The communication interface is used to communicate with other modules outside the chip.
[0067] In an eighth aspect, an embodiment of the present application provides a map processing system, comprising a sweeping robot and a terminal. The sweeping robot is communicatively connected to the terminal. The sweeping robot is used to implement a map processing method described in the first aspect or various possible implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of a map processing system provided in an embodiment of the present application;
[0069] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0070] Figure 3 A flowchart of a map processing method provided in an embodiment of the present application;
[0071] Figure 4 A schematic diagram of cleaning information provided in an embodiment of the present application;
[0072] Figure 5Another cleaning information schematic diagram provided in an embodiment of the present application;
[0073] Figure 6 A schematic diagram of the internal structure of a map processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0076] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0077] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0078] Before introducing the embodiments of the present application, the relevant terms involved in the present application are first explained as follows:
[0079] (1) Grid map: The representation of the probability occupancy map is very similar to that of the grayscale image, so the grid map construction algorithm usually outputs the occupancy probability value as the image grayscale value. The grid map can use different colors to represent the state of the area in the target scene. For example, the part close to white in the image of a certain area in the grid map indicates that the area is a free area; the gray part indicates that the area is an unknown area, that is, the area is not observed by the sensor. The part close to black indicates that the area is an occupied area, that is, there is an obstacle in the area.
[0080] (2) Piercing: This refers to the situation in which unreachable free areas may be identified outside the obstacle boundary due to sensor limitations when building a map.
[0081] (3) Binarization: In image processing, binarization is a technique that converts an image into a single image containing only two pixel values (usually black and white). This technique is often used to simplify an image, making it easier to process and analyze further. In a binary image, the two pixel values can be divided into foreground and background.
[0082] Foreground: refers to the white pixel area in the binary image. These areas represent the brighter parts of the original image, or the parts determined as important features by the algorithm. In a binary image, the foreground is usually used to represent the main processing object of the image.
[0083] Background: refers to the black pixel area in the binarized image. These areas represent the lower brightness parts of the original image, or are considered to be minor parts by the algorithm.
[0084] (4) Erosion: An operation that pushes the boundary of the foreground (the foreground usually refers to the part of the image that is different from the background, such as the white area in a binary image) inward to "erode" or "shrink" the boundary of the foreground area. In the processing of two-dimensional laser maps (such as raster maps), the erosion operation can be used to improve the quality of the map, especially to remove false information caused by sensor errors or environmental characteristics.
[0085] (5) Dilation: Changes the geometric shape of an image by increasing the thickness of the borders of objects in the image or filling narrow areas. Dilation and erosion are used together to process images to smooth image boundaries and remove small noises.
[0086] (6) Mask: As a selection area, it determines which pixels will be operated on and which will remain unchanged.
[0087] A sweeper is a smart home cleaning device that automatically completes floor sweeping, vacuuming, mopping and other cleaning tasks through built-in sensors, motors and control systems. When performing cleaning tasks, the sweeper can determine the indoor home environment and the sweeper's current position (such as location and direction) and other cleaning information based on the built-in sensors of the sweeper, and draw a map based on the scanning information and display it to the user.
[0088] Normally, the amount of data in cleaning information is huge. For example, the cleaning information may include a grid map, multiple partitions on the grid map, cleaning trajectories, etc. Since the map in the cleaning information is stored in the form of a grid map, as many bits as the number of pixels in the grid map need to be stored. For example, the size of the grid map is 600bit*600bit. And the cleaning trajectory may need to record all the track points of the sweeping robot in the target scene. If all this data is saved in its original form, it will take up a lot of storage space, causing pressure on data storage.
[0089] A solution is proposed in the related art, which is to convert the probability value of each gray value to 0-255, then further ternary, and finally encode each pixel through Huffman coding, and compress and save the map. However, this solution still retains the original map information, and the information compression is not thorough enough. Therefore, it is urgent to simplify the cleaning information to reduce the pressure of data storage.
[0090] Therefore, the embodiments of the present application provide a method, apparatus, device and storage medium for map processing, which is used to extract contour information of occupied areas in the initial cleaning map, thereby reducing data redundancy caused by idle areas, and thereby reducing the amount of data; and since the contour information of the occupied area can be represented by inflection point coordinates, the initial cleaning map can be simplified to the inflection point coordinates of the contour information of the occupied area; secondly, since there are n partitions in the partition map, n is an integer greater than or equal to 1, partition boundaries can be used to divide any two adjacent partitions in the grid map, so that the storage of multiple partitions can be simplified by the partition boundaries, thereby effectively reducing the pressure on data storage; in addition, by extracting at least one necessary trajectory from the initial cleaning trajectory, and the necessary trajectory can be represented by one or more trajectory points, the pressure on data storage can also be reduced by the trajectory points of each necessary trajectory; based on this, the embodiments of the present application can simplify the initial cleaning information obtained by the sweeping robot, solving the technical problem of the large amount of initial data obtained by the sweeping robot.
[0091] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0092] like Figure 1 As shown, Figure 1 A schematic diagram of a map processing system is provided for an embodiment of the present application. The map processing system includes: a sweeping robot 100. The sweeping robot 100 in the embodiment of the present application may also be referred to as a cleaning robot.
[0093] Exemplarily, the cleaning robot 100 is used to perform a cleaning task in a target scene and obtain initial cleaning information, which includes an initial cleaning map representing the target scene and initial trajectory information when the cleaning robot 100 performs the cleaning task in the target scene.
[0094] Exemplarily, the cleaning robot 100 is used to optimize and display the initial cleaning information. As for how to optimize the initial cleaning information, please refer to the description in the following embodiment, which will not be repeated here.
[0095] Exemplarily, the sweeping robot 100 is also used to compress the initial sweeping information or the first sweeping information obtained after optimizing the initial sweeping information to extract necessary information (e.g., the inflection point coordinate set of the contour information of the occupied area and the information of n-1 partition boundaries, one or more track points) and save it. When displaying, the sweeping track and sweeping map of the target scene are redrawn with the necessary information.
[0096] Optionally, the map processing system may further include a terminal 200 communicating with the cleaning robot 100. The terminal 200 is used to send a cleaning task to the cleaning robot 100 and to receive first cleaning information from the cleaning robot 100 and display it.
[0097] Exemplarily, the terminal 200 may be a device with a display screen, such as a mobile phone, a computer, or a tablet, or a device connected to a display screen, and the embodiments of the present application do not impose specific limitations on this.
[0098] Exemplarily, there is a communication connection between the cleaning robot 100 and the terminal 200. The communication connection may be a wired communication connection, such as an Ethernet connection, etc.; or a wireless communication connection, for example, a wireless communication connection may be a Wi-Fi (Wireless Fidelity) connection, a Bluetooth (BlueTooth, BT) connection, a Near Field Communication (NearField Communication, NFC), etc., which is not specifically limited in the embodiments of the present application.
[0099] As an example, Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. For example, Figure 1 The structures of the cleaning robot 100 and the terminal 200 can refer to the following Figure 2 Electronic equipment shown.
[0100] like Figure 2 The electronic device shown includes: a processor 201, a communication line 202, at least one communication interface ( Figure 2The communication interface 203 is used as an example for explanation).
[0101] The processor 201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0102] The communication link 202 may include a pathway to transmit information between the above-mentioned components.
[0103] The communication interface 203 is used to exchange information with other devices, for example, using any transceiver-like device to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.
[0104] Optionally, the multi-link device may further include a memory 204 .
[0105] The memory 204 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 204 may exist independently and be connected to the processor 201 through the communication line 202. The memory 204 may also be integrated with the processor 201.
[0106] The memory 204 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 201. The processor 201 is used to execute the computer-executable instructions stored in the memory 204, thereby implementing a map processing method provided in the following embodiment of the present application.
[0107] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0108] In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as Figure 2 CPU0 and CPU1 in.
[0109] In a specific implementation, as an embodiment, the multi-link device may include multiple processors, such as Figure 2 201 and processor 205 in the embodiment of the present invention. Each of these processors may be a single-core (Single-CPU) processor or a multi-core (Multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0110] In the embodiment of the present application, the specific structure of the execution subject of a method of map processing is not particularly limited in the embodiment of the present application, as long as it can communicate according to the method of map processing in the embodiment of the present application by running a program that records the code of the method of map processing in the embodiment of the present application. For example, the execution subject of the method of map processing provided in the embodiment of the present application can be a functional module in a sweeping robot that can call and execute a program, or a device for map processing in a sweeping robot, such as a chip. This application does not limit this.
[0111] The following embodiments describe a map processing method by taking a sweeping robot as an example of an execution subject.
[0112] like Figure 3 As shown, Figure 3 A flowchart of a map processing method provided by an embodiment of the present application is shown. The method can be executed by an electronic device, for example, the electronic device can be a mobile phone, a computer, a server, etc., or a sweeping robot. The following description will take the execution subject of the method as an example of a sweeping robot. The method includes:
[0113] Step 301: The sweeping robot obtains initial cleaning information obtained when the sweeping robot performs a cleaning task. The initial cleaning information includes an initial cleaning map and an initial cleaning trajectory.
[0114] Exemplarily, the sweeping robot is used to obtain initial cleaning information obtained when the sweeping robot performs a cleaning task in a target scene. For example, the target scene may be a home environment, an office area, a shopping mall, etc. The target scene may include multiple partitions, for example, the multiple partitions included in the home environment may be at least two areas of a bedroom, a study, a dining room, a living room, etc.
[0115] When performing a cleaning task, the sweeping robot determines the current position [position and direction] and the environment of the target scene based on the laser scanning results to obtain initial scanning information. The initial cleaning map includes grid map information and initial partition map. The grid map information includes occupied areas, unknown areas, and free areas of the target scene. The initial partition map includes at least one partition, which is used to describe the location of different areas (such as rooms) in the target scene (such as a home environment), and contains a partition boundary line between different partitions.
[0116] Exemplarily, the grid map information can reflect the occupied area, idle area and unknown area of the target scene. It should be explained that the grid map is composed of multiple grids. Each grid can represent the r*r area of the actual environment. The grid can include idle grids, occupied grids and unknown grids, so the idle grids in the grid map can be used to represent the idle area of the target scene, the occupied grids in the grid map can be used to represent the occupied area in the target scene, and the unknown grids in the grid map can be used to represent the unknown area in the target scene.
[0117] For example, the free area in the target scene can be an area where the robot vacuum cleaner can move freely, such as a corridor, hall, living room, and other areas without obstacles. The occupied area can be an area occupied by obstacles, walls, etc. The robot vacuum cleaner will automatically avoid it when it detects that the area ahead is an occupied area. The unknown area can be the inside of an obstacle, such as the bottom of a sofa.
[0118] Exemplarily, the partition map may include multiple partitions of the target scene on the grid map, where different partitions may be divided by partition boundaries. The partition map may obtain multiple partitions by adding an identifier to each free grid on the grid map, and grids in different partitions are represented by different identifiers. In other words, the identifier of each free grid in the partition map indicates which partition the current grid belongs to. For example, the free grid with identifier 1 is a free grid in partition 1; the free grid with identifier 2 is a free grid in partition 2; and the free grid with identifier 3 is a free grid in partition 3.
[0119] Exemplarily, the initial cleaning trajectory can be obtained based on the posture (position and direction) of the sweeping robot at each moment. The sweeping robot can record the postures at different moments, and connect the postures at adjacent moments to obtain the completed trajectory. The cleaning trajectory can be divided into necessary trajectories and non-essential trajectories based on whether the specific behavior of the sweeping robot is effective cleaning. For example, necessary trajectories: infrared edge trajectory, binocular obstacle avoidance trajectory, bow-shaped straight line trajectory, bow-shaped arc trajectory. Non-essential trajectories: escape trajectory, navigation trajectory, obstacle crossing trajectory, exploration trajectory, etc.
[0120] For example, Figure 4 The schematic diagram of initial cleaning information shown in the figure includes an initial cleaning map, which includes a grid map A and a partition map on the grid map A. The partition map includes partitions 1 to 8 as shown in the figure. Different partitions can be represented by different labels, and the labels can be intuitively referenced. Figure 4 The padding content of each area in . Figure 4 The dotted line in may represent the initial cleaning trajectory of the sweeping robot in the target area.
[0121] Optionally, the initial cleaning information may further include: binocular obstacles. Since binocular obstacles only include coordinate positions and obstacle categories, the information is less and the compressibility is not high. Therefore, when simplifying the initial cleaning information, the map and the track may be compressed, that is, simplified.
[0122] Step 302: The sweeping robot obtains simplified map information and / or simplified trajectory information of the target scene based on the initial cleaning information. The simplified map information includes a set of inflection point coordinates of the contour information of the occupied area and n-1 partition boundary lines. The simplified trajectory information includes information of one or more trajectory points on each necessary trajectory in the initial cleaning trajectory. The partition boundary lines are used to divide any two adjacent partitions in the initial cleaning map. n represents the number of partitions in the initial cleaning map, that is, the number of partitions in the target scene, and n is an integer greater than or equal to 1. When there is only one partition in the target scene, that is, n=1, then there is no partition boundary line in the target scene.
[0123] The simplified trajectory information is used to draw one or more necessary trajectories in the initial cleaning trajectory. The simplified map information is used to draw the initial cleaning map or the optimized initial cleaning map of the target scene, as well as the n-1 partitions of the target scene. Specifically, the n-1 partitions of the target scene can be determined based on the n-1 partition boundary lines.
[0124] The information of any trajectory point includes the coordinates and type of the trajectory point. The type of the trajectory point is used to distinguish which coordinate point on which necessary trajectory the estimated point belongs.
[0125] As an example, the sweeping robot obtains the target cleaning information of the target scene after compression processing based on the initial cleaning information, including: the sweeping robot simplifies the initial cleaning information (also called compression processing) to obtain the target cleaning information.
[0126] As another example, the sweeping robot obtains first cleaning information based on the initial cleaning information. The first cleaning information is information obtained after the sweeping robot optimizes the initial cleaning information. The sweeping robot compresses the first cleaning information to obtain target cleaning information. At this time, the grid map in the first cleaning information can be a grid map obtained after the initial cleaning map in the initial cleaning information is optimized, and the first trajectory information in the first cleaning information is the trajectory information obtained after the initial cleaning trajectory information is optimized.
[0127] The initial cleaning map is usually stored in the form of a grid map. The status of each grid in the grid map is only available in three states: idle, occupied, and unknown. The information of each grid in the partition map indicates which room the current grid belongs to, and only the idle areas are displayed in different colors. The idle areas appear in patches in the map, and the information has a high degree of redundancy.
[0128] Considering that the main function of cleaning information is to display rather than restore information, a similar approach to map optimization can be adopted, where the raster map can only store multiple contours, such as the optimized outer contour + the indented inner contour.
[0129] The partition information can be simplified into a set of boundaries between different partitions. For n partitions, we need to find n-1 straight lines that span the free area and divide the left and right sides into different partitions.
[0130] Exemplarily, the contour information may include outer contour information and inner contour information. The outer contour information may refer to the outer boundary of the grid map, and the inner contour information may refer to the boundary of obstacles in the grid map. It is understood that the contour may refer to the boundary between the target area and the background area in the image.
[0131] For example, the outer contour information of the occupied area (such as a wall, etc.) in the grid map can be used Figure 5 The bold line in (a) indicates.
[0132] For example, the inner contour information of the occupied area (obstacle a and obstacle b, etc.) in the grid map can be used as follows: Figure 5 The bold lines surrounding obstacle a and the bold lines surrounding obstacle b in partition 1 in (b) are represented.
[0133] For example, the partition boundary lines of any two adjacent partitions in the partition map can be represented by Figure 5The bold lines in (c) are represented, such as partition boundary line A to partition boundary line E. Partition boundary line A is used to divide adjacent partitions 1 and 5; partition boundary line B is used to divide adjacent partitions 2 and 5; partition boundary line C is used to divide adjacent partitions 3 and 5; partition boundary line D is used to divide adjacent partitions 6 and 8; partition boundary line E is used to divide adjacent partitions 5 and 8; partition boundary line F is used to divide adjacent partitions 7 and 8. The partition boundary line can be represented by the coordinates of the two endpoints of the partition boundary line.
[0134] It is understood that an inflection point refers to a point where the direction of a contour line changes significantly. For example, in a two-dimensional space, if a contour line changes from horizontal to the right to upward, this transition point is an inflection point. In a grid map, a sweeping robot or terminal can determine the entire contour through the coordinates of multiple inflection points of the contour.
[0135] As an example, the inflection point coordinates of the contour information of the occupied area include: the first inflection point coordinates of the outer contour information of the occupied area and the second inflection point coordinates of the inner contour information of the occupied area.
[0136] For example, Figure 5 In (a), the coordinates of the first inflection point of the outer contour information are: (2,3), (2,5), (2,10), (5,3), (6,5), (6,7), (6,10), (7,7), (8,3), (8,4), (8,12), (9,1), (9,2), (10,5), (11,1), (11,5), (12,5), (12,6), (12,7), (12,12).
[0137] For example, Figure 5 As shown in (b), the second inflection point coordinates of the inner contour information are: the second inflection point coordinates of obstacle a: (9, 8), (10, 11), (11, 8); the second inflection point coordinates of obstacle b: (4, 7), (5, 7), (4, 8), (5, 8).
[0138] It is understood that each necessary trajectory may be composed of a plurality of trajectory points, and the trajectory points may be represented by trajectory coordinates. Even if some of the trajectory points are omitted, the complete necessary trajectory may be determined.
[0139] For a description of at least one necessary trajectory and a specific description of how to determine the necessary trajectory, reference may be made to the following embodiments, which will not be described in detail herein.
[0140] As an example, after the sweeping robot obtains the simplified map information and / or simplified trajectory information of the target scene after compression processing, it can save the simplified map information and / or simplified trajectory information. This can reduce memory occupancy compared to directly storing the initial cleaning map and / or initial cleaning trajectory information.
[0141] The embodiment of the present application provides a method for map processing, after obtaining the initial cleaning information obtained by the sweeping robot when performing the cleaning task in the target scene, the contour information of the occupied area is determined according to the initial cleaning map, thereby reducing the data redundancy caused by the idle area, thereby reducing the data volume; and since the contour information of the occupied area can be represented by the inflection point coordinates, the initial cleaning map can be simplified to the inflection point coordinates of the contour information of the occupied area; secondly, since there may be n partitions in the partition map. n is an integer greater than or equal to 1, the partition boundary line can be used to divide any two adjacent partitions in the initial cleaning map, so that the storage of multiple partitions can be simplified by at least one partition boundary line, thereby effectively reducing the pressure of data storage; in addition, by extracting at least one necessary track from the initial cleaning track, and the necessary track can be represented by one or more track points, the pressure of data storage can also be reduced by the track points of each necessary track; based on this, the embodiment of the present application can simplify the initial cleaning information obtained by the sweeping robot, and obtain the simplified map information and / or simplified track information of the target scene, and the data volume of the simplified map information and / or simplified track information is less than the data volume of the initial cleaning information, thereby solving the technical problem of the large initial data volume obtained by the sweeping robot.
[0142] In a possible embodiment of the present application, after step 301, the method provided in the embodiment of the present application further includes:
[0143] The sweeping robot performs map optimization processing and / or trajectory optimization processing on the initial cleaning information to obtain the first cleaning information, and the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing and boundary optimization processing. The first cleaning information includes first map information and / or first trajectory information. Among them, the first map information is the map information obtained after the initial cleaning map is subjected to map optimization processing. The first trajectory information is the trajectory obtained after the initial cleaning trajectory is subjected to trajectory optimization processing. For example, the first trajectory information includes at least one necessary trajectory. It is understandable that the first map information does not have one or more of the following problems: penetration, boundary burrs, and superposition.
[0144] As an example, the cleaning robot can display the first cleaning information after obtaining the first cleaning information.
[0145] Accordingly, step 302 may be implemented in the following manner: the cleaning robot compresses the first cleaning information to obtain simplified map information and / or simplified trajectory information of the target scene.
[0146] The cleaning robot determines target cleaning information according to simplified map information and / or simplified trajectory information of the target scene.
[0147] As an example, the sweeping robot may also send simplified map information and / or simplified trajectory information of the target scene to the terminal, and the terminal determines the target cleaning information according to the simplified map information and / or simplified trajectory information of the target scene.
[0148] As an example, the inflection point coordinates of the contour information of the occupied area include: the first inflection point coordinates of the outer contour information of the occupied area and the second inflection point coordinates of the inner contour information of the occupied area. For the description of the first inflection point coordinates and the second inflection point coordinates, reference can be made to the above embodiment and will not be repeated here.
[0149] The sweeping robot can simplify the map information to draw a target map of the target scene, and / or draw a target trajectory of the target scene according to the simplified trajectory information. The target map includes a target grid map and a target partition map, the outer contour in the target grid map is determined by the first inflection point coordinates, and the inner contour in the target grid map is determined by the second inflection point coordinates. The target partition map is used to indicate multiple partitions in the target grid map, and there are partition boundary lines between adjacent partitions in the multiple partitions.
[0150] Exemplarily, the sweeping robot can draw the outer boundary of the cleaning area in the target grid map based on the first inflection point coordinates. The overall shape of the cleaning area can be determined through the first inflection point coordinates. After determining the outer contour, the area inside the contour can be represented by an idle grid, which indicates that the inner area is an idle area, and the sweeping robot can move and clean in the idle area. In the idle area, the partition boundary line is filled as unknown, and a connected domain analysis is performed on the idle area, and different connected domains are assigned different partition information. The idle areas of different partitions are drawn with different colors, and the partition boundary lines are uniformly assigned to the right side of the boundary information. Draw the inner contour, and fill the inside as unknown to obtain the target grid map.
[0151] The outer contour is represented by an occupied grid, which means that the outer contour is an occupied area and the sweeping robot cannot move to the occupied area.
[0152] It is understandable that the sweeping robot can draw the outer contour by connecting adjacent first inflection point coordinates through the first inflection point coordinates. Since these first inflection point coordinates can provide key information of the outer contour (the location of the direction change), the outer boundary of the cleaning area, i.e., the outer contour, can be accurately drawn in the grid map.
[0153] Exemplarily, the target grid map includes any inner contour generated by the cleaning robot based on the second inflection point information, the inner contour is represented by an occupied grid, and the internal area of the inner contour is represented by an unknown grid.
[0154] It is understandable that the sweeping robot can determine any obstacle distributed in the cleaning area in the target grid map based on any set of second inflection point information. Figure 5 The coordinates of the second inflection point of obstacle a shown in (b) are: (9, 8), (9, 11), (11, 8), and the position, size and shape of obstacle a in the target grid map are determined. Then the inner contour is represented by the occupied grid, which means that the sweeping robot can avoid the obstacle. Since the obstacle can be a bed, sofa or other obstacle, the inside of it may be an empty area or an occupied area, so the inner area of the inner contour can be represented by an unknown grid.
[0155] As an example, the target partition map includes at least one partition generated by the sweeping robot based on at least one partition, each partition has a different identifier, and any partition boundary line is used to determine the partitions on both sides of any partition boundary line, and has the identifier of the partition on the first side.
[0156] Exemplarily, the first side may be the left side of the partition boundary line or the right side of the partition boundary line, and the embodiment of the present application does not impose any specific limitation on this.
[0157] For example, the terminal can draw and generate partitions on both sides of each partition boundary line. Figure 5 As shown in (c), the terminal can determine partition 1 and partition 5 according to the partition boundary line A, and represent partition 1 and partition 5 with different identifiers. The terminal can represent the partition boundary line A with an identifier such as partition 1.
[0158] The target trajectory includes at least one target necessary trajectory determined by information of one or more trajectory points of at least one necessary trajectory.
[0159] It is understandable that, since the data storage capacity in the initial cleaning information is large, the sweeping robot can simplify the initial cleaning information to obtain simplified map information and / or simplified trajectory information and store or send it to the terminal, which can reduce the amount of data in data transmission. Of course, when the sweeping robot obtains simplified map information and / or simplified trajectory information, it can also store the simplified map information and / or simplified trajectory information in the sweeping robot or in the cloud. This can reduce the memory usage compared to storing the initial cleaning information.
[0160] Exemplarily, the target grid map includes an outer contour generated by the cleaning robot based on the coordinates of the first inflection point, the outer contour is represented by occupied grids, and the inner area of the outer contour is represented by idle grids.
[0161] After the sweeping robot performs the cleaning task and obtains the initial cleaning information, due to the problems of penetration, boundary burrs and superposition in the laser grid map, the laser has ranging errors at long distances. The first time, the boundary established by long-distance ranging may be pulled inward after the update, and there are redundant obstacle points outside. The laser ranging principle will not form diffuse reflection in places such as angles / transparent objects, resulting in ranging anomalies and penetration. Therefore, the sweeping robot can perform one or more optimization processes such as penetration optimization processing, rotation processing and boundary optimization processing on the initial cleaning information to obtain optimized initial cleaning information, that is, the first cleaning information. Afterwards, the sweeping robot can simplify the first cleaning information to obtain simplified map information and / or simplified trajectory information.
[0162] It is understandable that when a sweeping robot performs a cleaning task, it relies on laser sensors to determine its position and orientation, and to obtain layout information of the target scene. However, since the target scene usually includes a series of facilities, this complex environment may interfere with the measurement of the laser sensor, and the laser ranging technology itself may also have certain errors. Therefore, there may be some problems with the environmental information collected during the first cleaning.
[0163] For example, when using a laser sensor to measure distance, the boundary (outer contour) may be pulled inward due to the difference in the first distance measurement; and because the principle of optical ranging cannot form diffuse reflection at angles / transparent objects, etc., ranging anomalies may occur, resulting in penetration, that is, the boundary that should be connected is mistakenly identified as two disconnected parts. Therefore, after the sweeping robot obtains the initial cleaning information after performing the cleaning task, it can perform penetration optimization processing on the initial cleaning information to obtain the first cleaning information.
[0164] For another example, when a sweeping robot performs a cleaning task, it will establish an initial cleaning map with the initial position of the sweeping robot as the starting point. However, the initial position of the sweeping robot is not fixed, so the starting point of the initial cleaning map is also not fixed. And every time the sweeping robot cleans the same target scene, no matter where the initial position of the sweeping robot is located, the grid map finally established is in a fixed direction. Therefore, after the sweeping robot obtains the initial cleaning information after performing the cleaning task, it can rotate the initial cleaning information to obtain the first cleaning information.
[0165] For another example, due to the ranging error of the laser sensor and the interference of obstacles near the wall, the boundary (outer contour) determined by the sweeping robot may be composed of multiple short straight lines. Therefore, after the sweeping robot obtains the initial cleaning information after performing the cleaning task, it needs to perform boundary optimization processing on the initial cleaning information to obtain the first cleaning information.
[0166] It can be understood that in the method provided in the embodiment of the present application, after the sweeping robot obtains the initial cleaning information after performing the cleaning task, it can sequentially perform penetration optimization processing, rotation processing and boundary optimization processing on the initial cleaning information to obtain the first cleaning information.
[0167] It can be understood that in the method provided in the embodiment of the present application, after the sweeping robot obtains the initial cleaning information after performing the cleaning task, it can perform penetration optimization processing on the initial cleaning information, and then perform boundary optimization processing to obtain the first cleaning information.
[0168] It can be understood that in the method provided in the embodiment of the present application, after the sweeping robot obtains initial cleaning information after performing a cleaning task, it can rotate the initial cleaning information and then perform boundary optimization processing to obtain first cleaning information.
[0169] The following will describe how the cleaning robot performs optimization processing, rotation processing and boundary optimization processing on the initial cleaning information.
[0170] (1) Optimization of penetration
[0171] In a possible embodiment of the present application, the optimization process includes a penetration optimization process. The sweeping robot performs a penetration optimization process on the initial cleaning information, including: the sweeping robot performs a binarization process on the initial cleaning map to determine the free grids in the initial cleaning map. The sweeping robot takes the free grids in the initial cleaning map as the foreground, performs an erosion operation on the free grids in the initial cleaning map, and obtains a plurality of connected domains with different labels. The plurality of connected domains include a penetration area and a free area. The sweeping robot retains at least one first connected area through which the cleaning track passes according to a plurality of cleaning tracks. When the sweeping robot performs an expansion process on at least one first connected area, according to the mask in the first connected area, the free grids and occupied grids located in the mask, as well as the occupied grids adjacent to the mask are retained to obtain the first grid map in the first cleaning information.
[0172] Exemplarily, the penetration optimization process may refer to the processing of sporadic penetrations in the corners of boundaries (such as walls), large-scale penetrations of obstacles as high as the laser, and superimposed multi-layer obstacle boundaries. These penetrated areas may be connected to idle grids. Therefore, whether it is sporadic penetration or large-scale penetration, its main form is to form idle areas outside the closed occupied boundary. The inside of the occupied boundary (outer contour) is the idle area, which is also the main cleaning area of the sweeper. Outside the occupied boundary, a thick wall with multiple layers of occupied boundaries superimposed may be formed due to errors.
[0173] As an example, in order to better describe the penetration optimization processing of the sweeping robot, the sweeping robot can first describe the initial cleaning map and hide the display of the cleaning trajectory. The sweeping robot can first binarize the initial cleaning map and use the idle grid as the foreground. Since the initial cleaning map contains occupied grids, idle grids and unknown grids, and the penetration phenomenon is only outside the obstacle grid, it is penetrated in the form of idle grids, and the occupied grid is brought in at the end. Therefore, the sweeping robot can use the idle grid as the foreground (for example, assign a value of 1), and the rest (occupied grids and unknown grids) as the background (for example, assign a value of 0), so that the penetration area and the cleaning area (idle area) performing the cleaning task can be disconnected from the connected domain. Then, the sweeping robot can perform an erosion operation on the foreground, so that the more fragmented penetration (such as corner rays) can be filtered out, and the penetration area that is only connected to the cleaning area by a single pixel (grid) can be further disconnected to obtain multiple connected areas (different connected areas can be represented by different marks). Then, the sweeping robot obtains at least one connected area passed by the cleaning trajectory according to the cleaning trajectory. It is understandable that the cleaning trajectory can be used to indicate the location where the sweeping robot actually passes. Then, among the multiple connected areas, the connected area that does not include the cleaning trajectory can be regarded as the penetration area, thereby obtaining at least one connected area. The sweeping robot can perform expansion processing on at least one connected area to restore the original shape and size of the occupied grid in the initial cleaning map. Then, the sweeping robot retains the grids on the mask and the occupied grids within the preset neighborhood of these grids (for example, within the 8 neighborhood).
[0174] (2) Map rotation
[0175] As a possible implementation method, the optimization process includes map rotation process, and the sweeping robot optimizes the initial cleaning information, including: the sweeping robot obtains multiple outer contour straight lines of the initial cleaning map when binarizing the initial cleaning map and corroding the foreground. The sweeping robot clusters the multiple outer contour straight lines according to the angle and length of each outer contour straight line, and determines multiple category straight lines, where the category straight line is a straight line obtained by fitting at least one outer contour straight line. The sweeping robot determines the angle to be rotated based on the angle between the first category straight line and the second category straight line, so that the first category straight line is parallel or perpendicular to the display boundary, the sum of the lengths of at least one outer contour straight line fitted in the first category straight line is the longest, and the second category straight line is perpendicular to the first category straight line. The sweeping robot rotates at least one turning point in the multiple outer contour straight lines according to the angle to be rotated to obtain multiple outer contour straight lines after rotation. The sweeping robot sequentially processes multiple first grids according to the multiple outer contour straight lines after rotation and the angle to be rotated to obtain the rotated initial cleaning map, where the first grid is the grid in the initial cleaning map except the multiple outer contour straight lines.
[0176] As an example, after the rotation is completed, the rotated straight line can be translated, and the inside of the rotated outer contour can be filled with reference to the original image, and the unknown grids inside the plurality of the outer contour straight lines can be expanded.
[0177] It is understandable that the relevant technology proposes that the solution for rotating the grid map can be: first determine the longest side of the grid map, and then rotate the grid map until the longest side is parallel or perpendicular to the boundary of the display interface. However, in cases where there are large areas that cannot be removed, the map boundary is incomplete, or obstacles are placed to interrupt long straight edges, straight line detection alone will detect a pseudo edge, that is, the pseudo edge may not be the longest side, which will cause the rotated grid map to not meet expectations. And because the starting point or end point of the rotation is randomly determined, there may be a 180° difference in the rotation.
[0178] As an example, in order to determine the outer contour line, the sweeping robot can first remove the grid state (pixel points) within the outer contour line, for example, the initial cleaning map can be binarized, and the foreground (the foreground can be an idle grid or an occupied grid) can be corroded to extract the outer contour line. It can be understood that the outer contour line is the outer boundary contour of the initial cleaning map. The sweeping robot analyzes the contour points of the outer boundary contour. If these contour points are within a certain distance range, these contour points are considered to be an outer contour line. Then, the sweeping robot performs straight line detection on the outer contour line, which can be specifically: sorting multiple outer contour lines, and clustering adjacent outer contour lines within a preset angle (such as 2.5°) with the angle of the outer contour line (relative to the boundary of the display screen) as the center, and then aggregating the spatially similar ones into a category line. The sweeping robot determines the longest category line (first category line) and the second category line perpendicular to the first category line, and determines the intersection of the first category line and the second category line; and based on the intersection, the initial cleaning map is rotated to be parallel to the upper right corner of the display screen. Specifically, the sweeping robot can rotate the turning point of the outer contour line. Then, when the outer contour line is rotated, the sweeping robot can generate a mask in the inner area of the outer contour line. Then, the grid (first grid) except for multiple outer contour lines in the initial cleaning map is rotated. If the rotated grid is not on the mask, the grid is removed. Afterwards, the sweeping robot processes the internal area as a mask grid, specifically: if there is an idle grid in the 8-neighborhood of the mask grid, the mask grid is processed as an idle grid; if the 8-neighborhood of the mask grid is an occupied grid or an unknown grid, the mask grid is processed as an unknown grid.
[0179] (3) Boundary optimization processing
[0180] Due to ranging errors and the placement of obstacles near the wall, a map boundary constructed by a long wall may be broken down into multiple short straight lines.
[0181] The main goals of map border optimization are to make the borders more regular, straighten them as much as possible, display single-pixel-wide borders, and make them as horizontally / vertically straight as possible.
[0182] The laser will return the distance information when it hits the surface of the obstacle. In addition, the working environment of the sweeping robot is mostly a closed indoor space. Therefore, the final 2D laser grid map will be clearly divided into two layers: the obstacle boundary formed by the external wall surrounds the idle area; the occupied or unknown small area surrounded by the internal obstacles. Based on this, the core of map optimization is to straighten the outer contour wall of the map and maintain the original obstacle boundary.
[0183] Therefore, the boundary optimization can be performed in the following ways:
[0184] The sweeping robot extracts the outer contour of the idle area according to the grid map boundary in the initial cleaning map. The sweeping robot expands the outer contour of the idle area to find the boundary occupied by the single-pixel obstacle surrounding the idle area, and straightens the boundary after finding the boundary occupied by the single-pixel obstacle surrounding the idle area. The obstacle contour inside the outer contour is indented to restore the boundary of the internal obstacle.
[0185] Map boundary optimization hopes to straighten the occupied boundary, but due to mapping errors, some rooms that are close to each other may have two walls that are adjacent to each other in four areas, resulting in the contour missing the adjacent wall contours. The contours will turn at adjacent pixels, and the optimization will be strange. Therefore, when extracting contours, the contours are extracted from idle pixels, but the boundaries of the extracted contours are on the idle pixels, so it is necessary to perform an external expansion process to obtain the obstacle boundary to be optimized. The purpose of the entire external expansion is to find the occupied boundary of a single-pixel obstacle surrounding the idle area, and then straighten this boundary. The inner contour is actually the boundary of the internal obstacle, and batch corrosion operations can complete the optimization of shrinking. Contour drawing is relatively simple, similar to map rotation, just fill the internal pixels after drawing the contour.
[0186] Because the ideal map contour is a single-pixel wall surrounding the idle area, the contour should be extracted from the idle area and then expanded, rather than extracting the contour based on the area obtained by taking both the idle and occupied grids as the foreground.
[0187] Similarly, if both idle and occupied grids are used as foregrounds to extract contours, the contours of small obstacles without unknown grids inside will be lost. From this perspective, in order to use contours to represent internal obstacles, contours should also be extracted on the idle area, and then the obstacle boundaries should be restored by indentation.
[0188] It is understandable that when the sweeping robot scans the boundary through the laser sensor, it may break down the boundary (outer contour and inner contour) into multiple straight lines. By performing boundary optimization processing on the initial cleaning map, the sweeping robot can make the boundary of the initial cleaning map smooth, display it as a single grid width boundary, and make it as perpendicular or parallel to the display boundary of the terminal display screen as possible.
[0189] It is understandable that when the sweeping robot scans with a laser sensor, the laser will return distance information when it reaches the surface of the obstacle. In addition, the working environment of the sweeping robot is usually a closed indoor space. Therefore, the boundaries can be divided into two categories: the boundary formed by the external wall (external contour) and the boundary formed by the internal obstacle (inner contour).
[0190] As an example, the sweeping robot can perform boundary optimization processing on the outer contour. The sweeping robot can extract the outer contour and inner contour of the initial cleaning map, and then perform boundary optimization processing on the outer contour and the inner contour. Optionally, after the boundary optimization processing of the outer contour and the inner contour is performed, the initial cleaning map can be rotated, and the above operation can be performed when the sweeping robot performs penetration optimization processing on the initial cleaning map.
[0191] Specifically, the method for the sweeping robot to extract the outer contour of the initial cleaning map includes: the sweeping robot can extract the contour a (dashed line part) on the idle grid; then, the sweeping robot expands the contour through 4-neighborhood expansion, so as to obtain the single-pixel obstacle boundary surrounding the idle area; then, the outermost single-pixel contour is determined as the outer contour (solid line part).
[0192] It should be explained that due to the mapping error, the walls of two adjacent partitions may be 4-neighborhood adjacent. Therefore, if the outer contour is directly extracted on the occupied grid, there may be errors in the outer contour extraction on the walls of two adjacent partitions. Therefore, it is necessary to extract the outer contour based on the free grid.
[0193] Specifically, the method for extracting the inner contour of the initial cleaning map by the sweeping robot includes: the sweeping robot processes the occupied area in the initial cleaning map, that is, the obstacle. Then, the interior of the obstacle is processed into an occupied grid, and then the occupied grid in the obstacle is used as the foreground to perform an erosion operation. Then, the sweeping robot can extract the inner contour of the obstacle.
[0194] Specifically, the sweeping robot performs boundary optimization processing on the outer contour and the inner contour, including: the grid state atmosphere of the sweeping robot's outer contour occupies the contour segment (occupied grids on the grid map) and the unknown contour segment (unknown grids on the grid map). The sweeping robot can downsample the inflection points of the occupied contour segments and perform straight line fitting on the grids with a small range of variation. Then, if the angle between the occupied line segment in an occupied outer contour segment and the horizontal direction is less than the preset angle, and the displacement of the end point along the vertical direction to the midpoint of the occupied line segment is less than the preset displacement, the occupied line segment is rotated with the midpoint of the occupied line segment as the center to connect it with other occupied line segments in the outer contour segment. Similarly, regarding the way in which the sweeping robot performs boundary optimization processing on the inner contour, you can refer to the outer contour, which will not be repeated here.
[0195] (4) Trajectory optimization processing,
[0196] The key to trajectory optimization processing is whether the trajectory is necessary to display, so the initial cleaning trajectory is subjected to trajectory optimization processing, including: the sweeping robot determines the necessary and unnecessary trajectories in the initial cleaning trajectory based on whether the specific behavior of the sweeping robot is effective cleaning. The sweeping robot draws the necessary trajectory according to the type of the necessary trajectory. When drawing, the display of unnecessary trajectories can be directly omitted, the edge / obstacle avoidance trajectory in the necessary trajectory can be drawn normally, and the bow trajectory is directly generated according to its specific classification and endpoint information.
[0197] Furthermore, different drawing scheme trajectories may be displayed in combination with the current cleaning type (sweeping, mopping, sweeping and mopping).
[0198] For example, the cleaning robot can extract at least one necessary track from multiple cleaning tracks according to the standard of valid tracks. Optionally, the cleaning robot can also determine one or more unnecessary tracks from multiple cleanings according to the standard of invalid tracks, and then extract at least one necessary track from multiple cleaning tracks.
[0199] For example, the standards for effective trajectories include at least: infrared edge trajectory, binocular obstacle avoidance trajectory, bow-shaped straight line trajectory, and bow-shaped arc trajectory. The cleaning robot can extract at least one trajectory that meets the standards for the above effective trajectories from multiple cleaning trajectories as a necessary trajectory.
[0200] For another example, the criteria for invalid trajectories include at least: an escape trajectory, a navigation trajectory, an obstacle crossing trajectory, and an exploration trajectory. The cleaning robot may extract at least one trajectory that meets the criteria for the invalid trajectory from the multiple cleaning trajectories as a non-essential trajectory.
[0201] In other words, if there are no necessary trajectories, the sweeping robot will miss sweeping areas; and if there are no unnecessary trajectories, it will not affect the cleaning process, such as the sweeping robot's switching trajectories in different partitions, and the escape attempt logic in trapped areas.
[0202] The following describes how to compress the trajectory to obtain simplified trajectory information.
[0203] As an example, the sweeping robot can compress the optimized initial cleaning trajectory, or can compress the initial cleaning trajectory to determine the simplified trajectory information. Regardless of whether the optimized initial cleaning trajectory is compressed or the initial cleaning trajectory is compressed, the simplified trajectory information finally obtained includes one or more trajectory points on each necessary trajectory, so that when drawing, one or more trajectory points on any necessary trajectory can be directly connected.
[0204] The following description will be based on the compression process of the optimized initial cleaning trajectory to determine the simplified trajectory information.
[0205] It is understood that whether it is a non-essential trajectory or a necessary trajectory, it can be composed of one or more trajectory points, and the trajectory points can be represented by trajectory coordinates. Even if some of these trajectory points are omitted, the complete necessary trajectory can be determined.
[0206] For example, the necessary trajectories include infrared edge trajectory, binocular obstacle avoidance trajectory, bow-shaped straight line trajectory, and bow-shaped circular arc trajectory. The infrared edge trajectory and binocular obstacle avoidance trajectory are usually related to the distribution of occupied areas in the grid map, and the sweeping robot can filter within a certain range. For another example, since the bow-shaped straight line trajectory is usually used to cover a large area, such as the floor of a room, the sweeping robot can retain the starting and ending trajectory points of the bow-shaped straight line trajectory, which can also simplify the path and reduce the complexity of calculation; the sweeping robot can retain the trajectory points of the endpoints of the two ends of the bow-shaped circular arc trajectory (such as endpoint 1 of bow-shaped straight line trajectory 1 and endpoint 2 of bow-shaped straight line trajectory 2), and the radius and arc direction of the bow-shaped circular arc trajectory can be determined based on the two endpoints.
[0207] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the interaction between various network elements. It can be understood that in order to realize the above functions, each device, such as a sweeping robot, includes a structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this document, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0208] The embodiment of the present application can divide the functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0209] Combined with the above Figures 1 to 5, the method of the embodiment of the present application is described, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the map processing device provided by the embodiment of the present application can execute the steps executed by the sweeping robot in the above-mentioned map processing method.
[0210] In the case of integrated units, Figure 6 A map processing device involved in the above embodiments is shown. The map processing device may be a sweeping robot or a device applied in a sweeping robot, such as a chip or a processing circuit. The map processing device may include: an acquisition unit 1310 and a processing unit 1320.
[0211] In an optional implementation, the map processing device may further include a storage unit for storing program codes and data of the map processing device.
[0212] As an example, the map processing device is a sweeping robot, or a chip used in a sweeping robot. Among them, the acquisition unit 1310 is used to obtain the initial cleaning information obtained by the sweeping robot when performing a cleaning task in the target scene, and the initial cleaning information includes the initial cleaning map of the target scene and the initial cleaning trajectory of the sweeping robot when performing the cleaning task in the target scene; the initial cleaning map is at least used to reflect the occupied area of the target scene. The processing unit 1320 is used to process the initial cleaning information to obtain simplified map information and / or simplified trajectory information corresponding to the target scene; the simplified map information includes a set of inflection point coordinates of the outline of the occupied area and n-1 partition boundary lines, the simplified trajectory information includes information on one or more trajectory points on each necessary trajectory in the initial cleaning trajectory, and the partition boundary lines are used to divide any two adjacent partitions in the initial cleaning map, and n is an integer greater than or equal to 1.
[0213] In a possible implementation of the present application, the device provided in the embodiment of the present application further includes: a processing unit, including an optimization module and a compression module, the optimization module is used to perform map optimization processing on the initial cleaning map and / or perform trajectory optimization processing on the initial cleaning trajectory to obtain first cleaning information, the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing and boundary optimization processing; the first cleaning information includes the necessary trajectory in the initial cleaning trajectory and / or the first grid map obtained by optimizing the initial cleaning map. The compression module is used to compress the first cleaning information to obtain simplified map information and / or simplified trajectory information corresponding to the target scene.
[0214] In a possible implementation of the present application, an optimization module is used to perform the boundary optimization processing on the initial cleaning information after performing the penetration optimization processing and / or the rotation processing.
[0215] In a possible implementation of the present application, the optimization module is used to perform a penetration optimization process on the initial cleaning map, including: performing a binarization process on the initial cleaning map to determine an idle grid in the initial cleaning map; performing an erosion process on the idle grid with the idle grid in the initial cleaning map as the foreground to obtain a plurality of connected domains with different marks, wherein the plurality of connected domains include a penetration area and an idle area;
[0216] Performing expansion processing on at least one of the multiple connected domains through which the initial cleaning trajectory passes, so as to restore the size of at least one of the connected domains;
[0217] The free grids and occupied grids located in the connected domain in the initial cleaning map, as well as the occupied grids adjacent to the connected domain, are retained to obtain the first grid map in the first cleaning information.
[0218] In a possible implementation of the present application, the optimization module is used to perform the rotation processing on the initial cleaning map, including:
[0219] Determining a plurality of outer contour straight lines in the initial cleaning map;
[0220] Clustering the plurality of outer contour straight lines to determine the angle to be rotated according to the clustering result;
[0221] Rotating at least one turning point existing in the plurality of outer contour straight lines in the initial cleaning map according to the angle to be rotated;
[0222] After the rotation is completed, the plurality of outer contour straight lines are filled internally, and unknown grids inside the plurality of outer contour straight lines are expanded.
[0223] In a possible implementation of the present application, the optimization module is used to cluster the multiple outer contour straight lines to determine the angle to be rotated according to the clustering result, including: clustering the multiple outer contour straight lines in the initial cleaning map to determine a plurality of category straight lines, where the category straight line is a straight line obtained by fitting at least one outer contour straight line;
[0224] Based on the angle between the first category straight line and the second category straight line, the angle to be rotated is determined so that the first category straight line is parallel or perpendicular to the display boundary, the total length of at least one outer contour straight line fitted in the first category straight line is the longest, and the second category straight line is perpendicular to the first category straight line.
[0225] In a possible implementation of the present application, the inflection point coordinate set of the contour of the occupied area includes: an outer contour inflection point coordinate set and a plurality of inner contour inflection point coordinate sets of the occupied area, after obtaining the simplified map information corresponding to the target scene, a drawing unit is used to draw a target grid map according to the inflection point coordinate set of the contour of the occupied area, wherein the outer contour of the occupied area in the target grid map is obtained by drawing the outer contour inflection point coordinate set, the interior of the outer contour is represented by an idle grid, and the outer contour is represented by an occupied grid; the inner contour of the occupied area is obtained by drawing the plurality of inner contour inflection point coordinate sets, and the interior of the inner contour is represented by an unknown grid;
[0226] Filling the partition boundary line as unknown in the idle area represented by the idle grid in the target grid map;
[0227] Connected domain analysis is performed on the idle area, different connected domains are assigned different partition information, and idle areas in different partitions are drawn with different colors. Partition boundary lines are uniformly assigned the right side information of the boundary to obtain a partition map of the target grid map.
[0228] In a possible implementation of the present application, the optimization module is used to perform boundary optimization processing on the initial cleaning map, including: extracting the outer contour of the idle area in the initial cleaning map;
[0229] Expanding the outer contour and straightening the boundary occupied by the single-pixel obstacle surrounding the idle area;
[0230] The obstacle contour inside the outer contour is indented to restore the boundary of the internal obstacle.
[0231] In a possible implementation of the present application, the optimization module is used to perform trajectory optimization processing on the initial cleaning trajectory, including: determining the coordinates of the necessary trajectory and the coordinates of the unnecessary trajectory in the initial cleaning trajectory based on whether the specific behavior of the cleaning robot is effective cleaning;
[0232] The necessary trajectory of the first cleaning information is drawn according to the coordinates of the necessary trajectory and the type of the necessary trajectory.
[0233] The processing unit and the acquisition unit can be integrated in a processor or a controller, for example, a central processing unit, a general processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements a computing function, for example, a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The communication module can be a transceiver, a transceiver circuit or a communication interface, and the like. The storage module can be a memory.
[0234] In one aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed, the following is implemented: Figure 3 Functions performed by the robot vacuum cleaner.
[0235] In one aspect, a computer program product is provided, wherein the computer program product includes instructions, and when the instructions are executed, the following are implemented: Figure 3 Functions performed by the vacuum cleaner robot.
[0236] In one aspect, a chip is provided, which is applied to a receiving device, and the chip includes at least one processor and a communication interface, wherein the communication interface is coupled to the at least one processor, and the processor is used to execute instructions to implement the following Figure 3 Functions performed by the vacuum cleaner robot.
[0237] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).
[0238] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0239] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A map processing method, characterized in that: The method comprises: Acquire initial cleaning information obtained when the cleaning robot performs a cleaning task in a target scene, the initial cleaning information including an initial cleaning map of the target scene and an initial cleaning trajectory of the cleaning robot when performing a cleaning task in the target scene; the initial cleaning map is used to at least reflect an occupied area of the target scene; Process the initial cleaning information to obtain simplified map information and / or simplified trajectory information corresponding to the target scene; the simplified map information includes a set of inflection point coordinates of the outline of the occupied area and n-1 partition boundary lines, the simplified trajectory information includes information of one or more trajectory points on each necessary trajectory in the initial cleaning trajectory, and the partition boundary lines are used to divide any two adjacent partitions in the initial cleaning map, where n represents the number of partitions in the target scene, and n is an integer greater than or equal to 1.
2. The method according to claim 1, characterized in that The processing of the initial cleaning information to determine simplified map information and / or simplified trajectory information corresponding to the target scene includes: Performing map optimization processing on the initial cleaning map and / or performing trajectory optimization processing on the initial cleaning trajectory to obtain first cleaning information, wherein the map optimization processing includes one or more of the following: penetration optimization processing, rotation processing, and boundary optimization processing; the first cleaning information includes necessary trajectories in the initial cleaning trajectory and / or a first grid map obtained by optimizing the initial cleaning map; The first cleaning information is compressed to obtain simplified map information and / or simplified trajectory information corresponding to the target scene.
3. The method according to claim 2, characterized in that The performing map optimization processing on the initial cleaning information includes: After the penetration optimization processing and / or the rotation processing are performed on the initial cleaning information, the boundary optimization processing is performed.
4. The method according to claim 2 or 3, characterized in that: The penetration optimization processing of the initial cleaning map includes: Binarizing the initial cleaned map to determine free grids in the initial cleaned map; After the idle grid in the initial cleaning map is corroded by taking the idle grid in the foreground, a plurality of connected domains with different marks are obtained, wherein the plurality of connected domains include a penetrated area and an idle area; Performing expansion processing on at least one of the multiple connected domains through which the initial cleaning trajectory passes, so as to restore the size of at least one of the connected domains; The free grids and occupied grids located in the connected domain in the initial cleaning map, as well as the occupied grids adjacent to the connected domain, are retained to obtain the first grid map in the first cleaning information.
5. The method according to claim 2 or 3, characterized in that: The rotating process of the initial cleaning map includes: Determining a plurality of outer contour straight lines in the initial cleaning map; Clustering the plurality of outer contour straight lines to determine the angle to be rotated according to the clustering result; Rotating at least one turning point existing in the plurality of outer contour straight lines in the initial cleaning map according to the angle to be rotated; After the rotation is completed, the plurality of outer contour straight lines are filled internally, and unknown grids inside the plurality of outer contour straight lines are expanded.
6. The method according to claim 5, characterized in that The clustering of the plurality of outer contour straight lines to determine the angle to be rotated according to the clustering result includes: Clustering a plurality of outer contour straight lines in the initial cleaning map to determine a plurality of category straight lines, wherein the category straight lines are straight lines obtained by fitting at least one outer contour straight line; Based on the angle between the first category straight line and the second category straight line, the angle to be rotated is determined so that the first category straight line is parallel or perpendicular to the display boundary, the total length of at least one outer contour straight line fitted in the first category straight line is the longest, and the second category straight line is perpendicular to the first category straight line.
7. The method according to any one of claims 1 to 4, characterized in that: The inflection point coordinate set of the contour of the occupied area includes: an outer contour inflection point coordinate set and a plurality of inner contour inflection point coordinate sets of the occupied area. After obtaining the simplified map information corresponding to the target scene, the method further includes: According to the inflection point coordinate set of the contour of the occupied area, a target grid map is drawn, wherein the outer contour of the occupied area in the target grid map is drawn by the outer contour inflection point coordinate set, the interior of the outer contour is represented by free grids, and the outer contour is represented by occupied grids; the inner contour of the occupied area is drawn by the multiple inner contour inflection point coordinate sets, and the interior of the inner contour is represented by unknown grids; Filling the partition boundary line as unknown in the idle area represented by the idle grid in the target grid map; Connected domain analysis is performed on the idle area, different connected domains are assigned different partition information, and idle areas in different partitions are drawn with different colors. Partition boundary lines are uniformly assigned the right side information of the boundary to obtain a partition map of the target grid map.
8. The method according to any one of claims 1 to 4, characterized in that: The performing boundary optimization processing on the initial cleaning map includes: Extracting the outer contour of the idle area in the initial cleaning map; Expanding the outer contour and straightening the boundary occupied by the single-pixel obstacle surrounding the idle area; The obstacle contour inside the outer contour is indented to restore the boundary of the internal obstacle.
9. The method according to any one of claims 2 to 5, characterized in that: The performing trajectory optimization processing on the initial cleaning trajectory includes: Determining the coordinates of the necessary track and the coordinates of the unnecessary track in the initial cleaning track based on whether the specific behavior of the cleaning robot is effective cleaning; The necessary trajectory of the first cleaning information is drawn according to the coordinates of the necessary trajectory and the type of the necessary trajectory.
10. A map processing device, characterized in that: The device comprises: an acquisition unit, configured to acquire initial cleaning information obtained when the cleaning robot performs a cleaning task in a target scene, wherein the initial cleaning information includes an initial cleaning map of the target scene and an initial cleaning trajectory of the cleaning robot when performing a cleaning task in the target scene; the initial cleaning map is at least used to reflect an occupied area of the target scene; A processing unit is used to process the initial cleaning information to obtain simplified map information and / or simplified trajectory information corresponding to the target scene; the simplified map information includes a set of inflection point coordinates of the outline of the occupied area and n-1 partition boundary lines, the simplified trajectory information includes information of one or more trajectory points on each necessary trajectory in the initial cleaning trajectory, and the partition boundary lines are used to divide any two adjacent partitions in the initial cleaning map, where n represents the number of partitions in the target scene, and n is an integer greater than or equal to 1.
11. A sweeping robot, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
13. A map processing system, characterized in that: include: A sweeping robot, the sweeping robot is used to execute the method according to any one of claims 1 to 9.
Citation Information
Cited By
Optimal full-coverage path planning method and system for connected domain corridor based on grid map
CN120685091A
