A method for managing robot maps

By adjusting the rotation angle of the robot vacuum's map to match the historical map, the problem of map inconsistency during cleaning was solved, achieving map stability and robustness, and improving cleaning efficiency and accuracy.

CN117472037BActive Publication Date: 2026-07-03AMICRO SEMICONDUCTOR CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AMICRO SEMICONDUCTOR CO LTD
Filing Date
2022-07-18
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

When a robot vacuum cleaner repeatedly cleans the same area, it cannot guarantee that its posture will be consistent each time it cleans, resulting in inconsistent map information and affecting the accuracy of positioning and path planning.

Method used

By comparing the angular relationship between the current map and the last saved map, the rotation angle of the current map is adjusted to match the historical map library. Maps that meet the preset threshold are only saved to the historical map library, and maps with large angular offsets are removed, thus optimizing map management.

Benefits of technology

It improves the stability and richness of robot maps, enhances the robustness of mapping and localization algorithms, ensures the validity and consistency of map information, and supports accurate navigation for multiple cleaning cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117472037B_ABST
    Figure CN117472037B_ABST
Patent Text Reader

Abstract

This invention discloses a method for managing robot maps. The method includes: Step 1, the robot builds a current map within the current environment; Step 2, based on the angular relationship between the current map and the previously stored map in the historical map database, the current map is stored in the historical map database. By saving historical map records based on the same environmental area, a map that more closely matches the actual scenario is preserved, increasing the stability and richness of the map. This also maintains the validity of the robot's historical maps and effectively improves the robustness of the mobile robot's mapping and localization algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of map storage, and more specifically to a method for managing robot maps. Background Technology

[0002] The size of a robotic vacuum cleaner working indoors is basically fixed, but the distribution of obstacles will affect the actual movement path of the robot. When a robotic vacuum cleaner repeatedly cleans the same room area or the same floor area, even if the distribution of obstacles is relatively fixed or the outline of the area is fixed, it is impossible to guarantee that the posture of the robotic vacuum cleaner in the same position is exactly the same in each round of cleaning. Therefore, the environmental information recorded in the map built in each cleaning process is not exactly the same.

[0003] Therefore, how to manage the maps continuously built by robots has become an urgent problem to be solved in the process of robots using maps for localization. Summary of the Invention

[0004] To address the aforementioned problems, this invention discloses a method for managing robot maps. This method fully utilizes the relationship between the previously saved historical map (or the most recently saved map) and the currently created map to complete the saving of the currently created map. The specific technical solution of this invention is as follows:

[0005] A method for managing robot maps, the method comprising: step 1, the robot establishing a current map in the current environment; step 2, storing the current map in the historical map database according to the angle relationship between the current map and the map previously stored in the historical map database.

[0006] Further, the method of storing the current map in the historical map library based on the angular relationship between the current map and the map previously stored in the historical map library includes: the robot configuring the map previously stored in the historical map library as a reference historical map; if the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is less than a preset angle threshold, then the current map is stored in the historical map library, and the current map is then configured as the latest historical map stored in the historical map library; if the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is greater than or equal to the preset angle threshold, then the current map is controlled to rotate in a preset clockwise direction; each time the current map is controlled to rotate in a preset clockwise direction by a preset judgment angle, it is determined whether the absolute value of the deflection angle between the coordinate system of the rotated current map and the coordinate system of the reference historical map is less than the preset angle threshold. If yes, the rotated current map is stored in the historical map library and the current map is controlled to stop rotating; otherwise, the rotated current map is controlled to continue rotating in a preset clockwise direction by a preset judgment angle.

[0007] Furthermore, within a 360-degree angle range, during the process of the current map rotating in a preset clockwise direction for a first preset number of preset judgment angles, if the robot determines each time that the absolute value of the deflection angle between the coordinate system of the current map after rotation and the coordinate system of the reference historical map is greater than or equal to a preset angle threshold, then the current map after rotation will not be stored in the historical map library, and the current map will be controlled to stop rotating.

[0008] Furthermore, the robot sets the preset judgment angle to 90 degrees and the first preset quantity to 3. Within a 360-degree angle range, the robot controls the current map to rotate a maximum of 3 times in a preset clockwise direction to avoid turning the latest rotated current map into the original current map. When controlling the current map to rotate 90 degrees 3 times in a preset clockwise direction, if the absolute value of the deflection angle between the coordinate system of the latest rotated current map and the coordinate system of the reference historical map is greater than or equal to a preset angle threshold each time, then the current map after each rotation and the original current map are not stored in the historical map library, and the current map is controlled to stop rotating.

[0009] Furthermore, the current map is rotated clockwise by a preset judgment angle, which is configured such that the current map rotates 90 degrees around the origin of its coordinate system in a preset clockwise direction, so that the same coordinate position in the current map is transformed into the map area corresponding to a different quadrant of the current map's coordinate system after each rotation of the current map; wherein, the deflection angle between the coordinate system of the current map before and after the rotation and the coordinate system of the reference historical map is the angle formed by a coordinate axis of the current map before and after the rotation and a coordinate axis of the same type of the reference historical map's coordinate system; the preset angle threshold is less than 90 degrees.

[0010] Furthermore, when storing a second preset number of map frames in the historical map library, if the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is less than a preset angle threshold, then the earliest-stored map frame in the historical map library is first removed to free up storage space, and then the current map is stored in the historical map library to be configured as a new historical map; when storing a second preset number of map frames in the historical map library, if the absolute value of the deflection angle between the coordinate system of the rotated current map and the coordinate system of the reference historical map is less than a preset angle threshold, then the earliest-stored map frame in the historical map library is first removed to free up storage space, and then the rotated current map is stored in the historical map library to be configured as a new historical map.

