Method, device, electronic device and storage medium for constructing a map

By combining lidar and visual sensors to generate grid sub-maps and adjust the pose, the problem of inaccurate pose calculation in complex environments is solved, efficient and accurate relocalization and loop detection are achieved, and the accuracy of map construction and navigation capabilities are improved.

CN114241146BActive Publication Date: 2025-09-05HUNAN GOKE MICROELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111563277.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-09-05
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve efficient and accurate pose calculation, relocalization, and loop detection in complex environments, which affects the accuracy of map construction and positioning precision.

Method used

Combining lidar and vision sensors, raster sub-maps are generated by acquiring laser data, and image features are used to determine the relative map poses between raster sub-maps, and adjustments are made to generate a global map.

Benefits of technology

It achieves more accurate pose estimation and mapping effects, improves the efficiency of relocalization and loop detection, and enhances the accuracy and robustness of navigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241146B_ABST
    Figure CN114241146B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose a method, apparatus, electronic device, and storage medium for constructing a map. The method includes: obtaining laser data obtained by scanning a preset area with a laser radar to generate a grid sub-map, with the laser radar moving along a preset trajectory; determining the relative map pose between the grid sub-maps based on image features in the image; the image is obtained by photographing the area corresponding to the grid sub-map with a visual sensor, with the relative position between the visual sensor and the laser radar fixed; and adjusting and combining the grid sub-maps based on the relative map pose to obtain a global map. This solution is more efficient and accurate, thereby achieving more accurate pose and mapping results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual positioning and mapping, and in particular to a method, device, electronic device and storage medium for constructing a map. Background Art

[0002] The simultaneous localization and mapping (SLAM) system estimates the position of a machine in the environment based on its own sensors and simultaneously builds a scene map.

[0003] Typically, machines need to construct a grid map of obstacles corresponding to the scene to achieve efficient motion planning and obstacle avoidance. However, this approach struggles to achieve globally consistent pose calculations in complex environments, making it difficult to efficiently and accurately implement relocalization and loop closure detection. This impacts both map construction accuracy and positioning precision. Summary of the Invention

[0004] In view of this, the present invention proposes a method, device, electronic device and storage medium for constructing a map, so as to overcome the problems in the prior art and achieve more accurate map construction.

[0005] Specifically, the present invention proposes the following specific embodiments:

[0006] An embodiment of the present invention provides a method for constructing a map, including:

[0007] Obtaining laser data obtained by scanning a preset area with a laser radar to generate a grid submap, wherein the laser radar moves along a preset trajectory;

[0008] determining a relative map pose between the grid sub-maps based on image features in an image, wherein the image is obtained by photographing an area corresponding to the grid sub-map with a visual sensor, and the relative position between the visual sensor and the laser radar is fixed;

[0009] Each of the grid sub-maps is adjusted based on the relative position of the map to obtain a global map.

[0010] In a specific embodiment, obtaining laser data obtained by scanning a preset area with a laser radar to generate a raster sub-map includes:

[0011] Control the laser radar to move along a preset trajectory and scan the preset area according to preset rules to obtain laser data;

[0012] Create the current sub-map according to the preset cycle;

[0013] The laser data obtained from the current scan is added to the current sub-map to generate a grid sub-map.

[0014] In a specific embodiment, adding the laser data obtained from the current scan to the current sub-map to generate a grid sub-map includes:

[0015] Obtaining the first position of the laser radar in the current submap;

[0016] The laser data obtained by the current scan is projected into the current submap based on the first posture to generate a grid submap.

[0017] In a specific embodiment, it also includes:

[0018] Taking the starting point of the preset trajectory as the origin of the global map;

[0019] When creating the current submap, the position of the laser radar in the global map at the time of creation is used as the second position of the current submap;

[0020] Determining an initial global relative pose of each current submap relative to the origin based on the second pose of each current submap and the preset trajectory;

[0021] In a specific embodiment, adjusting each of the grid sub-maps based on the relative position of the map to obtain a global map includes:

