A method, apparatus, robot, and storage medium for map construction
By serializing the first map and generating data packets, loading and optimizing the second map, the problem of large map reuse error in the prior art is solved, and efficient and accurate map secondary construction is achieved, reducing costs and improving efficiency.
Patent Information
- Application Number
- CN202210239320.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-03-11
AI Technical Summary
The existing map reuse method has large errors in the map building when the environment changes greatly, and even cannot splice two maps. The cost of rebuilding the map is high and the efficiency is low.
By serializing the first map and generating a data packet in a preset file format, saving and loading the data packet to generate a first map, robot relocation is performed based on the first map, if successful, a second map is constructed based on the environmental information, and the first map and the second map are jointly optimized to achieve interaction and complementation of the map.
The success rate and accuracy of secondary construction of larger maps has been improved, the cost has been reduced, the efficiency of construction has been improved, and the problems of rebuilding, missing construction, and reconstruction have been solved.
Smart Images

Figure CN114661937B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of map construction, and in particular, to a map construction method, device, robot, and storage medium. Background Art
[0002] Existing indoor commercial robot mapping solutions mainly rely on sensors such as lasers, IMUs, and odoms (wheel odometers). By using the IMU and odom as predicted values and fusing laser data as observed values, a relatively accurate mapping result can be obtained. Currently, most industrial survey mapping is carried out by remotely controlling or manually pushing the robot, which is time-consuming and laborious and requires a large amount of manpower and material resources. It can be imagined that no scenario is static, and there will inevitably be environmental changes. When the environment changes greatly, the previously built prior map will become invalid, and the robot cannot be normally positioned under an invalid map. At this time, re-mapping is required. However, scene changes often only occur in certain sections, and re-mapping would be extravagant and wasteful. Moreover, when the scene is particularly large, re-building would be a particularly troublesome task. Or some mapping scenarios have highly similar structures. For example, the guest rooms in a hotel may have similar structures on each floor, and only some sections are different. Then, re-building a map for each floor would undoubtedly be time-consuming and laborious, and the higher the hotel, the greater the cost. At this time, the method of map reuse can be used to solve the above problems.
[0003] In the process of implementing the embodiments of the present application, the inventors of the present application found that: in the existing map reuse methods, one is to re-map the sections where the environment has changed, and then fill the built map onto the previous map through image stitching means (similar to PS). However, this solution only considers the pixel information of the map and does not incorporate more sensor information and constraint information. When the constructed map is small, there may not be too many problems. When a larger map needs to be rebuilt, it will introduce a large mapping error, and even the two maps cannot be stitched together (even when running under the same mapping algorithm and playing the same dataset, the mapping results are random each time). The other is to directly re-construct the map. Although this method can solve the problem, it increases the labor cost. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a map construction method, device, robot, and storage medium, which can improve the success rate and accuracy of large-scale mapping, reduce costs, and have high efficiency without introducing additional sensors and without significantly increasing computing power. Figure 2
[0005] To solve the above technical problems, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a map construction method, including:
[0007] Serialize the first map, generate a data packet in a preset file format, and save the data packet;
[0008] When it is necessary to construct a map, load the data packet and deserialize it to generate the first map;
[0009] Perform robot relocalization based on the first map;
[0010] If the robot is successfully located, construct a second map according to the acquired environmental information;
[0011] Jointly optimize the first map and the second map.
[0012] In some embodiments, the serializing the first map, generating a data packet in a preset file format, and saving the data packet includes:
[0013] Serialize the first map based on a serialization tool and generate the data packet in a preset file format;
[0014] Divide the data packet into multiple data blocks;
[0015] Share and save the multiple data blocks to local storage or the cloud.
[0016] In some embodiments, the dividing the data packet into multiple data blocks includes:
[0017] Divide the data packet into multiple data blocks corresponding to submap data, keyframe data, constraint data of keyframes, odometry information, and inertial sensor information.
[0018] In some embodiments, the preset file format is a binary file format.
[0019] In some embodiments, the method further includes:
[0020] If the robot is not successfully located, control the robot to move a preset distance and then start relocalization until relocalization is successful or the number of relocalization failure times reaches a preset number.
[0021] In some embodiments, the constructing a second map according to the acquired environmental information includes:
[0022] Acquire environmental information according to a camera device or a lidar, and extract target keyframes;
[0023] Establish constraints between the target keyframes and the historical keyframes of the first map, and construct a second map with the target keyframes.
[0024] In some embodiments, the joint optimization of the first map and the second map includes:
[0025] Performing pose graph optimization on the first pose graph corresponding to the first map to obtain an optimized first pose graph;
[0026] Performing pose graph optimization on the second pose graph corresponding to the second map to obtain an optimized second pose graph;
[0027] Integrating the optimized first pose graph and the optimized second pose graph to generate a complete SLAM map.
[0028] In a second aspect, an embodiment of the present application further provides a map construction device, and the device includes:
[0029] A serialization module, configured to serialize the first map, generate a data packet in a preset file format, and save the data packet;
[0030] An anti-serialization module, configured to load the data packet and anti-serialize to generate the first map when a map needs to be constructed;
[0031] A repositioning module, configured to perform robot repositioning based on the first map;
[0032] A construction module, configured to construct a second map according to the acquired environmental information if the robot is successfully positioned;
[0033] An optimization module, configured to jointly optimize the first map and the second map.
[0034] In a third aspect, the present application further provides a robot, and the robot includes:
[0035] At least one processor, and
[0036] A memory, the memory is communicatively connected to the processor, and the memory stores instructions executable by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method as described in the first aspect.
[0037] In a fourth aspect, the present application further provides a non-volatile computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a robot, the robot is enabled to execute the method as described in any item of the first aspect.
[0038] Beneficial effects of the embodiments of the present application: Different from the prior art, the map construction method, device, robot, and storage medium provided by the embodiments of the present application serialize the first map, generate a data packet in a preset file format, and then save the data packet, which can reduce the file size of the first map. If it is necessary to construct a map, the data packet is loaded and deserialized to generate the first map. Then, based on the first map, robot relocalization is performed. If the robot is successfully located, it indicates that the environment to be mapped currently has little difference from the mapping environment of the first map. Then, a second map is constructed according to the obtained environmental information, and the first map and the second map are jointly optimized to enable interaction between the first map and the second map, thereby realizing the construction of the second map. Through the secondary map construction after the first map, problems such as large map supplementation, missing construction, and reconstruction can be effectively solved. Moreover, the map reuse cost is low, the computing power is not significantly increased, the success rate and accuracy of the secondary map construction can be improved, and the map construction efficiency is high. Brief Description of the Drawings
[0039] One or more embodiments are exemplarily illustrated by the pictures in the corresponding drawings. These exemplary illustrations do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the drawings do not constitute a proportional limitation.
[0040] Figure 1 It is a schematic flowchart of an embodiment of the map construction method of the present application;
[0041] Figure 2 It is a schematic diagram of the map of the second floor of a certain hotel in the map construction method of the present application;
[0042] Figure 3 It is a schematic diagram of the map of the third floor of a certain hotel in the map construction method of the present application;
[0043] Figure 4 It is a schematic structural diagram of an embodiment of the map construction device of the present application;
[0044] Figure 5 It is a schematic structural diagram of another embodiment of the map construction device of the present application;
[0045] Figure 6 It is a schematic hardware structure diagram of the controller in an embodiment of the robot of the present application. Detailed Embodiments
[0046] The present application will be described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that those of ordinary skill in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0047] In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] It should be noted that if there is no conflict, the various features in the embodiments of the present application can be combined with each other, and all are within the protection scope of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the flowchart. In addition, the terms "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and roles.
[0049] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in this specification in the description of the present application are only for the purpose of describing specific embodiments and are not used to limit the present application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0050] In addition, the technical features involved in the various embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0051] The map construction method and device provided by the embodiments of the present application can be applied to a robot. It can be understood that the robot includes sensors such as a controller, a lidar, an inertial measurement unit (imu), and a wheel odometer (odom), and a camera. The lidar is used to obtain the point cloud data of the environment where the robot is located. The inertial measurement unit (imu) generally includes an accelerometer, a gyroscope, and a magnetometer. Displacement information can be obtained through double integration of acceleration, and sensor information of three angles can be obtained through integration of angular velocity. As the main control center, the controller obtains the point cloud data from the lidar, without introducing additional sensors, can improve the success rate and accuracy of secondary mapping on the basis of not significantly increasing the computing power, can reduce costs, and has high efficiency.
[0052] It is understandable that the robot is a movable robot, which can be an indoor robot for building a map indoors or an outdoor robot for building a map outdoors. Moreover, the robot also includes other types of sensors to obtain information such as optical flow, sonar, and camera, which are saved for map building and subsequent map reuse, and the built map is a relatively large map, such as a floor plan of a certain floor in a hotel.
[0053] Please refer to Figure 1 , which is a schematic flowchart of an embodiment of the map building method applied to the present application. The method can be executed by a controller in the robot, and the method includes steps S101 - S105.
[0054] S101: Serialize the first map, generate a data packet in a preset file format, and save the data packet.
[0055] In some embodiments, for the construction of the first map, SLAM (Simultaneous Localization and Mapping) mapping is used. Laser SLAM mapping can be adopted. Laser SLAM mapping is mainly based on the principle of laser ranging. Point cloud data of the surrounding environment is collected by a lidar set on the robot. Among them, the point cloud data includes the angular information and distance information between the lidar and surrounding objects. Then, by matching and comparing the point cloud data at different times, the pose information of the lidar can be calculated, and based on the lidar pose information, the movement trajectory of the robot can be obtained, and then a sub-map can be constructed. Among them, the lidar pose information can include the relative movement distance and attitude change amount of the lidar, that is, the lidar pose information corresponds to key frames. The sub-map can be a 2D grid map, a 2D topological map, a 3D point cloud map, or a 3D mesh map, etc.
[0056] After constructing multiple sub-maps, the first map is obtained. The first map is a global map, including several sub-maps. The sub-map is a local map of a global map, that is, a global map includes several local maps, and there are overlapping and coincident parts between the sub-maps. And there is a constraint relationship between the key frames.
[0057] Among them, the key frame is the key frame where the laser of the robot's current position is located, which is the positioning result and is the basic unit for forming a sub-map. Multiple key frames form a sub-map.
[0058] The constraint relationship is the relationship of the relative positions between key frames.
[0059] After obtaining the first map, establish a constraint relationship for several key frames of the first map to obtain the first map.
[0060] After constructing the first map, in order to reduce the file size of the first map, in some embodiments, the first map is serialized, and a data packet is generated in a preset file format, and the data packet is saved, which may include:
[0061] Serialize the first map based on a serialization tool and generate the data packet in a preset file format;
[0062] Divide the data packet into multiple data blocks;
[0063] Share and save the multiple data blocks to local storage or the cloud.
[0064] Specifically, use a serialization tool to serialize the first map and generate a data packet in a preset file format. The preset file format can be a binary file format. After generating the data packet, the data packet can be divided into multiple data blocks, and then the multiple data blocks are shared and saved to local storage or the cloud. The file size of the first map can be reduced, which is convenient for storage. Of course, it is not limited to the saving method of the preset file format, and other format saving methods can also be used, which is not limited here.
[0065] In some embodiments, the dividing the data packet into multiple data blocks may include:
[0066] Correspondingly divide the data packet into multiple data blocks according to sub-map data, key frame data, constraint data of key frames, odometer information, and inertial sensor information.
[0067] Specifically, when storing the data packet, the data packet is correspondingly divided into multiple data blocks according to sub-map data, key frame data, constraint data of key frames, odometer information, and inertial sensor information. Sub-map data refers to data related to multiple sub-maps in the first map. Key frame data includes pose information corresponding to each key frame in each sub-map. The constraint relationship of key frames refers to the relative position relationship between key frames. Odometer information refers to environmental information detected by an odometer sensor. Inertial sensor information includes information of an accelerometer, information of an angular velocity sensor, and information of an IMU sensor.
[0068] S102: If a map needs to be constructed, then load the data packet and deserialize it to generate the first map.
[0069] When a map needs to be constructed, operation information for constructing a map is given to the robot. At this time, the robot receives the operation information for establishing a map, loads the data packet from local and / or the cloud, and deserializes it to generate the first map.
[0070] Since the first map is a data packet saved in a preset file format, it is necessary to restore the relevant data packets of the first map and perform deserialization processing on the data packets to obtain the first map.
[0071] For example, as Figure 2 shown, Figure 2 the rendering of the second floor of a certain hotel is used as the first map. Figure 3 The rendering of the third floor of the hotel is a complete SLAM map. Obviously, the mapping effect of the second floor is similar to that of the third floor, except that some aisles are added. Therefore, the rendering of the second floor can be used as the first map. When preparing to build the map of the third floor, the map is built on the basis of the first map. When the robot reaches the third floor, the operation information for building the map is given to the robot. The robot receives the operation information for building the map and obtains the data packet of the first map, that is, obtains the map information of the second floor.
[0072] It can be understood that the map building in this application can be the reuse of the map, also known as secondary mapping. Compared with the normal mapping process that starts mapping from boot-up to issuing the end mapping instruction, the map building in this application can be repositioned from any passable area on the first map. After successful repositioning, mapping is started. Moreover, the data generated during map building needs to interact with the data of the previous mapping (the first map). Therefore, when the robot receives the operation information for building the map, it is necessary to load the data packet of the first map and deserialize the data packet to generate the first map, so as to restore the first map and obtain the relevant data of the first map, including sub-map data, key-frame data, constraint data of key frames, odometer information, and inertial sensor information.
[0073] S103: Perform robot repositioning based on the first map.
[0074] S104: If the robot is successfully positioned, construct a second map according to the obtained environmental information.
[0075] After deserializing the data packet to generate the first map, robot repositioning is performed. The principle of the repositioning algorithm involved in this repositioning method is the repositioning algorithm in this field. For example, odometer information is used for positioning to obtain the position information of the robot, and the angular velocity and acceleration of the robot in a specific coordinate system are measured through an inertial navigation system to obtain the attitude information of the robot, so as to obtain the positioning prediction value. Then, combined with the laser point cloud data obtained by the lidar as the observation value, matching is performed to complete the positioning.
[0076] If the robot is successfully located in the passable area, the position of the robot in the first map is obtained, and then the construction of the second map is started. When constructing the second map, environmental information can be obtained according to the lidar, and the target key frames can be extracted; constraints are established between the target key frames and the historical key frames of the first map, and the second map is constructed with the target key frames.
[0077] The method for obtaining the target key frames is similar to that of the key frames in the first map.
[0078] The historical key frames are any key frames in any sub-map of the first map.
[0079] In order to make the data of the second map related to that of the first map, constraints are established between the target key frames and the historical key frames of the first map. Further, constraint relationships can be established between the target key frame at the initial moment among multiple target key frames and the historical key frame closest to the current moment in the first map.
[0080] Specifically, assume that the position of the target key frame at the initial moment is T 2 , and the position of the key frame closest to the current moment in the first map is T 1 . Then, a constraint is established between the position T 2 of the target key frame at the initial moment and the position T 1 of the historical key frame closest to the current moment as T = T 1 -1 * T 2 , where T is a transformation matrix.
[0081] After establishing the constraint relationship between the position T 2 of the target key frame at the initial moment and the position T 1 of the historical key frame closest to the current moment, since there are constraint relationships between historical key frames in the first map, there are also constraint relationships between the target key frame at the initial moment and other historical key frames in the first map, thus associating the first map with the second map.
[0082] It can be understood that this application is not limited to first establishing the constraint relationship between the position T 2 of the target key frame at the initial moment and the position T 1 of the historical key frame closest to the current moment. It can also be to establish the constraint relationship between the position T 2 of the target key frame at the initial moment and the positions of other historical key frames in the first map. The number of historical key frames is not limited to one, as long as the constraint relationship can associate the first map with the second map.
[0083] In some of these embodiments, if the robot positioning is unsuccessful, the robot is controlled to move a preset distance and then repositioning is started until the repositioning is successful or the number of repositioning failures reaches a preset number of times.
[0084] Specifically, if the robot fails to position in the passable area, the robot is controlled to move a preset distance and then repositioning is started. For example, when the current environment is too different from the environment at the time when the first map was created, or the current environment is too empty, or there are factors such as glass or black walls that are not conducive to laser positioning, the repositioning will fail. If the repositioning fails multiple times in the first map and the number of failures reaches a preset number of times, such as 5 times, the construction of the second map cannot be achieved; or after the repositioning fails in the first map, the robot is moved a preset distance to reach other positions and then repositioning is performed. If the repositioning fails at any position in the first map, the construction of the second map cannot be achieved at this time and only the map needs to be rebuilt.
[0085] S105: Jointly optimize the first map and the second map.
[0086] In some of these implementation manners, jointly optimizing the first map and the second map may include:
[0087] Perform pose graph optimization on the first pose graph corresponding to the first map to obtain an optimized first pose graph;
[0088] Perform pose graph optimization on the second pose graph corresponding to the second map to obtain an optimized second pose graph;
[0089] Integrate the optimized first pose graph and the optimized second pose graph to generate a complete SLAM map.
[0090] After stitching the first map and the second map, optimize the complete SLAM map. The first pose graph may include a first feature node constructed based on the feature points corresponding to each key frame in the first map, and a first pose node constructed based on the sensor pose information corresponding to each key frame. Use the iterative method to perform multiple iterations on the lidar pose change amount corresponding to any two first pose nodes in the first pose graph, and the lidar observation amount corresponding to the corresponding first pose node and the first feature node, so as to minimize the error value to obtain the first pose graph after graph optimization; wherein, the iterative method may include Newton iteration, Levenberg-Marquardt iteration method, etc. Based on the sensor pose information and the feature point information of the key frames provided by the first pose graph after graph optimization, generate the first map after graph optimization. Based on the sensor pose information and the feature point information of the key frames provided by the second pose graph after graph optimization, generate the second map after graph optimization, so as to update the original complete SLAM map with the first map after graph optimization and the second map after graph optimization to obtain the complete SLAM map after graph optimization. By optimizing the first map and the second map, the error can be reduced and the accuracy of constructing the complete SLAM map can be improved.
[0091] As Figure 3 shown, when obtaining the Figure 3 second map, that is, the third-layer map, the obtained map is the map of the added aisle. Complement the map of the aisle into the second-layer map of the first map, optimize the first map and the second map, so as to achieve the effect of supplementary mapping, and obtain the third-layer map as Figure 3 shown, and realize the generation of a complete SLAM map.
[0092] In the embodiment of the present application, serialize the first map, generate a data packet in a preset file format, and then save the data packet, which can reduce the file size of the first map. If a map needs to be constructed, load the data packet and deserialize it to generate the first map. Then, perform robot relocalization based on the first map. If the robot is successfully located, it means that the current environment to be mapped is not very different from the mapping environment of the first map. Then, construct the second map according to the obtained environmental information, and jointly optimize the first map and the second map, so that the first map and the second map interact with each other, thereby realizing the construction of the second map. Through the secondary mapping after the first map, problems such as large map supplementary construction, missing construction, and reconstruction can be effectively solved. Moreover, the cost of map reuse is low, the computing power will not be significantly increased, the success rate and accuracy of secondary mapping can be improved, and the mapping efficiency is high.
[0093] The embodiment of the present application also provides a map construction device. Please refer to Figure 4 which shows the structure of a map construction device provided by the embodiment of the present application. The map construction device 400 includes:
[0094] The serialization module 401 is used to serialize the first map, generate a data packet in a preset file format, and save the data packet;
[0095] The deserialization module 402 is used to load the data packet and deserialize it to generate the first map if a map needs to be constructed;
[0096] The relocalization module 403 is used to perform robot relocalization based on the first map;
[0097] The construction module 404 is used to construct a second map according to the acquired environmental information if the robot is successfully located;
[0098] The optimization module 405 is used to jointly optimize the first map and the second map.
[0099] In an embodiment of the present application, the first map is serialized, a data packet is generated in a preset file format, and then the data packet is saved, which can reduce the file size of the first map. If a map needs to be constructed, the data packet is loaded and deserialized to generate the first map. Then, robot relocalization is performed based on the first map. If the robot is successfully located, it indicates that the current environment where mapping is required is not very different from the mapping environment of the first map. Then, a second map is constructed according to the acquired environmental information, and the first map and the second map are jointly optimized, enabling the first map and the second map to interact, thereby realizing the construction of the second map. Through the secondary mapping after the first map, problems such as large map supplementation, missing mapping, and reconstruction can be effectively solved. Moreover, the cost of map reuse is low, the computing power is not significantly increased, the success rate and accuracy of secondary mapping can be improved, and the mapping efficiency is high.
[0100] In some embodiments, the serialization module 401 is further used for:
[0101] Serializing the first map based on a serialization tool and generating the data packet in a preset file format;
[0102] Dividing the data packet into multiple data blocks;
[0103] Sharing and saving the multiple data blocks to local storage or the cloud.
[0104] In some embodiments, the serialization module 401 is further used for:
[0105] Dividing the data packet into multiple data blocks correspondingly according to sub-map data, key-frame data, constraint data of key frames, odometer information, and inertial sensor information.
[0106] In some embodiments, the map construction device 400 further includes a movement module 406, which is used for:
[0107] If the robot positioning is unsuccessful, control the robot to move a preset distance and then start repositioning until the repositioning is successful or the number of repositioning failures reaches the preset number of times.
[0108] In some embodiments, the construction module 404 is further configured to:
[0109] Obtain environmental information based on the lidar and extract target key frames;
[0110] Establish constraints between the target key frames and the historical key frames of the first map, and construct a second map with the target key frames.
[0111] In some embodiments, the optimization module 405 is further configured to:
[0112] Optimize the pose graph corresponding to the first map to obtain an optimized first pose graph;
[0113] Optimize the pose graph corresponding to the second map to obtain an optimized second pose graph;
[0114] Integrate the optimized first pose graph and the optimized second pose graph to generate a complete SLAM map.
[0115] It should be noted that the above device can execute the method provided in the embodiments of the present application, and has the corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the device embodiments, reference can be made to the method provided in the embodiments of the present application.
[0116] Figure 6 For a schematic hardware structure diagram of a controller in an embodiment of a robot, as Figure 6 shown, the controller includes:
[0117] One or more processors 111 and a memory 112. Figure 6 Taking one processor 111 and one memory 112 as an example.
[0118] The processor 111 and the memory 112 can be connected through a bus or other means, Figure 6 Taking the connection through a bus as an example.
[0119] The memory 112, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the map construction method in the embodiments of the present application (for example, attached Figure 4-5The serialization module 401, deserialization module 402, relocation module 403, construction module 404, optimization module 405, and movement module 406 shown). The processor 111 executes various functional applications and data processing of the controller by running the non-volatile software programs, instructions, and modules stored in the memory 112, that is, implements the map construction method in the above method embodiments.
[0120] The memory 112 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the personnel entry and exit detection device, etc. In addition, the memory 112 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 112 may optionally include a memory remotely set relative to the processor 111, and these remote memories may be connected to the robot through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0121] The one or more modules are stored in the memory 112 and, when executed by the one or more processors 111, execute the map construction method in any of the above method embodiments. For example, execute the method steps S101 to S105 described above; implement Figure 1 the functions of the modules 401 - 406 in Figure 4-5 .
[0122] The above product can execute the method provided in the embodiments of the present application, and has the corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the method provided in the embodiments of the present application.
[0123] The embodiments of the present application provide a non-volatile computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions. These computer-executable instructions are executed by one or more processors, such as Figure 6 one of the processors 111 in Figure 1 , so that the one or more processors can execute the map construction method in any of the above method embodiments. For example, execute the method steps S101 to S105 described above; implement Figure 4-5 the functions of the modules 401 - 406 in
[0124] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] Through the description of the above embodiments, those of ordinary skill in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Those of ordinary skill in the art can understand that all or part of the processes of implementing the above embodiments of the method can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above embodiments of the methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order, and there are many other variations in different aspects of the present invention as described above. For the sake of brevity, they are not provided in detail; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for map construction, characterized in that, the method includes: Serializing the first map and generating a data packet in a preset file format, and saving the data packet, including: serializing the first map based on a serialization tool and generating the data packet in the preset file format; dividing the data packet into multiple data blocks; sharing and saving the multiple data blocks to local storage or the cloud; wherein, dividing the data packet into multiple data blocks includes: correspondingly dividing the data packet into multiple data blocks according to sub-map data, key frame data, constraint data of key frames, odometer information, and inertial sensor information; When it is necessary to construct a map, loading the data packet and deserializing to generate the first map; Performing robot relocalization based on the first map; If the robot is successfully located, obtaining environmental information according to a lidar and extracting target key frames; establishing constraints between the target key frames and historical key frames of the first map, and constructing a second map with the target key frames; Performing pose graph optimization on the first pose graph corresponding to the first map to obtain an optimized first pose graph; Performing pose graph optimization on the second pose graph corresponding to the second map to obtain an optimized second pose graph; Integrating the optimized first pose graph and the optimized second pose graph to generate a complete SLAM map.
2. The method according to claim 1, characterized in that, the preset file format is a binary file format.
3. The method according to claim 1, characterized in that, the method further includes: If the robot is not successfully located, controlling the robot to move a preset distance and then starting relocalization until relocalization is successful or the number of relocalization failure times reaches a preset number of times.
4. A map construction device, characterized in that, the device includes: A serialization module for serializing the first map and generating a data packet in a preset file format, and saving the data packet, including: serializing the first map based on a serialization tool and generating the data packet in the preset file format; dividing the data packet into multiple data blocks; sharing and saving the multiple data blocks to local storage or the cloud; wherein, dividing the data packet into multiple data blocks includes: correspondingly dividing the data packet into multiple data blocks according to sub-map data, key frame data, constraint data of key frames, odometer information, and inertial sensor information; A deserialization module for loading the data packet and deserializing to generate the first map when it is necessary to construct a map; A relocalization module for performing robot relocalization based on the first map; A construction module for, if the robot is successfully located, obtaining environmental information according to a lidar and extracting target key frames, establishing constraints between the target key frames and historical key frames of the first map, and constructing a second map with the target key frames; An optimization module, configured to optimize the pose graph corresponding to the first map to obtain an optimized first pose graph, optimize the pose graph corresponding to the second map to obtain an optimized second pose graph, and integrate the optimized first pose graph and the optimized second pose graph to generate a complete SLAM map.
5. A robot, wherein, the robot comprises: at least one processor, and a memory, the memory is communicatively connected to the processor, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of claims 1-3.
6. A non-volatile computer-readable storage medium, wherein, the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a robot, the robot is enabled to execute the method according to any one of claims 1-3.
Citation Information
Patent Citations
Off-line map preservation and real-time relocation for mobile robot
CN109460267A
Map construction method and device based on SLAM
CN112634395A