[0011] Furthermore, the management method also includes: if the robot cannot access the historical map to locate its current position, and if no historical map is stored in the historical map library, then step 1 is executed; if the robot cannot access the historical map to locate its current position, and if a historical map is stored in the historical map library, then step 1 is executed to obtain the current map, and then it is determined whether the difference between the current map and the map previously stored in the historical map library is greater than a preset map threshold. If yes, the robot is determined to have entered a new environment; otherwise, the current map is not stored in the historical map library. The robot configures all maps stored in the historical map library as historical maps, with different environments corresponding to different historical maps. The map previously stored in the historical map library belongs to the historical map.

[0012] Further, the method for determining whether the difference between the current map and the map previously stored in the historical map library is greater than a preset map threshold includes: determining whether the difference between the area of ​​the current map and the area of ​​the reference historical map is greater than a preset area threshold; if so, determining that the robot leaves the current environment and enters a new environment and executing step 1 to build a map in the new environment; otherwise, not storing the current map in the historical map library; wherein, the area of ​​the current map is greater than the area of ​​the reference historical map, so that the current map covers coordinate positions not marked in the historical map; the ratio of the preset area threshold to the area of ​​the reference historical map is a preset matching ratio; wherein, the robot uses the map previously stored in the historical map library as the reference historical map.

[0013] Furthermore, when the robot detects that no map exists in the historical map library, the management method further includes: Step A1: After the robot completes its first walk through the current environment and synchronously establishes the current map, the robot searches for obstacle outlines and its walking trajectory in the current map, calculates the angle between the obstacle outline and the walking trajectory, and marks this angle as a preset offset angle; Step A2: When the robot determines that the preset offset angle is less than a preset error angle threshold, it stores the current map in the historical map library and configures the current map as the first frame map stored in the historical map library; then the robot determines the relationship between the preset offset angle and the preset error angle threshold; Step A3: When the robot determines that the preset offset angle is greater than or equal to the preset error angle threshold, it executes Step A1 until the number of executions of Step A1 reaches a preset number of traversals, and then executes Step A4; Step A4: From all the preset offset angles obtained in Step A3, the robot selects the current map corresponding to the preset offset angle with the smallest angle and stores it in the historical map library, and configures the current map as the first frame map stored in the historical map library.

[0014] Furthermore, the angle between the obstacle outline and the walking trajectory is the angle between the obstacle outline and the trajectory line along which the robot walks; wherein, the initial direction of the robot's walking trajectory is a coordinate axis parallel to the coordinate system of the current map.

[0015] Furthermore, the robot sets the first frame of the map stored in the historical map library as the initial historical map; when the robot detects that the initial historical map exists in the historical map library, it starts to execute step 1 or step 2; at the same time, the robot configures each frame of the map stored in the historical map library as a historical map, and each frame of the map stored in the historical map library represents the same environment.

[0016] Compared with existing technologies, the beneficial effects of this invention are as follows: Starting from the first frame of the map, each time a new map is created, the robot can save the currently created map based on the angular relationship between the current map and the previously saved map, excluding maps with large angular offset errors. This sequentially completes the management of historical maps with effective localization across multiple frames, making the historical map information more reasonably and effectively preserved. It enables the preservation of a map that is more consistent with the actual scene by saving historical map records based on the same environmental area, increasing the stability and richness of the map, maintaining the effectiveness of the robot's historical maps, and effectively improving the robustness of the mobile robot's mapping and localization algorithms.

[0017] Secondly, this invention supports comparing and matching the contour angles of maps generated after multiple runs of the same environmental area to obtain the first frame map with smaller offset error to be stored in the historical map library. On this basis, it supports rotating the same frame map to be saved (i.e., the current map) multiple times along the same direction, and comparing and matching the coordinate system angles with the previously saved historical map after each rotation to filter out the current map that can be saved. Thus, the current map is periodically matched and judged in combination with the historical map to obtain the map that can be stored in memory (corresponding to the historical map library) and complete the management of the map (including saving and removing (not saving directly or removing from memory)). Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating a robot map management method according to the present invention. Detailed Implementation

[0019] The following description, in conjunction with the accompanying drawings, further illustrates specific embodiments of the present invention, making the technical solution and its beneficial effects clearer and more explicit. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, but should not be construed as limiting the invention.

[0020] Figure 1 This is a flowchart of an embodiment of a robot map management method provided by the present invention, as shown below. Figure 1 As shown, the management method includes: Step 1, the robot establishes a current map within the current environment; this current map can be a grid map representing a two-dimensional planar area of ​​the current environment. Environmental information marked at each grid cell in the grid map includes the location of obstacles, locations not occupied by obstacles, or unknown locations. Each coordinate position has a corresponding grid cell to represent the specific physical location in the current environment. Simultaneously, work records are stored within a local area composed of multiple grid cells in the grid map, enabling the robot to more intelligently assign different tasks to different locations. For example, when used with a robotic vacuum cleaner, it can effectively record historical cleaning records. Even if cleaning is not completed, it can still return to complete the unfinished cleaning task regardless of the situation (such as power outage, temporary tasks, returning after changing environments, etc.). Therefore, the historical map recorded during the pre-traversal of the current environment can be used for subsequent navigation, positioning, and path planning.

[0021] It should be noted that the implementing entity of the management method is a robot, specifically a robot that internally stores historical maps. The map terrain outline is the outline that describes the current environment within the map. The map that the robot built last time or even earlier is a historical map used to represent the current environment relative to the current map built by the robot.