[0022] Updating the initial global relative pose based on the map relative pose to obtain a final global relative pose;

[0023] The grid sub-maps are stitched together into a final global map through the final global relative pose.

[0024] In a specific embodiment, the image features include feature points and bag-of-words vectors, and determining the relative map poses between the grid sub-maps based on the image features in the image includes:

[0025] Determining feature points and bag-of-words vectors of each of the images;

[0026] Determine all related images that have the same bag-of-words vector as the current image and the number of the same bag-of-words vectors is greater than a threshold;

[0027] Obtaining feature point pairs of the current image and the related image, and determining the relative pose of the current image and the related image based on the feature point pairs;

[0028] The map relative poses between the grid sub-maps are determined based on the image relative poses, the pose of the visual sensor when shooting the current image, and the pose of the visual sensor when shooting the related images.

[0029] In a specific embodiment, the map relative pose is obtained by the following formula:

[0030] pose_mr=pose_cr×pose_fr×(pose_pr) -1 ;

[0031] Among them, pose_mr is the relative pose of the map; pose_cr is the pose of the visual sensor when shooting the current image; pose_fr is the relative pose of the image; (pose_pr) -1 is the inverse matrix of the posture of the visual sensor when taking the relevant image.

[0032] The embodiment of the present invention further provides a device for constructing a map, comprising:

[0033] A laser radar module, configured to generate a grid submap by acquiring laser data obtained by scanning a preset area with a laser radar, wherein the laser radar moves along a preset trajectory;

[0034] an image module, configured to determine a relative map pose between the grid sub-maps based on image features in an image, wherein the image is obtained by photographing an area corresponding to the grid sub-map using a visual sensor, and the relative position between the visual sensor and the laser radar is fixed;

[0035] A construction module is used to adjust each of the grid sub-maps based on the relative position of the map to obtain a global map.

[0036] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein an application is stored in the memory, and the processor implements the above-mentioned method for constructing a map when executing the application.

[0037] An embodiment of the present invention further provides a storage medium, in which an application is stored. When the application is executed, the above-mentioned method for constructing a map is implemented.

[0038] An embodiment of the present invention proposes a method, device, electronic device, and storage medium for constructing a map. The method includes: obtaining laser data obtained by scanning a preset area with a laser radar to generate a grid sub-map, wherein the laser radar moves along a preset trajectory; determining the relative map pose between each of the grid sub-maps based on image features in an image, wherein the image is obtained by photographing the area corresponding to the grid sub-map with a visual sensor, and the relative position between the visual sensor and the laser radar is fixed; and adjusting each of the grid sub-maps based on the relative map pose to obtain a global map. Compared to a simple laser mapping system, this solution utilizes a visual sensor to obtain image features in a scene, achieving more efficient and accurate relocalization and loop detection. This results in more accurate pose estimation and mapping effects. Furthermore, compared to a simple visual mapping system, this solution can more efficiently construct a grid map, which is more conducive to navigation. At the same time, because lasers have a wider viewing angle than cameras, pose calculations are more robust. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.

[0040] Figure 1 A schematic diagram showing a flow chart of a method for constructing a map according to an embodiment of the present invention is shown;

[0041] Figure 2 A schematic diagram showing the framework structure of a device for constructing a map according to an embodiment of the present invention is shown;

[0042] Figure 3 Another structural diagram of a device for constructing a map according to an embodiment of the present invention is shown;

[0043] Figure 4 A schematic diagram of the framework structure of an electronic device proposed in an embodiment of the present invention is shown.

[0044] Legend:

[0045] 201 - LiDAR module; 202 - Image module; 203 - Construction module; 204 - Processing module. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0047] The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the figures is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by those skilled in the art based on the embodiments of the present invention without inventive effort are intended to be within the scope of protection of the present invention.

[0048] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.

[0049] Furthermore, the terms “first,” “second,” “third,” etc., are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0050] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present invention pertain. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present invention.