[0022] Step 2: Based on the angular relationship between the current map and the map previously stored in the historical map library, the current map is stored in the historical map library. This saves the current map whose angle matches the previously stored map, obtaining a map that better suits the actual navigation scenario and storing it directly in the historical map library. Then, the current map is updated to match the previously stored map. Each frame of the map stored in the same historical map library represents the current environment. In this embodiment, the map to be saved is determined based on the angular relationship between the current map and the previously stored map. This map is derived from the current map, excluding maps with large angular offset errors in the relevant coordinate axes. Preferably, this step does not require any update processing of the current map (including updating the occupancy probability information of relevant grids) before storing the selected current map in the historical map library. In this embodiment, after each execution of step 2, the robot needs to return to step 1, walk through the current environment again, and then execute step 2 again to maintain the matching and comparison of the subsequently established current map. The original current map has been stored in the historical map library to participate in the determination of the angle relationship between maps.

[0023] In some embodiments, the map first stored in the historical map library is set as a map that has not been updated, but rather a grid map marked by the collected location information and the obstacle conditions detected at that location when the robot first walks in the current environment. This is the baseline quantity for iteratively executing steps 1 and 2.

[0024] Combining steps 1 and 2 above, the beneficial effects of this embodiment are as follows: Starting from the first frame of the map, each time a new map is created, the robot can save the currently created map based on the angular relationship between the current map and the previously saved map, excluding maps with large angular offset errors. This sequentially completes the management of historical maps with effective positioning across multiple frames, making the historical map information more reasonably and effectively preserved. It enables the preservation of a map that is more consistent with the actual scene by saving historical map records based on the same environmental area, increasing the stability and richness of the map, maintaining the effectiveness of the robot's historical maps, and effectively improving the robustness of the mobile robot's mapping and positioning algorithms.

[0025] As one embodiment, the method of storing the current map in the historical map library based on the angular relationship between the current map and the map previously stored in the historical map library includes: the robot configuring the map previously stored in the historical map library as a reference historical map, which is the current map that the robot previously created in the same current environment; if the robot detects that the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is less than a preset angle threshold, it indicates that the current map and the reference historical map have a high similarity in the coordinate axis orientation, and the angular offset error between the two maps reaches a matching level, then the current map is stored in the historical map library, and then the current map is updated to the map previously stored in the historical map library. This ensures that the map newly stored in the historical map library reflects the actual distribution of obstacles in the robot's current environment, improving the robot's localization efficiency.

[0026] It should be noted that the deflection angle between the current map's coordinate system and the reference historical map's coordinate system is the angle between the Y-axis of the current map's coordinate system and the Y-axis of the reference historical map's coordinate system, or the angle between the X-axis of the current map's coordinate system and the X-axis of the reference historical map's coordinate system. The preset angle threshold is preferably 5 degrees. The angle between a coordinate axis of the current map's coordinate system and a coordinate axis of the same type in the reference historical map's coordinate system can be a clockwise deflection angle or a counter-clockwise deflection angle.

[0027] If the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is greater than or equal to a preset angle threshold, it indicates that the similarity between the current map and the reference historical map in the coordinate axis direction is low and does not reach the matching level. In this case, the current map is controlled to rotate in a preset clockwise direction. This rotation means that each grid cell in the current map can rotate clockwise or counterclockwise around the origin of the coordinate system, causing the relevant coordinate positions in the current map to rotate in the preset clockwise direction. This is done in conjunction with the reference historical map (as a reference template map) to correct the angle deflection error in the map. Each time the robot controls the current map to rotate by the preset judgment angle in the preset clockwise direction, it checks whether the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map after rotation is less than the preset angle threshold. If yes, the rotated current map is stored in the historical map library and the current map rotation stops; maps rotated earlier are not stored in the historical map library. Otherwise, the rotated current map continues to rotate by the preset judgment angle in the preset clockwise direction to continue correcting the angle deflection error in the map.

[0028] Based on the above embodiments, during the process of rotating the current map by a preset number of preset judgment angles in a preset clockwise direction, it is equivalent to performing a first preset number of rotation transformations. If, during each rotation transformation, the robot determines that the absolute value of the deflection angle between the coordinate system of the current map after rotation and the coordinate system of the reference historical map is greater than or equal to the preset angle threshold, then the current map after the last rotation will not be stored in the historical map library, nor will the map obtained after each rotation transformation of the same current map be stored in the historical map library. At the same time, the current map after the last rotation will be controlled to stop rotating, that is, the map created in the current environment will be controlled to stop rotating. If, at one point, it is determined that the absolute value of the deflection angle between the coordinate system of the current map after rotation and the coordinate system of the reference historical map is less than the preset angle threshold, it may be due to the movement of some furniture in the current environment. In this case, the current map after this rotation will be directly stored in the historical map library, and the current map will be controlled to stop rotating. In this embodiment, the operation of determining the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map after each rotation of the current map in a preset clockwise direction, and the series of operations of saving the rotated map form a task executed by the robot in one rotation cycle. It can execute up to a first preset number of rotation cycles within a 360-degree angle range.

[0029] Preferably, the robot sets the preset judgment angle to 90 degrees and configures the first preset quantity to a value of 3. Within a 360-degree angle range, the robot controls the current map to rotate a maximum of 3 times in a preset clockwise direction to avoid turning the current map after the last rotation into the original current map. Specifically, the current map after each rotation rotates by a preset judgment angle more in the preset clockwise direction than the previous current map; the angle rotated by the current map relative to the original map in the preset clockwise direction after each rotation is 90 degrees greater than the angle rotated by the current map relative to the original map in the preset clockwise direction after each rotation. During the process of rotating the current map 3 times in the preset clockwise direction, the robot may consecutively determine that the absolute value of the deflection angle between the coordinate system of the rotated current map and the coordinate system of the reference historical map is greater than or equal to the preset angle threshold, failing to meet the corresponding map matching requirements (the requirement of similarity matching between the rotated current map and the map previously stored in the historical map library in the coordinate axis direction). In such cases, the robot will not store the current map after each rotation and the original current map in the historical map library, and will control the current map to stop rotating.

[0030] The current map rotates 90 degrees clockwise around the origin of its coordinate system, so that the same coordinate position in the current map is transformed into the map area corresponding to a different quadrant of the current map's coordinate system after each rotation. If a frame of the original current map rotates 90 degrees three times clockwise, the first 90-degree rotation results in the current map rotating 90 degrees relative to the original map in the clockwise direction. The second 90-degree rotation results in the current map rotating 180 degrees relative to the original map. The third 90-degree rotation results in the current map rotating 270 degrees relative to the original map. Therefore, the current map is rotated in a preset clockwise direction by a preset judgment angle. This is configured so that the current map rotates 90 degrees around the origin of its coordinate system in a preset clockwise direction, so that after each rotation, the same coordinate position in the current map is transformed into the map area corresponding to a different quadrant of the original current map's coordinate system, that is, it is transformed into different quadrant areas of the same current map's coordinate system in sequence.

[0031] It should be noted that the deflection angle between the coordinate system of the current map before rotation and the coordinate system of the reference historical map is the angle between one coordinate axis of the current map before rotation and a coordinate axis of the same type in the coordinate system of the reference historical map; the deflection angle between the coordinate system of the current map after rotation and the coordinate system of the reference historical map is the angle between one coordinate axis of the current map after rotation and a coordinate axis of the same type in the coordinate system of the reference historical map; the preset angle threshold is less than 90 degrees, preferably 5 degrees.

[0032] Preferably, when storing a second preset number of map frames in the historical map library, if the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is less than a preset angle threshold, the earliest stored map frame in the historical map library is removed to free up storage space, and the rotated current map is configured as the first current map, and then the first current map is stored in the historical map library; the second preset number is preferably 10, and the historical map library is a linear storage space opened up inside the robot.

[0033] It is understandable that if a map is used less frequently in the historical map library and was stored earlier, it can be determined as an invalid map and can be deleted from the historical map library first. In this embodiment, the decision to save the current map is based on the angular relationship between the current map and the map that was last stored in the historical map library. Whether the current map can be saved depends on the last time it was stored in the historical map library (the latest storage time). Therefore, the map that was last stored in the historical map library is used more frequently than the map that was stored earliest.

[0034] As one embodiment, the management method further includes: when the robot cannot access historical maps to locate its environment, if no historical map is stored in the historical map library, step 1 can be executed to begin building a map in the new environment. The built map is then configured as the first current map until it meets the conditions for storage in a historical map library (corresponding to the condition of storing the first frame map in a historical map library that has not previously stored a map). After this condition is met, the first current map is added to the historical map library, becoming the first frame map stored in the historical map library, thus satisfying the robot's positioning needs within its environment, specifically, satisfying the positioning needs of the robot's current location. In this embodiment, the robot configures all maps stored in the historical map library as historical maps. Different environments correspond to different historical maps, and the map previously stored in the historical map library belongs to the historical map category.

[0035] If the robot is unable to access historical maps to determine its environment or current location, and if historical maps are stored in the historical map library, then step 1 is executed to obtain the current map. This can be continuously obtained during the robot's movement, and the robot is moving in a new environment. Then, it is determined whether the difference between the current map and the map previously stored in the historical map library is greater than a preset map threshold. If so, it is determined that there is no map in the historical map library that matches the current map, and the robot has entered a new environment. Step 1 is then executed again to expand the map coverage area or recreate a new map. The newly created map or the expanded map is then configured as the first current map. This process continues until the first current map meets the conditions for storing in a historical map library (including the angular relationship between the current map disclosed in the aforementioned embodiments and the map previously stored in the historical map library). Once the first current map meets these conditions, it is stored in the historical map library. Otherwise, it is determined that the robot's current environment has changed slightly, and the first current map is not stored in the historical map library for the time being.

[0036] Understandably, robots require a map for both navigation and path planning. Single or multiple sensors, such as LiDAR, depth cameras, infrared rangefinders, ultrasonic sensors, gyroscopes, and odometry, can be mounted on the robot to serve as input data for mapping and localization algorithms. The map records the locations of obstacles in the environment, areas the robot can move to without obstacles, and unknown, unexplored areas. It should be noted that the current map and maps pre-stored in the historical map database can be partial or complete maps, and must have a defined coordinate system and sufficient obstacle features to ensure that the coordinate axes of the historical maps used later remain parallel to the coordinate system of the initial map created in the same environment.

[0037] The robot can store multiple historical maps in the historical map database, such as... Figure 1 Maps 2 and 3 are used to match the current map with historical maps when the robot is moved to a new environment to determine whether the robot is in a historical environment or a new environment. All historical maps stored in the same historical map library represent the same environmental conditions.