[0051] The present invention discloses a method for constructing a map, such as Figure 1 As shown, the following steps are included:

[0052] Step S101: Obtain laser data obtained by scanning a preset area with a laser radar to generate a grid sub-map, wherein the laser radar moves along a preset trajectory;

[0053] Specifically, in this solution, a vehicle is provided, on which a laser radar and a visual sensor are provided, and the relative positions of the laser radar and the visual sensor are fixed. When working, the vehicle will move according to a preset trajectory, and at the same time, the laser radar continuously scans the surrounding environment to obtain laser data. Based on the real-time laser data, multiple grid sub-maps can be obtained in sequence.

[0054] Specifically, the step S101 of obtaining the laser data obtained by scanning the preset area by the laser radar to generate a raster sub-map includes: controlling the laser radar to move along a preset trajectory, and scanning the preset area according to preset rules to obtain laser data; creating a current sub-map according to a preset period; and adding the laser data obtained by the current scan to the current sub-map to generate a raster sub-map.

[0055] Specifically, the preset rule is a scanning rule preset by the user for the lidar, such as a scanning time interval. The preset period is a time period preset by the user for creating the current submap. The specific time interval and time period depend on the actual application and are not limited here.

[0056] Furthermore, in order to make the generated raster sub-map more accurate, the laser data obtained from the current scan is added to the current sub-map to generate a raster sub-map, including: obtaining the first pose of the laser radar in the current sub-map; and projecting the laser data obtained from the current scan into the current sub-map based on the first pose to generate a raster sub-map.

[0057] Specifically, since the laser data is acquired in real time and the laser radar is always moving along a preset trajectory, it is necessary to first match the laser data with the current sub-map to obtain the first position of the laser radar in the current sub-map, adjust the projection angle based on the first position, and project it into the current sub-map to generate a raster sub-map.

[0058] In addition, in a specific embodiment, the sensor data obtained by sensors such as inertial sensors and odometers can also be added, and a more accurate first position of the lidar in the current sub-map can be obtained by using a method of fusing multiple sensor data;

[0059] Furthermore, in order to make the generated grid sub-map more accurate, the grid data of the previous grid sub-map may be updated according to the laser data obtained by the current scan to obtain a more accurate grid sub-map.

[0060] In some embodiments, the mapping method further includes: using the starting point of a preset trajectory as the origin of the global map; when creating the current submap, using the position of the lidar in the global map at the moment of creation as the second position of the current submap; and determining the initial global relative position of each current submap relative to the origin based on the second position of each current submap and the preset trajectory.

[0061] Specifically, when generating the current submap, the initial global relative pose of each current submap relative to the origin can be determined based on the second pose of each current submap and the preset trajectory, so as to facilitate subsequent calibration based on image features. The initial global relative pose of each current submap relative to the origin is the initial global relative pose of each grid submap relative to the origin.

[0062] Step S102: determining the relative map poses between the grid sub-maps based on image features in the image;

[0063] Specifically, the image is obtained by photographing the area corresponding to the grid sub-map by a visual sensor, and the relative position between the visual sensor and the laser radar is fixed;

[0064] When the laser radar is scanning, the visual sensor also continuously takes pictures, specifically taking pictures of the area corresponding to the grid sub-map to obtain an image, that is, one image corresponds to one grid sub-map.

[0065] In addition, the image features include: feature points and bag-of-words vectors; thus, the determination of the map relative pose between each of the raster sub-maps based on the image features in the image in step S102 includes: determining the feature points and bag-of-words vectors of each of the images; determining all related images that have the same bag-of-words vector as the current image and the number of the same bag-of-words vectors is greater than a threshold; obtaining feature point pairs of the current image and the related images, and determining the image relative pose between the current image and the related images based on the feature point pairs; determining the map relative pose between each of the raster sub-maps based on the image relative pose, the pose of the visual sensor when shooting the current image, and the pose of the visual sensor when shooting the related images.