[0038] In some embodiments, similar to the relocation method, multiple confirmations are required to determine which environment the robot is in, and the corresponding historical work and interaction data are retrieved. During the multiple confirmations, a current map is built and relevant data is recorded. If it cannot be determined which historical map in the historical map library the current environment belongs to, the size relationship between the area of ​​the current map and the historical map is then judged to determine whether the environment in which the robot is in is a new environment. Specifically, the method for determining whether the difference between the current map and the map previously stored in the historical map library is greater than a preset map threshold includes: determining whether the difference between the area of ​​the current map and the area of ​​the reference historical map is greater than a preset area threshold; if so, it is determined that the robot leaves the current environment and enters a new environment, specifically if the robot's environment has changed significantly, such as changing the environment or significantly moving the furnishings in the environment, and step 1 needs to be executed again to build a map in the new environment; otherwise, it is determined that the robot's current environment has changed slightly, and then the robot does not store the current map in the historical map library; wherein, the area of ​​the current map is greater than the area of ​​the reference historical map so that the current map covers coordinate positions not marked in the historical map; the ratio of the preset area threshold to the area of ​​the reference historical map is a preset matching ratio, which is preferably 0.5.

[0039] Based on the aforementioned embodiments, whenever the robot starts walking, it first checks if a historical map library exists in a dedicated storage space; if not, it creates one. Specifically, based on the robot's environment and the usage of historical maps, three floors of historical map libraries are set up, with one historical map library corresponding to one floor. Each historical map library stores multiple map frames. The attribute information of each map frame stored in each historical map library includes one or more of the following: interface map information (data used for visual interface monitoring and interaction on mobile terminals), grid map information (used for updating the occupancy probability of grid points and calculating grid position coordinates), landmark information (settings for the distribution of obstacles in the actual environment (such as furniture, walls, and isolated objects on the ground)), and room area division information. No specific limitations are imposed here. The robot or external mobile terminal can modify, search, and / or delete historical maps in the historical map library and / or store new maps in the historical map library through a unified read, write, and delete interface module. It should be added that each of the aforementioned historical map libraries is configured with a floor number, and each map frame stored in the historical map library is configured with a map number. When the robot imports a map with the corresponding map number, it can import the attribute information of the map with the corresponding map number to assist in controlling the robot's working mode. In particular, when the robot determines that the difference between the area of ​​the current map and the area of ​​the reference historical map is greater than a preset area threshold, it determines that the robot is leaving the current floor and entering a new floor. In this case, it needs to perform step 1 to create a map in the new floor, and can select the floor number through a unified interface module, and then store the newly created map in the historical map library of the corresponding floor number.

[0040] As one embodiment, if the robot detects that no map exists in the historical map database, during its movement within the current environment or after completing a traversal of the current environment, the robot selects the current map containing the angle that satisfies a preset angle condition and stores it in the historical map database. This forms the earliest stored map frame in the historical map database, i.e., the first map frame stored in the historical map database. The robot's movement trajectory can be a planned path, including a bow-shaped trajectory, a loop-shaped trajectory, or a crisscrossing trajectory. In some embodiments, the robot's movement trajectory may include a straight line formed by the robot moving along the positive Y-axis of the coordinate system of the currently established map. This line is formed during a period after the robot begins mapping, allowing the robot to move in a bow-shaped pattern based on the direction of the positive X-axis or positive Y-axis of the new coordinate system. In some embodiments, the robot's movement trajectory may be a trajectory formed by moving along the obstacle's outline. In this embodiment, the angle formed by the obstacle's outline and the robot's movement trajectory is sufficiently small to satisfy the preset angle condition. After selecting the current map containing the included angle that meets the preset angle conditions and storing it in the historical map library, the robot executes step 1 to continue building the current map in the current environment. Then, in step 2, the current map can compare the angle relationship of the coordinate axes with the first frame map stored in the historical map library, or compare the area size relationship with the first frame map stored in the historical map library.

[0041] As one embodiment, the specific method for selecting the current map containing the angle that satisfies the preset angle condition and storing it in the historical map database based on the angle formed by the obstacle outlines and the robot's walking trajectory in the current map includes:

[0042] Step A1: After the robot completes its first exploration of the current environment and synchronously establishes the current map, it searches for obstacle outlines and its own trajectory on the current map. It then calculates the angle between the obstacle outline and the trajectory and marks this angle as a preset offset angle. The method for searching for obstacle outlines and the robot's trajectory from the map image can be Hough transform (to find straight lines) or extended to generalized Hough transform (to find arcs). Alternatively, it can calculate the angle between the tangent at the obstacle outline point and the trajectory. The robot then determines the relationship between the preset offset angle and a preset error angle threshold, which can be done by comparing all preset offset angles with the preset error angle threshold. Finally, the robot executes step A2.

[0043] It should be noted that the robot may not necessarily follow the contour lines of obstacles or the current environment completely. The contour lines formed by connecting the corresponding grids or pixels in the robot's pre-stored map (historical map) approximate the contour lines of obstacles or walls as closely as possible.

[0044] Preferably, to reduce the search and computation workload, the robot finds the obstacle outline and the robot's walking trajectory from the current map, which are respectively the obstacle outline and the trajectory the robot has walked along the obstacle outline. Then, the robot sets the angle between the obstacle outline and the walking trajectory mentioned in step A1 as the angle between the obstacle outline and the trajectory the robot has walked along the obstacle outline. Wherein, when the obstacle outline and the trajectory the robot has walked along the obstacle outline are respectively transformed by Hough transform to obtain r (geometric perpendicular distance from the origin to the straight line), the absolute value of the difference between the r corresponding to the obstacle outline and the r corresponding to the trajectory the robot has walked along the obstacle outline is less than a preset distance threshold, which is less than the robot's body radius, and the r value corresponding to the obstacle outline and the r value corresponding to the trajectory the robot has walked along the obstacle outline are obtained at the same time. The initial direction of the robot's walking trajectory is parallel to a coordinate axis of the current map's coordinate system. For example, the initial direction of the robot's walking trajectory points to the positive Y-axis. The obstacles that the robot follows are generally walls or furniture with relatively flat outlines, so that the magnitude of the preset offset angle can be continuously monitored by relying on the coordinate axis direction to obtain a more accurate preset offset angle.