[0066] Specifically, determining the feature points and bag-of-words vectors for each image may include: extracting the feature points of each image based on the FAST9 corner detection algorithm; extracting the descriptors of each image based on the ORB descriptor extraction algorithm; and converting the descriptors into bag-of-words vectors using a bag-of-words model. Thus, the feature points, descriptors, and bag-of-words vectors in the same image are all associated. Furthermore, the bag-of-words vector includes: an image ID, the coordinates of the feature points on the image, and the descriptors corresponding to the feature points.

[0067] Determine all related images that have the same bag-of-words vector as the current image and the number of the same bag-of-words vectors is greater than a threshold. Specifically, for example, the currently acquired image is image 10, and the previously acquired images also include images 1-9. Among images 1-9, determine that the images that have the same bag-of-words vector as image 10 are, for example, images 3-9. Furthermore, if the threshold is 8, then the image with 8 or more identical bag-of-words vectors may be, for example, image 9, and image 9 is the related image.

[0068] Specifically, a feature point pair is composed of feature points of the same feature in the current image and feature points in the related image. That is, a feature point pair is composed of feature points of the same feature in both the current image and the related image. Therefore, by obtaining the feature point pairs of the current image and the related image, the relative image pose of the current image and the related image can be determined based on the feature point pairs. In other words, the relative image pose of the current image and the related image can be determined based on the position of the same feature point in the current image and the related image; the specific number of the same feature points can be one or more.

[0069] Still using the above example for illustration, for example, if image 10 and image 9 have feature point pair 1, that is, feature 1 exists in both image 10 and image 9, then the relative pose of image 10 and image 9 is determined based on the position of feature point 1 in image 10 and image 9. Furthermore, if image 10 and image 9 also have feature point pair 2 and feature point pair 4, the relative pose of image 10 and image 9 can also be determined based on feature point 1, feature point 2, and feature point 4 together.

[0070] In a specific embodiment, determining the map relative pose between each of the grid sub-maps based on the image relative pose and the pose of the visual sensor when capturing the current image and the pose of the visual sensor when capturing the related image includes obtaining the map relative pose by the following formula: pose_mr=pose_cr×pose_fr×(pose_pr) -1 ; Among them, pose_mr is the relative pose of the map; pose_cr is the pose of the visual sensor when shooting the current image; pose_fr is the relative pose of the image; (pose_pr) -1 is the inverse matrix of the posture of the visual sensor when taking the relevant image.

[0071] Step S103: adjusting each of the grid sub-maps based on the relative position of the map to obtain a global map.

[0072] Furthermore, the above has determined the initial global relative pose of each grid sub-map relative to the origin; therefore, step S103 adjusts each grid sub-map based on the map relative pose to obtain a global map, including: updating the initial global relative pose based on the map relative pose to obtain a final global relative pose; and splicing the multiple grid sub-maps into a final global map through the final global relative pose.

[0073] Specifically, the initial global relative pose of each grid sub-map relative to the origin obtained based on the lidar is corrected through the map relative pose, so that a more accurate position of each grid sub-map in the global map can be obtained. The adjusted grid sub-maps are spliced ​​together to obtain a more accurate global map.

[0074] Here, a specific example is used to illustrate the process, which includes the following steps:

[0075] 1. Obstacles in the environment are scanned by LiDAR to obtain laser data of the obstacles. Submaps are periodically created, and then raster submaps are generated based on the laser data of the obstacles and the submap. This process specifically includes the following substeps:

[0076] 1.1. Control the LiDAR to move along a preset trajectory. Simultaneously, the LiDAR scans the preset area to obtain laser data, with the starting point of the LiDAR as the origin of the global map.

[0077] 1.2. Create a new submap at every fixed time interval (e.g., 10 seconds), and use the LiDAR's pose in the global map at the time of creation as the second pose of the currently created submap;