[0045] Step A2: When the robot determines that the preset offset angle is less than the preset error angle threshold, it stores the current map in the historical map library and configures this current map as the first frame map stored in the historical map library, corresponding to the initial historical map, so as to facilitate map matching with the subsequently established current map, including comparison of the angles between coordinate axis directions and comparison of map area size; then the robot executes step A3. In some embodiments, it is necessary to calculate and determine that the angles formed by all obstacle contour lines and the trajectory line along which the robot walks along the obstacle contour line are all less than the preset error angle threshold before determining that the offset error of the current map can be ignored, that is, the error of the robot in locating the obstacle contour during walking is relatively small, and then the current map can be stored in the historical map library.

[0046] Step A3: When the robot determines that the preset offset angle is greater than or equal to the preset error angle threshold, the current map established in the latest executed step A1 is saved as a temporary map. The temporary map and the preset offset angle mentioned in step A3 are then cached in a memory space different from the historical map library. The initial value of the execution count of step A1 is equal to the value 0. Then, the execution count of step A1 is incremented by one, which means that the number of times the robot traverses in the current environment is incremented by one. Then, step A1 is executed again. This process is repeated until the execution count of step A1 reaches the preset number of traversals. Then, step A4 is executed. Preferably, the preset number of traversals is equal to the value 3.

[0047] Step A4: From all the preset offset angles obtained in step A3, the robot selects the current map corresponding to the preset offset angle with the smallest angle and stores it in the historical map library. This current map is then configured as the first frame map stored in the historical map library, and it is determined that this current map is the current map containing the included angle that satisfies the preset angle condition. When the preset traversal count is equal to 3, the robot obtains three temporary maps and a preset offset angle corresponding to each temporary map. It should be noted that each frame map stored in the historical map library represents the same environment.

[0048] In the aforementioned steps, the robot sets the first frame of the map stored in the historical map library as the initial historical map. Then, when the robot detects that the initial historical map exists in the historical map library, it starts executing step 1 or step 2, thereby using the initial historical map as the initial quantity to drive the iterative execution of step 1 and step 2, continuously building a new current map in the same environment, obtaining map information that is more consistent with the actual environment in which the robot is located, facilitating path planning and navigation positioning, and improving the robot's working efficiency.