[0078] 1.3. Add laser data to the current submap. When adding laser data, first match the laser data with the current submap to obtain the machine's first pose in the current submap. Then, use this first pose to adjust the projection angle. This allows the laser data to be projected more accurately into the current submap, thus generating a raster submap.

[0079] 1.4. Create a global grid map. Since the second position of each grid submap in the global map is known, the initial global relative position of each grid submap relative to the origin can be obtained by combining it with the preset trajectory. Based on the initial global relative position, all grid submaps can be transformed to the corresponding positions in the global map, thereby obtaining an initial global map.

[0080] 2. Process the current input image frame_cur and obtain the visual features in the current image frame_cur; this process specifically includes the following sub-steps:

[0081] 2.1. Read the images captured by the camera at fixed intervals (e.g., 1 second) (the relative positions of the camera and lidar are fixed, and the camera captures the scanned area while the lidar is scanning). Extract the image's feature points and descriptors (the FAST9 corner detection algorithm and the ORB descriptor extraction algorithm can be used to extract the image's feature points and descriptors). At the same time, store the submap label mapid corresponding to the lidar and the lidar's relative position in the submap when each image is read.

[0082] 2.2 Use the bag-of-words model to add the data of frame_cur to the feature point database; further, the process includes the following sub-steps:

[0083] 2.2.1 Convert the descriptors corresponding to all feature points in frame_cur into bag-of-words vectors. The specific conversion can be completed by the bag-of-words model, and feature points with similar descriptors can be converted into the same bag-of-words vector.

[0084] 2.2.2 Associate all feature points of the image with the corresponding word bag vectors. Each word bag vector corresponds to a [<frameid,coord,descriptor> ,…,<frameid,coord,descriptor> ] array, storing all the feature points corresponding to this Ikebukuro vector. Where frameid corresponds to the image id, coord = [u, v] corresponds to the coordinates of the feature point on the image, and descriptor corresponds to the descriptor of the feature point.

[0085] 2.2.3 Find all images frame_past that share the same bag-of-words vector as frame_cur, and count the number of bag-of-words vectors shared by frame_cur and frame_past as the matching score between frame_cur and frame_past. Select the frame_past with score > th, obtain the matching feature point pairs between frame_cur and the selected frame_past, and calculate the relative pose pose_fr between frame_cur and the selected frame_past.

[0086] 2.2.4 Each frame corresponds to a grid sub-map map. If the pose of frame_cur in map_cur (the grid sub-map corresponding to frame_cur) (i.e., the pose of the visual sensor when capturing the current image) is pose_cr; the pose of frame_past in map_past (the grid sub-map corresponding to frame_past) (i.e., the pose of the visual sensor when capturing the relevant image) is pose_pr;

[0087] Then the relative pose between map_cur and map_past (i.e., map relative pose) can be updated as pose_mr = pose_cr × pose_fr × (pose_pr) -1 In this way, the relative poses between all matching frames can be calculated, which achieves the effect of relocalization or loop detection.

[0088] Finally, the initial global relative pose is optimized using the relative poses of all grid submaps (i.e., the initial global map is optimized). Specifically, the global relative poses of all grid submaps can be updated, and all grid submaps can be spliced ​​together using the new global relative pose (i.e., the final global relative pose) to obtain a more accurate global map.

[0089] Compared to simple laser mapping systems, this solution leverages visual sensors, such as cameras, to capture scene image features, achieving more efficient and accurate relocalization and loop closure detection. This results in more accurate pose estimation and mapping. Compared to simple visual mapping systems, this method can more efficiently construct obstacle grid maps, facilitating navigation. Furthermore, because lasers have a wider viewing angle than cameras, pose calculations are more robust. Furthermore, this method requires fewer computing resources.

[0090] The present invention also discloses a device for constructing a map, such as Figure 2 Shown, including:

[0091] The laser radar module 201 is used to obtain laser data obtained by scanning a preset area with a laser radar to generate a grid sub-map. The laser radar moves along a preset trajectory.

[0092] An image module 202 is configured to determine a relative map pose between the grid sub-maps based on image features in an image, wherein the image is obtained by photographing an area corresponding to the grid sub-map using a visual sensor, and the relative position between the visual sensor and the laser radar is fixed;

[0093] The construction module 203 is used to adjust each of the grid sub-maps based on the relative position of the map to obtain a global map.

[0094] In a specific embodiment, the laser radar module 201 is used to control the laser radar to move along a preset trajectory, and scan a preset area according to preset rules to obtain laser data; create a current sub-map according to a preset period; and add the laser data obtained from the current scan to the current sub-map to generate a raster sub-map.

[0095] In a specific embodiment, the laser radar module 201 adds the laser data obtained from the current scan to the current sub-map to generate a raster sub-map, including: obtaining the first pose of the laser radar in the current sub-map; and projecting the laser data obtained from the current scan into the current sub-map based on the first pose to generate a raster sub-map.

[0096] In a specific embodiment, Figure 3As shown, it also includes: a processing module 204, which is used to use the starting point of the preset trajectory as the origin of the global map; when creating the current submap, use the position of the lidar in the global map at the creation time as the second position of the current submap; based on the second position of each current submap and the preset trajectory, determine the initial global relative position of each current submap relative to the origin.

[0097] The construction module 203 is configured to update the initial global relative pose based on the map relative pose to obtain a final global relative pose; and to splice the grid sub-maps into a final global map using the final global relative pose.

[0098] In a specific embodiment, the image features include: feature points and bag-of-words vectors;

[0099] The image module 202 is used to: determine the feature points and word bag vectors of each of the images; determine all related images that have the same word bag vector as the current image and the number of the same word bag vectors is greater than a threshold; obtain feature point pairs of the current image and the related images, and determine the image relative pose of the current image and the related images based on the feature point pairs; determine the map relative pose between each of the grid sub-maps based on the image relative pose, the pose of the visual sensor when shooting the current image, and the pose of the visual sensor when shooting the related images.

[0100] In a specific embodiment, the map relative pose is obtained by the following formula:

[0101] pose_mr=pose_cr×pose_fr×(pose_pr) -1 ;

[0102] Among them, pose_mr is the relative pose of the map; pose_cr is the pose of the visual sensor when shooting the current image; pose_fr is the relative pose of the image; (pose_pr) -1 is the inverse matrix of the posture of the visual sensor when taking the relevant image.

[0103] In a specific embodiment, the bag-of-words vector includes: an image identifier, coordinates of feature points on the image, and descriptors corresponding to the feature points.

[0104] The present invention also discloses an electronic device, such as Figure 4 As shown, it includes a processor and a memory, wherein an application is stored in the memory, and the processor implements the method for constructing a map described in Example 1 when executing the application.

[0105] The present invention also discloses a storage medium, in which an application is stored. When the application is executed, the method for constructing a map described in Example 1 is implemented.

[0106] An embodiment of the present invention proposes a method, device, electronic device, and storage medium for constructing a map. The method includes: obtaining laser data obtained by scanning a preset area with a laser radar to generate a grid sub-map, wherein the laser radar moves along a preset trajectory; determining the relative map pose between each of the grid sub-maps based on image features in an image, wherein the image is obtained by photographing the area corresponding to the grid sub-map with a visual sensor, and the relative position between the visual sensor and the laser radar is fixed; and adjusting each of the grid sub-maps based on the map relative pose to obtain a global map. Compared to a simple laser mapping system, this solution utilizes a camera to obtain image features in a scene, achieving more efficient and accurate relocalization and loop detection. This results in more accurate pose estimation and mapping effects. Furthermore, compared to a simple visual mapping system, this solution can more efficiently construct a grid map, which is more conducive to navigation. At the same time, because the laser has a wider viewing angle than the camera, the pose calculation has higher robustness.

[0107] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.

[0108] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0109] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0110] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.

Claims