[0049] Understandably, before obtaining the robot's current pose information and walking time, it is necessary to obtain a grid map of the robot's environment or the current environment. For example, the grid map of the current environment can be read from the historical map library. For a robotic vacuum cleaner, if it is the first cleaning of the current environment, or the first cleaning after a robot reset or resetting process, a grid map of the current environment can be generated using the robot's sensor data and stored in the robot's historical map library. This serves as the historical map for the next cleaning cycle or as a basis for saving the current map constructed during the next cleaning cycle. In this embodiment, the historical map can be a two-dimensional grid map, including coordinate axis orientation information (which can be used to represent the robot's walking trajectory) and two-dimensional position information, to reduce the size of the map file in the historical map library and save storage space.

[0050] In summary, the aforementioned embodiments of the present invention support the angle comparison and matching of the contour lines of maps generated after multiple runs of the same environmental area to obtain the first frame map with smaller offset error for storage in the historical map library; on this basis, it supports rotating the same frame map to be saved (i.e., the current map) multiple times along the same direction, and after each rotation, comparing and matching the coordinate system angles with the previously saved historical map to filter out the current map that can be saved; thereby combining the historical map to complete the periodic angle matching judgment of the current map, obtaining the map that can be stored in memory (corresponding to the historical map library), and completing the management of the map (including saving and removing (directly not saving or removing from memory)).

[0051] To construct the current map, when the robot is at the starting point of the bow-shaped walking line in the current environment, a new coordinate system is constructed using the origin of the original coordinate system as the new origin. The robot begins to walk in a bow shape according to the direction of the positive X-axis or positive Y-axis of the new coordinate system. When it collides with an obstacle, it walks along the outline of the obstacle and simultaneously marks the detected environmental information and the robot's pose information at each coordinate position in the coordinate system to form a grid map. The environmental information marked at each grid includes grid positions occupied by obstacles, grid positions not occupied by obstacles, or unknown grid positions. These grid positions represent the physical position of the robot in the current environment, specifically indicating the collision situation or passability of the robot with obstacles in the current environment.

[0052] It should be added that the robot obtains straight lines from the map and calculates the angle between the straight line and the robot's direction of movement (which can be represented by the coordinate axis direction). The robot detects straight lines in the map using the Hough transform algorithm. Each pixel coordinate point is transformed into a unified metric that contributes to the characteristics of the straight line. For example, a straight line in an image is a set of discrete points. The discrete polar coordinate formula of a straight line can be used to express the geometric equation of the discrete points of the straight line as follows: X * cos(theta) + y * sin(theta) = r, where the angle theta refers to the angle between r and the X-axis, and r is the geometric perpendicular distance to the straight line. Any point on the straight line can be represented by x and y, where r and theta are constants. In the field of map image processing, the pixel coordinates P(x, y) of the image are known, while r and theta are the variables to be found, forming two parameters of the Hough transform of a straight line. Whenever the robot searches for a straight line in the current map and finds the corresponding two parameters, it is determined that the straight line has been found, and the angle between the straight line and the coordinate axis is obtained. At the same time, the straight-line distance between the straight line and the origin of the coordinate system of the current map is calculated. Then, when the outline of the obstacle to be found and the walking trajectory are both straight lines, the angle between the outline of the obstacle and the walking trajectory is obtained by the angle difference.

[0053] Preferably, to reduce the search and computation workload, the robot finds the obstacle outline and the robot's walking trajectory from the current map, which are respectively the obstacle outline and the trajectory the robot walks along the obstacle outline. Then, the robot sets the angle between the obstacle outline and the walking trajectory mentioned in step A1 as the angle between the obstacle outline and the trajectory line the robot walks along the obstacle outline. When the obstacle outline and the trajectory line the robot walks along the obstacle outline are respectively transformed by Hough to obtain r values ​​(geometric perpendicular distance from the origin to the straight line), the absolute value of the difference between the r value corresponding to the obstacle outline and the r value corresponding to the trajectory line the robot walks along the obstacle outline is less than a preset distance threshold, which is less than the robot's body radius, and the r value corresponding to the obstacle outline and the r value corresponding to the trajectory line the robot walks along the obstacle outline are obtained at the same time. The initial direction of the robot's walking trajectory is parallel to a coordinate axis of the current map's coordinate system. For example, the initial direction of the robot's walking trajectory points to the positive Y-axis. The obstacles that the robot follows are generally walls or furniture with relatively flat outlines, so that the magnitude of the preset offset angle can be continuously monitored by relying on the coordinate axis direction to obtain a more accurate preset offset angle.

[0054] If each (r, theta) value is plotted based on the pixel coordinates P(x, y), then the image is transformed from the Cartesian coordinate system to the polar coordinate Hough space system. This transformation from point to curve is called the Hough transform of a line. The transformation is achieved by quantizing the Hough parameter space into a finite number of equally spaced or accumulated grids. When the Hough transform algorithm starts, each pixel coordinate point P(x, y) is transformed onto the curve point of (r, theta) and accumulated into the corresponding grid data point. When a peak appears, it indicates the existence of a line. Converting the pixel coordinates of the line to the robot's coordinates yields the angle of the line, which is the angle between the line and the robot's wheel axis or walking direction. It should be noted that the core idea of ​​the Hough transform is to map a set of points (two-dimensional) belonging to a certain shape in the map to a point (which can be high-dimensional). This point records the number of points in the set, and this point is the parameter of the shape to be searched. The range of this parameter is called the parameter space, i.e., the reference coordinate mapping space. The Hough transform can not only identify whether a graphic to be detected exists in a scanned map, but also locate that graphic (including its position, angle, etc.). When the feature to be extracted is located within a set of points and can be mathematically described, the Hough transform can be used for searching. The Hough transform is a method for detecting straight lines and various geometric shapes in a binary image. Considering the many linear features present in the walls inside buildings, this embodiment focuses on the detection of straight lines in the raster map. Each straight line representing the contours of walls and furniture in the map can be associated with a pair of parameters (r, theta). The two-dimensional plane containing this pair of parameters (r, theta) is defined as the Hough space, which is the set of two-dimensional straight lines.

[0055] It's worth noting that, given the diversity of obstacle shapes and distributions in the robot's environment, a generalized approach can be taken, which is known as the Generalized Hough Transform. The reason the Generalized Hough Transform can handle arbitrary shapes isn't because it has found an equation that can represent any shape, but rather because it describes a shape in tabular form, storing the coordinates of its edge points in a table. This determines the shape. Therefore, whether it's a straight line (actually a line segment), a circle, an ellipse, or other geometric shapes, the same method can be used. The difference is that the shape in this case is custom-defined and concrete, while the algebraic equation represents a continuous and abstract pattern. There's only one equation for a circle, but the number of custom circles is infinite; as long as you consider it round enough, it's acceptable.

[0056] The application of the Generalized Hough Transform (GWT) provides a foundation for exploration in Yanbian. Existing technologies can only repeatedly traverse unknown points, resulting in numerous repetitive routes and low efficiency. Furthermore, the GWT is not limited to straight lines; it can adapt its detection process to different environments based on actual conditions (such as curves with specific curvatures or ellipses). Considering the many linear features in the walls inside buildings, this embodiment focuses on the detection of straight lines in the raster map.

[0057] In the description of this specification, the terms "in one embodiment," "preferred," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. The illustrative expressions of the above terms in this specification do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. The connection methods linked in the description of this specification have significant effects and practical utility.

[0058] Based on the above description of the structure and principle, those skilled in the art should understand that the present invention is not limited to the specific embodiments described above. Improvements and substitutions made using techniques known in the art based on the present invention all fall within the protection scope of the present invention and should be defined by the claims.

Claims

1. A method for managing robot maps, characterized in that, The management method includes: Step 1: The robot creates a map within the current environment; Step 2: Based on the angular relationship between the current map and the map previously saved to the historical map library, save the current map to the historical map library; The method for storing the current map in the historical map database based on the angular relationship between the current map and the map previously stored in the historical map database includes: The robot will configure the map that was last stored in the historical map library as the reference historical map; If the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is less than a preset angle threshold, the current map is stored in the historical map library, and then the current map is configured as the latest historical map stored in the historical map library. If the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is greater than or equal to a preset angle threshold, then the current map is controlled to rotate in a preset clockwise direction. Each time the current map is controlled to rotate in a preset clockwise direction by a preset judgment angle, it is determined whether the absolute value of the deflection angle between the coordinate system of the current map after rotation and the coordinate system of the reference historical map is less than the preset angle threshold. If yes, the current map after rotation is stored in the historical map library and the current map is controlled to stop rotating. Otherwise, the current map after rotation is controlled to continue rotating in a preset clockwise direction by a preset judgment angle. Within a 360-degree angle range, during the process of the current map rotating in a preset clockwise direction for a first preset number of preset judgment angles, if the robot determines each time that the absolute value of the deflection angle between the coordinate system of the current map after rotation and the coordinate system of the reference historical map is greater than or equal to a preset angle threshold, then the current map after rotation will not be stored in the historical map library, and the current map will be controlled to stop rotating. If the robot sets the preset judgment angle to 90 degrees and the first preset quantity to 3, then the robot can control the current map to rotate up to 3 times in a preset clockwise direction within a 360-degree angle range, so as to avoid turning the current map after the latest rotation into the original current map. If the current map is rotated 90 degrees three times in a preset clockwise direction, and the absolute value of the deflection angle between the coordinate system of the current map after the latest rotation and the coordinate system of the reference historical map is greater than or equal to a preset angle threshold each time, then the current map after each rotation and the original current map will not be stored in the historical map library, and the current map will be stopped from rotating.

2. The management method according to claim 1, characterized in that, The current map rotates clockwise by a preset angle. The preset judgment angle is configured so that the current map rotates 90 degrees around the origin of its coordinate system in a preset clockwise direction, so that the same coordinate position in the current map is transformed into the map area corresponding to different quadrants of the current map's coordinate system after each rotation of the current map. The deflection angle between the coordinate system of the current map before and after rotation and the coordinate system of the reference historical map is the angle between a coordinate axis of the current map before and after rotation and a coordinate axis of the same type in the coordinate system of the reference historical map; the preset angle threshold is less than 90 degrees.

3. The management method according to claim 1, characterized in that, When a second preset number of map frames are stored in the historical map library, if the absolute value of the deflection angle between the coordinate system of the current map and the coordinate system of the reference historical map is less than a preset angle threshold, the earliest stored map frame in the historical map library is removed to free up storage space, and then the current map is stored in the historical map library to be configured as a new historical map. If a second preset number of map frames are stored in the historical map library, and the absolute value of the deflection angle between the coordinate system of the rotated current map and the coordinate system of the reference historical map is less than a preset angle threshold, then the earliest stored map frame in the historical map library is removed to free up storage space, and then the rotated current map is stored in the historical map library to be configured as a new historical map.

4. The management method according to claim 1, characterized in that, The management method also includes: If the robot is unable to access historical maps to locate its current position, and if no historical map is stored in the historical map library, then proceed to step 1. If the robot is unable to access the historical map to locate its current position, and if the historical map is stored in the historical map library, then step 1 is executed to obtain the current map. Then, it is determined whether the difference between the current map and the map previously stored in the historical map library is greater than a preset map threshold. If yes, the robot is determined to have entered a new environment; otherwise, the current map is not stored in the historical map library. The robot configures all maps stored in the historical map library as historical maps. Different environments correspond to different historical maps, and the map that was last stored in the historical map library belongs to the aforementioned historical maps.

5. The management method according to claim 4, characterized in that, The method for determining whether the difference between the current map and the map previously stored in the historical map database exceeds a preset map threshold includes: If the difference between the area of ​​the current map and the area of ​​the reference historical map is greater than a preset area threshold, the robot leaves the current environment and enters a new environment, and executes step 1 to build a map in the new environment; otherwise, the current map is not stored in the historical map library. The area of ​​the current map is greater than the area of ​​the reference historical map so that the current map covers coordinate positions not marked in the historical map. The ratio of the preset area threshold to the area of ​​the reference historical map is a preset matching ratio. The robot uses the map that was last stored in the historical map library as a reference historical map.

6. The management method according to claim 1, characterized in that, If the robot detects that no map exists in the historical map database, the management method further includes: Step A1: After the robot has completed its first walk through the current environment and simultaneously established the current map, the robot searches for the outline of the obstacle and the robot's walking trajectory in the current map, calculates the angle between the outline of the obstacle and the walking trajectory, and marks the angle as the preset offset angle. Step A2: When the robot determines that the preset offset angle is less than the preset error angle threshold, it stores the current map in the historical map library and configures the current map as the first frame map stored in the historical map library; then the robot determines the relationship between the preset offset angle and the preset error angle threshold. Step A3: When the robot determines that the preset offset angle is greater than or equal to the preset error angle threshold, it executes step A1 until the number of times step A1 is executed reaches the preset number of traversals, and then executes step A4. Step A4: From all the preset offset angles obtained in step A3, the robot selects the current map corresponding to the preset offset angle with the smallest angle and stores it in the historical map library, and configures the current map as the first frame map stored in the historical map library.

7. The management method according to claim 6, characterized in that, The angle between the obstacle outline and the walking trajectory is the angle between the obstacle outline and the trajectory line along which the robot walks. The initial direction of the robot's walking trajectory is parallel to a coordinate axis of the current map's coordinate system.

8. The management method according to claim 7, characterized in that, The robot sets the first frame of the map stored in the historical map library as the initial historical map; When the robot detects that the initial historical map exists in the historical map database, it begins to execute either step 1 or step 2. At the same time, the robot configures each map frame stored in the historical map library as a historical map, and each map frame stored in the historical map library represents the same environment.