1. A method for constructing a map, characterized in that: include: Obtaining laser data obtained by scanning a preset area with a laser radar to generate a grid submap, wherein the laser radar moves along a preset trajectory; determining a relative map pose between the grid sub-maps based on image features in an image, wherein the image is obtained by photographing an area corresponding to the grid sub-map with a visual sensor, and the relative position between the visual sensor and the laser radar is fixed; Adjusting each of the grid sub-maps based on the relative position of the map to obtain a global map; Taking the starting point of the preset trajectory as the origin of the global map; When creating the current submap, the position of the laser radar in the global map at the time of creation is used as the second position of the current submap; Determining an initial global relative pose of each current submap relative to the origin based on the second pose of each current submap and the preset trajectory; The step of adjusting each of the grid sub-maps based on the relative position of the map to obtain a global map includes: Updating the initial global relative pose based on the map relative pose to obtain a final global relative pose; The grid sub-maps are stitched together into a final global map through the final global relative pose.

2. The method according to claim 1, wherein The step of obtaining laser data obtained by scanning a preset area with a laser radar to generate a grid sub-map includes: Control the laser radar to move along a preset trajectory and scan the preset area according to preset rules to obtain laser data; Create the current sub-map according to the preset cycle; The laser data obtained from the current scan is added to the current sub-map to generate a grid sub-map.

3. The method according to claim 2, wherein The step of adding the laser data obtained from the current scan to the current sub-map to generate a grid sub-map includes: Obtaining the first position of the laser radar in the current submap; The laser data obtained by the current scan is projected into the current submap based on the first posture to generate a grid submap.

4. The method according to claim 1, wherein The image features include feature points and bag-of-words vectors, and determining the relative map poses between the grid sub-maps based on the image features in the image includes: Determining feature points and bag-of-words vectors of each of the images; Determine all related images that have the same bag-of-words vector as the current image and the number of the same bag-of-words vectors is greater than a threshold; Obtaining feature point pairs of the current image and the related image, and determining the relative pose of the current image and the related image based on the feature point pairs; The map relative poses between the grid sub-maps are determined based on the image relative poses, the pose of the visual sensor when shooting the current image, and the pose of the visual sensor when shooting the related images.

5. The method according to claim 4, wherein The relative position of the map is obtained by the following formula: pose_mr = pose_cr× pose_fr× (pose_pr) -1 ; Among them, pose_mr is the relative pose of the map; pose_cr is the pose of the visual sensor when shooting the current image; pose_fr is the relative pose of the image; (pose_pr) -1 is the inverse matrix of the posture of the visual sensor when taking the relevant image.

6. A device for constructing a map, characterized in that: include: A laser radar module, configured to generate a grid submap by acquiring laser data obtained by scanning a preset area with a laser radar, wherein the laser radar moves along a preset trajectory; an image module, configured to determine a relative map pose between the grid sub-maps based on image features in an image, wherein the image is obtained by photographing an area corresponding to the grid sub-map using a visual sensor, and the relative position between the visual sensor and the laser radar is fixed; A construction module, configured to adjust each of the grid sub-maps based on the relative position of the map to obtain a global map; A processing module is configured to use the starting point of the preset trajectory as the origin of the global map; when creating a current submap, use the position of the lidar in the global map at the time of creation as the second position of the current submap; and determine the initial global relative position of each current submap relative to the origin based on the second position of each current submap and the preset trajectory. The construction module is used to update the initial global relative pose based on the map relative pose to obtain a final global relative pose; and to splice the grid sub-maps into a final global map through the final global relative pose.

7. An electronic device, characterized in that: The system comprises a processor and a memory, wherein an application is stored in the memory, and the processor implements the method for constructing a map according to any one of claims 1 to 5 when executing the application.

8. A storage medium, characterized in that: The storage medium stores an application program, and when the application program is executed, the method for constructing a map according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • SLAM-based robot navigation method and robot

    CN109933056A

  • SLAM positioning and navigation method and system based on multi-sensor fusion

    CN112525202A