GPU-based three-dimensional map construction method and apparatus, device, and storage medium
By segmenting the laser data and assigning it to GPU threads for parallel processing, the problem of inaccurate three-dimensional map construction in the prior art is solved, and the data processing is balanced and the map construction accuracy is achieved.
Patent Information
- Application Number
- PCT/CN2024/136950
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-05
- Filing Date
- 2024-12-05
- Publication Date
- 2025-06-12
AI Technical Summary
The existing GPU-based three-dimensional map construction method has problems of unbalanced data processing and inconsistent speed, which leads to inaccurate three-dimensional maps.
By segmenting the laser data of multiple laser rays according to the preset length, and allocating the multi-segment laser data to multiple threads of the GPU one by one for parallel processing, we ensure that the amount of data processed by each thread is consistent, thereby improving the efficiency and accuracy of data processing.
The accurate construction of three-dimensional maps is realized, ensuring the timeliness and completeness of map updates, avoiding data discarding, and improving the efficiency and accuracy of map construction.
Smart Images

Figure CN2024136950_12062025_PF_FP_ABST
Abstract
Description
A GPU-based three-dimensional map construction method, device, equipment and storage medium Technical Field
[0001] The embodiments of the present application relate to the field of map construction technology, and specifically to a GPU-based three-dimensional map construction method, device, equipment, and storage medium. Background Art
[0002] The data acquisition rate of modern 3D lidar sensors is increasing rapidly. However, the CPU processing speed in CPU-based map construction methods is limited, making it difficult to process the data obtained by the sensors in a timely manner. This leads to delayed map updates, which in turn makes the constructed three-dimensional maps incomplete and inaccurate.
[0003] To solve this problem, researchers have tried to use hardware acceleration technologies such as GPU and FPGA, but there are problems such as insufficient performance optimization and waste of hardware resources.
[0004] Specifically, it is difficult for the GPU to call multiple threads simultaneously to process the same batch of data collected by the lidar sensor to obtain a more accurate three-dimensional map. When using multiple threads in the GPU to process the data collected by the sensor in parallel, the construction speed of the three-dimensional map is often different because the time required for multiple threads to process the data is different. For example, a memory area of the three-dimensional map has been updated many times, while another memory area may have only been updated a few times. The construction results of the map areas corresponding to the various memory areas in the obtained three-dimensional map are different. The map areas that have been updated many times are more consistent with the actual geographical areas, that is, the construction results of the areas with fewer updates in the three-dimensional map are inaccurate. Furthermore, when building the three-dimensional map this time, the data that has not been completed may be directly discarded because it does not have time to be processed by the threads, making it impossible to build a more accurate three-dimensional map.
[0005] Therefore, how to solve the problem of inaccurate three-dimensional map construction by GPU has become a technical problem that needs to be solved urgently. Summary of the Invention
[0006] In view of the above problems, the embodiments of the present application provide a GPU-based three-dimensional map construction method, device, equipment and storage medium to solve the problem of inaccurate three-dimensional map construction by GPU in the prior art.
[0007] According to one aspect of an embodiment of the present application, a GPU-based three-dimensional map construction method is provided, the method comprising: acquiring laser data of a plurality of laser rays; segmenting the laser data of each of the plurality of laser rays according to a preset length to obtain multiple segments of laser data; allocating the multiple segments of laser data one by one to a plurality of threads of a GPU for parallel processing to obtain three-dimensional map data; and storing the three-dimensional map data in a storage space of the GPU to complete the three-dimensional map construction.
[0008] In an optional manner, before allocating multiple segments of laser data one by one to multiple threads of the GPU for parallel processing to obtain three-dimensional map data, the method also includes: determining the storage space of the GPU corresponding to the laser data; allocating multiple segments of laser data one by one to multiple threads of the GPU for parallel processing to obtain three-dimensional map data, including: allocating multiple segments of laser data one by one to multiple threads of the GPU for parallel processing to obtain three-dimensional map data corresponding to the laser data; storing the three-dimensional map data in the storage space of the GPU to complete the three-dimensional map construction, including: storing the three-dimensional map data corresponding to the laser data in the storage space corresponding to the laser data to complete the three-dimensional map construction.
[0009] In an optional manner, the storage space of the GPU corresponding to the laser data is determined, including: searching the storage space of the GPU corresponding to the laser data, and if the search fails, allocating storage space for the laser data that failed to be searched; storing the three-dimensional map data corresponding to the laser data into the storage space corresponding to the laser data to complete the three-dimensional map construction, including: writing the three-dimensional map data corresponding to the laser data that failed to be searched into the storage space corresponding to the laser data that failed to be searched, wherein the storage space is the storage space allocated for the laser data that failed to be searched; using the three-dimensional map data corresponding to the laser data that was successfully searched to update the original three-dimensional map data in the storage space corresponding to the laser data that was successfully searched to complete the three-dimensional map construction.
[0010] In an optional method, the three-dimensional map data corresponding to the laser data is stored in the storage space corresponding to the laser data to complete the three-dimensional map construction, including: determining whether there is an intersection between the storage spaces corresponding to multiple segments of laser data; if so, the three-dimensional map data corresponding to the multiple segments of laser data corresponding to the multiple storage spaces with the intersection are stored in sequence in the storage space corresponding to each segment of laser data to complete the three-dimensional map construction.
[0011] In an optional manner, three-dimensional map data corresponding to the laser data is stored in a storage space corresponding to the laser data to complete three-dimensional map construction, including: storing the three-dimensional map data corresponding to the laser data of multiple laser rays in parallel in a storage space corresponding to the laser data of each laser ray, wherein, when storing the laser data of each laser ray, the three-dimensional map data corresponding to the laser data of the same laser ray is serially stored in the storage space corresponding to the laser data of the laser ray to complete the three-dimensional map construction.
[0012] In an optional manner, three-dimensional map data corresponding to laser data of multiple laser rays are stored in parallel in a storage space corresponding to the laser data of each laser ray, wherein, when storing the laser data of each laser ray, the three-dimensional map data corresponding to the laser data of the same laser ray are stored serially in the storage space corresponding to the laser data of the laser ray to complete the three-dimensional map construction, including: storing the three-dimensional map data corresponding to the laser data of multiple laser rays in parallel in a storage space corresponding to the laser data of each laser ray, wherein, when storing the laser data of each laser ray, it is determined whether there is an intersection between the storage space corresponding to the laser data of the laser ray and the storage space corresponding to other laser rays; if so, the three-dimensional map data corresponding to the laser ray is serially stored in the storage space corresponding to the laser ray, starting from the part of the storage space corresponding to the laser ray away from the intersection.
[0013] In an optional manner, the laser data of each laser ray among the multiple laser rays is segmented according to a preset length to obtain multiple segments of laser data, including: determining whether each laser ray among the multiple laser rays reaches a preset length; and segmenting the laser data of the laser rays that reach the preset length to obtain multiple segments of laser data.
[0014] According to another aspect of an embodiment of the present application, a GPU-based three-dimensional map construction device is provided, including: an acquisition module for acquiring laser data of multiple laser rays; a segmentation module for segmenting the laser data of each of the multiple laser rays according to a preset length to obtain multiple segments of laser data; a processing module for assigning the multiple segments of laser data one by one to multiple threads of the GPU for parallel processing to obtain three-dimensional map data; and a storage module for storing the three-dimensional map data in the storage space of the GPU to complete the three-dimensional map construction.
[0015] According to another aspect of an embodiment of the present application, a GPU-based three-dimensional map construction device is provided, including: a processor and a memory, wherein executable instructions are stored in the memory, and the processor can execute the executable instructions to implement any one of the GPU-based three-dimensional map construction methods described above.
[0016] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one executable instruction is stored. When the executable instruction is executed, the GPU-based three-dimensional map construction method as described above can be implemented.
[0017] The embodiment of the present application segments the collected laser data of multiple laser rays according to preset lengths, and assigns the multiple segments of laser data to multiple threads of the GPU for parallel processing, so that the amount of data required to be processed by each thread is as consistent as possible, and the data processing speed of multiple threads in the GPU can reach the acquisition speed of the sensor, so that the final constructed map is more accurate.
[0018] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to more clearly understand the technical means of the embodiments of the present application, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present application. In addition, the same reference symbols are used to represent the same components throughout the drawings. In the drawings:
[0020] FIG1 shows a flowchart of a GPU-based 3D map construction method provided in an embodiment of the present application;
[0021] FIG2 shows a flowchart of a GPU-based 3D map construction method provided in another embodiment of the present application;
[0022] FIG3 is a schematic diagram of a writing order of three-dimensional map data provided by an embodiment of the present application;
[0023] FIG4 shows a schematic structural diagram of a GPU-based 3D map construction device provided in an embodiment of the present application;
[0024] FIG5 shows a schematic structural diagram of a GPU-based three-dimensional map construction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0026] With the development of geographic information system technology, the data acquisition rate of modern 3D lidar sensors has increased rapidly. Among map construction methods, CPU-based map construction is the most commonly used. However, CPU-based map construction methods are limited by the CPU's processing speed, making it difficult to process sensor data in a timely manner. This leads to delayed map updates, resulting in incomplete and inaccurate 3D maps.
[0027] To solve this problem, researchers have tried to adopt hardware acceleration technologies such as GPU and FPGA. For example, they have tried to use a GPU-based map construction method. There are multiple threads in the GPU, and the data collected by the sensor can be distributed to multiple threads to achieve the purpose of matching the GPU data processing speed with the sensor acquisition speed.
[0028] However, the inventors of this application discovered that when a GPU uses multiple threads to process the same batch of lidar data, the 3D map generated by these threads is inaccurate. When using multiple threads in a GPU to process sensor data in parallel, the amount of data allocated to each thread often varies, resulting in different processing times for each thread. This leads to different 3D map construction speeds and prevents the generation of a more accurate 3D map. When allocating sensor data, data collected by the same laser beam is typically assigned to the same thread for processing. However, different laser beams have different lengths. When an obstacle is close, the sensor's laser beam is shorter, while when the obstacle is farther away, the sensor's laser beam is longer. Therefore, when a sensor sends multiple laser beams to collect data, the lengths of the different laser beams can vary significantly. Large length differences indicate a large amount of collected data. Specifically, the amount of data required to be processed by each thread in the GPU varies significantly. The thread processing the larger amount of data may discard unprocessed data due to insufficient processing time, resulting in an inaccurate 3D map.
[0029] Based on this, the inventors of this application discovered that before assigning the data collected by the laser rays to multiple threads of the GPU for processing, the data can be segmented, and then the segmented data can be assigned to multiple threads for parallel processing, so as to keep the amount of data that each thread needs to process consistent, thereby avoiding the situation where the thread does not have time to process the data and discards the data, so as to obtain a more accurate three-dimensional map.
[0030] This application is applicable to two-dimensional or three-dimensional map construction, especially to three-dimensional map construction. It can be used to construct occupancy grid maps, as well as to construct rasterization-based maps, such as NDT (Normal Distributions Transform) occupancy grid maps, and can also be used to construct truncated signed distance field maps.
[0031] Figure 1 shows a flowchart of a GPU-based 3D map construction method provided in an embodiment of the present application. The method is performed by a GPU-based 3D map construction device. The device can be a GPU that receives data collected by a lidar sensor, or a GPU device that has the function of receiving data collected by a lidar sensor, such as a lidar sensor with a GPU, or a robot equipped with a lidar sensor and equipped with a GPU. As shown in Figure 1, the method includes the following steps:
[0032] S110, acquiring laser data of a plurality of laser rays.
[0033] Laser data consists of a laser point queue and a laser pose queue. To construct a map, a laser radar sensor (LiDAR) emits laser beams and receives laser beams reflected from the surface of a target object. The laser point queue is the time and intensity information required for a laser beam to reflect from the target object, while the laser pose queue is the position and attitude of the LiDAR sensor in the world coordinate system.
[0034] To construct a three-dimensional map using multiple laser data on each laser ray of the lidar, it is necessary to process the multiple laser data on each laser ray to construct a three-dimensional map with information such as height, intensity, and color. That is, the information of the real geographical area is represented in the three-dimensional map through the laser data.
[0035] After the lidar sensor collects laser data through laser rays, the sensor sends this batch of collected laser data to the GPU so that the GPU can build a three-dimensional map based on the laser data. Subsequently, the sensor continues to collect laser data so that the GPU can continue to update the three-dimensional map based on the laser data.
[0036] S130 , segmenting the laser data of each laser ray in the plurality of laser rays according to a preset length to obtain a plurality of segments of laser data.
[0037] To ensure consistent data processing across all GPU threads, the laser data for each laser ray captured by the sensor is segmented according to a preset length. If a laser ray is short and the amount of laser data does not reach the preset length, no further segmentation is required.
[0038] The laser data of each laser ray is segmented to avoid allocating too much laser data to a thread for processing, thereby affecting the accuracy of map construction.
[0039] When each laser ray is segmented, if the laser ray can be evenly divided based on the preset length (that is, the laser data length of the laser ray is an integer multiple of the preset length), the data amount of each segment of laser data obtained is equal (that is, the data length is the same); if the laser ray cannot be evenly divided based on the preset length (that is, the laser data length of the laser ray is not an integer multiple of the preset length), multiple segments of laser data with the preset length and one segment of laser data less than the preset length will be obtained.
[0040] The preset length may be a default length, or a ray length corresponding to the shortest laser ray among multiple laser rays, or a ray length set according to the length of the laser ray that can divide most laser rays into equal parts.
[0041] S150, allocating multiple segments of laser data to multiple threads of the GPU for parallel processing to obtain three-dimensional map data.
[0042] When using multiple threads in a GPU to process laser data collected by a sensor in parallel, the amount of data allocated to each thread often varies, resulting in different times required for each thread to process the laser data. This leads to different speeds in building a 3D map, making it difficult to generate a more accurate 3D map. In the embodiment of the present application, the laser data of each laser ray is segmented according to a preset length, so that the amount of laser data allocated to each thread for processing is as consistent as possible. This avoids the situation where a thread is required to process too much data, resulting in a lack of time to process the laser data and the resulting discard of unprocessed laser data.
[0043] The presence of multiple threads in the GPU can process laser data synchronously and in parallel, making the GPU faster than multiple CPUs and maximizing the use of GPU thread resources, thereby keeping up with the speed at which the lidar sensor collects data and making the constructed three-dimensional map more complete and accurate.
[0044] The GPU thread's processing of laser data includes, but is not limited to: removing noise and outliers from the data to obtain cleaner, more accurate data; and determining the spatial location corresponding to the laser data. The GPU processes the laser data to obtain three-dimensional map data. When the three-dimensional map data includes voxel data corresponding to the laser data and occupancy probabilities corresponding to the voxel data, the three-dimensional map data can be used to construct an occupancy grid map. When the three-dimensional map data includes voxel data corresponding to the laser data, occupancy probabilities corresponding to the voxel data, and the average of multiple laser data, the three-dimensional map data can be used to construct an NDT occupancy grid map.
[0045] S170: Storing the three-dimensional map data into the storage space of the GPU to complete the three-dimensional map construction.
[0046] The obtained three-dimensional map data is stored in the storage space of the GPU, so that the GPU can directly use the stored three-dimensional map data to render the three-dimensional map.
[0047] Preferably, the 3D map data is stored in the GPU's memory. GPU memory is designed specifically for graphics and image data, with high read and write speeds and bandwidth, enabling the GPU to process this data more quickly, thereby increasing the speed of map construction, rendering, and display. Furthermore, storing 3D map data in GPU memory enables real-time interactive map rendering, quickly responding to user actions and updating the map screen in real time.
[0048] The embodiment of the present application segments the laser data of each laser ray collected by the sensor according to a preset length, and assigns multiple segments of laser data to multiple threads of the GPU for parallel processing, so that the amount of data required to be processed by each thread is as consistent as possible, and the data processing speed of multiple threads in the GPU can reach the acquisition speed of the sensor, so that the final constructed map is more accurate; the three-dimensional map data processed by the GPU threads is stored in the storage space of the GPU, so that the GPU can directly use the stored three-dimensional map data to render the three-dimensional map, so as to achieve timely updating of the map screen.
[0049] FIG2 shows a flowchart of a GPU-based 3D map construction method provided by another embodiment of the present application, which is executed by a GPU-based 3D map construction device. As shown in FIG2 , the method includes the following steps:
[0050] S210, acquiring laser data of a plurality of laser rays.
[0051] S220 , segmenting the laser data of each laser ray in the plurality of laser rays according to a preset length to obtain a plurality of segments of laser data.
[0052] S230: Determine the storage space of the GPU corresponding to the laser data.
[0053] When a laser ray passes through a geographic area in real space, the laser data on the laser ray corresponds to the geographic area, and the three-dimensional map data stored in the GPU's storage space represents the map information corresponding to that geographic area. When the laser ray passes through the geographic area again, the map information corresponding to that geographic area will be updated. For example, when constructing an occupancy grid map, the occupancy rate of the geographic area will be recalculated. This shows that there is also a one-to-one correspondence between laser data and GPU storage space. When data is stored, each laser data must be stored in its corresponding GPU storage space.
[0054] Therefore, the storage space of the GPU corresponding to the laser data may be determined first to increase the update speed of the map information corresponding to the geographical area.
[0055] S240 , allocating the multiple segments of laser data to multiple threads of the GPU for parallel processing, to obtain three-dimensional map data corresponding to the laser data.
[0056] Laser data is the image of a specific geographic area captured by a LiDAR sensor using laser beams. The 3D map data corresponding to this laser data is the map information for that geographic area. Therefore, the 3D map data corresponding to the laser data is the 3D map data corresponding to the geographic area through which the laser beam passes.
[0057] S250: storing the three-dimensional map data corresponding to the laser data into a storage space corresponding to the laser data to complete the three-dimensional map construction.
[0058] It should be noted that the execution order of S230 and S240 is not limited in the embodiments of the present application. S230 can be executed first and then S240, that is, after determining the storage space corresponding to the laser data, the laser data is processed to obtain the corresponding three-dimensional map data, and then the three-dimensional map data corresponding to the laser data is stored in the storage space corresponding to the laser data. S240 can also be executed first and then S230, that is, the three-dimensional map data can be determined from the laser data first and then the storage space can be determined. S230 and S240 can also be executed simultaneously, that is, the storage space can be determined from the laser data while the three-dimensional map data is determined from the laser data, and finally the three-dimensional map data is stored in the corresponding storage space, thereby improving the storage efficiency of the three-dimensional map data.
[0059] Among them, steps 210 to 220 are the same as steps 110 to 130. Therefore, the specific implementation of steps 210 to 220 can refer to steps 110 to 130 and will not be repeated here.
[0060] When a laser ray passes through a geographical area in real space, the laser data on the laser ray will correspond to the geographical area. When the laser data in the laser ray passes through a certain geographical area for the first time, in an optional manner, S230 includes: S231, searching for the storage space of the GPU corresponding to the laser data. If the search fails, allocating storage space for the laser data that failed to be searched.
[0061] When a laser ray passes through a geographic area in real space, the laser data on the laser ray will correspond to the geographic area. The GPU can find the address corresponding to the laser data from the storage space. If the search fails, it means that the laser data in the laser ray passes through a certain geographic area for the first time. At this time, storage space is allocated for the laser data that failed to be found.
[0062] S250 includes the following sub-steps:
[0063] S251, writing the three-dimensional map data corresponding to the laser data that failed to be found into the storage space corresponding to the laser data that failed to be found, wherein the storage space is the storage space allocated for the laser data that failed to be found.
[0064] The 3D map data corresponding to the laser data that passes through a certain geographic area for the first time is written into the storage space allocated to it for subsequent updating, rendering and display.
[0065] S253: Use the three-dimensional map data corresponding to the successfully found laser data to update the original three-dimensional map data in the storage space corresponding to the successfully found laser data, so as to complete the three-dimensional map construction.
[0066] When the laser beam passes through a certain geographic area again, the existing data in the storage space is updated using the new 3D map data. For example, when constructing an occupancy grid map, the occupancy rate of the geographic area corresponding to the laser data is recalculated based on the previously stored data and the newly acquired data.
[0067] When multiple laser rays pass through the same geographical area at the same time, when calculating the three-dimensional map data of the geographical area, it is necessary to update the three-dimensional map data of the geographical area by combining the laser data of the multiple laser rays. In an optional manner, S250 includes:
[0068] S252, determining whether there is an intersection between the storage spaces corresponding to the multiple segments of laser data.
[0069] Determine whether the storage spaces corresponding to multiple segments of laser data intersect, that is, whether the laser rays from the multiple segments of laser data pass through the same geographic area. This can be confirmed by comparing the storage spaces. If there is no intersection between the storage spaces, indicating that the compared laser rays do not pass through the same geographic area, then, after obtaining the 3D map data corresponding to the laser data, the 3D map data is stored in the corresponding storage space.
[0070] S254: If so, the three-dimensional map data corresponding to the multiple segments of laser data corresponding to the multiple storage spaces that have intersections are sequentially stored into the storage space corresponding to each segment of laser data to complete the three-dimensional map construction.
[0071] If there is an intersection between the storage spaces, it is determined that the laser rays of multiple laser data segments pass through the same geographical area. In this case, the three-dimensional map data corresponding to each segment of laser data needs to be stored in sequence. If the three-dimensional map data corresponding to each segment of laser data is still stored at the same time, the storage space corresponding to the geographical area will be based on the same data in the storage space when it is updated. As a result, the three-dimensional map data stored earlier in the three-dimensional map data stored multiple times will be overwritten by the three-dimensional map data stored later, thus not utilizing the earlier three-dimensional map data, resulting in an inaccurate three-dimensional map. However, if the three-dimensional map data corresponding to each segment of laser data is stored in sequence, the three-dimensional map data stored multiple times will be updated based on the previous three-dimensional map data. Therefore, the three-dimensional map data determined multiple times will be used to update the storage space corresponding to the geographical area, thereby making the generated three-dimensional map more accurate.
[0072] To improve the efficiency of building a three-dimensional map, in an optional manner, S250 includes:
[0073] S255, the three-dimensional map data corresponding to the laser data of multiple laser rays are stored in parallel in the storage space corresponding to the laser data of each laser ray, wherein, when storing the laser data of each laser ray, the three-dimensional map data corresponding to the laser data of the same laser ray are stored serially in the storage space corresponding to the laser data of the laser ray to complete the three-dimensional map construction.
[0074] The three-dimensional map data corresponding to the laser data of multiple laser rays are stored in parallel in the storage space corresponding to the laser data of each laser ray to make the best use of the multiple thread resources of the GPU; when storing the laser data of each laser ray, the three-dimensional map data corresponding to the laser data of the same laser ray are stored serially in the storage space corresponding to the laser data of the laser ray, so that the program for implementing the process is simple and the execution speed is fast.
[0075] To further improve the efficiency of building the three-dimensional map, in an optional manner, S255 includes:
[0076] S255a, stores the three-dimensional map data corresponding to the laser data of multiple laser rays in parallel into the storage space corresponding to the laser data of each laser ray, wherein, when storing the laser data of each laser ray, determines whether there is an intersection between the storage space corresponding to the laser data of the laser ray and the storage space corresponding to other laser rays. If so, the three-dimensional map data corresponding to the laser ray is serially stored into the storage space corresponding to the laser ray, starting from the part of the storage space corresponding to the laser ray far away from the intersection.
[0077] The same geographical area passed by the same batch of laser rays emitted by the lidar sensor is the area close to the lidar sensor. Since the lengths of the laser rays are basically unequal, the portion of the laser ray far from the above-mentioned intersection is the portion far from the emitting end of the lidar sensor (referred to as the far-end laser ray for short). Then, the data far from the intersection in the laser data of the same laser ray is the data of the far-end laser ray (referred to as the far-end laser data for short). Accordingly, for multiple laser rays with an intersection in the storage space, the three-dimensional map data corresponding to the laser rays are serially stored in the corresponding storage space starting from the three-dimensional map data corresponding to the far-end laser data, so that the three-dimensional map data corresponding to the laser data of multiple laser rays are stored in parallel, while the three-dimensional map data corresponding to the laser data of the laser rays close to the sensor are staggered, that is, the three-dimensional map data corresponding to the same geographical area are staggered.
[0078] FIG3 is a schematic diagram of the writing order of three-dimensional map data provided by an embodiment of the present application. Referring to FIG3 , after the laser radar emits laser beams A and B, a is the geographic area passed by laser beam A, b is the geographic area passed by laser beam B, and D is the area where a and b intersect. This means that laser beams A and B are determined to have passed through the same geographic area D. This means that when searching for the intersection of the storage space for A's laser data and the storage space for B's laser data, it is found that the storage space corresponding to area D is the common storage space for the three-dimensional map data of A and B. Therefore, the three-dimensional map data can be stored in the direction shown in FIG3 , starting from the end of laser beams A and B that is away from the transmitting end of the laser radar.
[0079] In an optional manner, S220 includes the following sub-steps:
[0080] S221 , determining whether each of the plurality of laser beams reaches a preset length.
[0081] S223 , segmenting the laser data of the laser beam that reaches a preset length to obtain multiple segments of laser data.
[0082] Laser rays that do not reach the preset length can be directly assigned to GPU threads for processing to improve the efficiency of building three-dimensional maps.
[0083] FIG4 shows a schematic diagram of the structure of a GPU-based 3D map construction device according to an embodiment of the present invention. As shown in FIG4 , the device 300 includes an acquisition module 310 , a segmentation module 320 , a processing module 330 , and a storage module 340 .
[0084] An acquisition module 310 is used to acquire laser data of a plurality of laser rays;
[0085] A segmentation module 320 is used to segment the laser data of each laser ray in the plurality of laser rays according to a preset length to obtain a plurality of segments of laser data;
[0086] The processing module 330 is used to distribute the multiple laser data segments to multiple threads of the GPU for parallel processing to obtain three-dimensional map data;
[0087] The storage module 340 is used to store the 3D map data into the storage space of the GPU to complete the 3D map construction.
[0088] The GPU-based 3D map construction device of the embodiment of the present application also includes other modules for executing the various steps of the above-mentioned GPU-based 3D map construction method embodiment, which will not be described one by one here.
[0089] The present application also provides a GPU-based 3D map construction device. Please refer to FIG. 5 . The GPU-based 3D map construction device 400 includes a processor 402 and a memory 404 .
[0090] The processor 402 is used to execute the program 406, and specifically can execute the relevant steps in the above embodiment of the method for constructing a three-dimensional map based on a GPU.
[0091] Specifically, program 406 may include computer-executable instructions.
[0092] Processor 402 may be a central processing unit (CPU), a specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the GPU-based 3D map construction device may be processors of the same type, such as one or more CPUs, or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0093] The memory 404 is used to store the program 406. The memory 404 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0094] The present application also provides a chip suitable for a GPU-based three-dimensional map construction device. The chip stores an instruction set. When the instruction set is executed, it can instruct the GPU-based three-dimensional map construction device to implement the operation of the GPU-based three-dimensional map construction method as described in any of the above embodiments.
[0095] In addition, the present application also provides a computer-readable storage medium, such as a chip, a CD, etc., on which an execution program is stored. When the execution program is executed, the GPU-based three-dimensional map construction method as described in any of the above embodiments is implemented.
[0096] The algorithm or demonstration provided here are not inherently relevant to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present application described here, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the present application.
[0097] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0098] Similarly, it should be understood that in order to streamline the present application and facilitate understanding of one or more of the various inventive aspects, in the above description of exemplary embodiments of the present application, various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed application requires more features than are expressly recited in each claim.
[0099] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and set in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed so far can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0100] It should be noted that the above embodiments illustrate rather than limit the present application, and that a person skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.
Claims
1. A GPU-based three-dimensional map construction method, characterized in that: The three-dimensional map constructed by the method is an occupancy grid map constructed based on voxel data, and the method comprises: Acquire laser data of a plurality of laser rays, wherein each laser ray includes a plurality of laser data corresponding to voxels passed by the laser ray; Segmenting the laser data of each laser ray in the plurality of laser rays according to a preset length to obtain a plurality of segments of laser data; Allocating the multiple segments of laser data to multiple threads of the GPU for parallel processing to obtain three-dimensional map data; The three-dimensional map data is stored in the storage space of the GPU to complete the three-dimensional map construction.
2. The method according to claim 1, characterized in that Before allocating the plurality of laser data segments to the plurality of threads of the GPU for parallel processing to obtain the three-dimensional map data, the method further includes: Determining a storage space of a GPU corresponding to the laser data; The step of allocating the plurality of laser data segments to the plurality of threads of the GPU for parallel processing to obtain the three-dimensional map data comprises: Allocating the multiple segments of laser data to multiple threads of the GPU for parallel processing to obtain three-dimensional map data corresponding to the laser data; The step of storing the three-dimensional map data into the storage space of the GPU to complete the three-dimensional map construction includes: The three-dimensional map data corresponding to the laser data is stored in a storage space corresponding to the laser data to complete the three-dimensional map construction.
3. The method according to claim 2, characterized in that The determining of the storage space of the GPU corresponding to the laser data includes: Searching for a storage space of a GPU corresponding to the laser data, and if the search fails, allocating storage space for the laser data for which the search failed; The step of storing the three-dimensional map data corresponding to the laser data into a storage space corresponding to the laser data to complete the three-dimensional map construction includes: Writing the three-dimensional map data corresponding to the failed-to-find laser data into a storage space corresponding to the failed-to-find laser data, wherein the storage space is a storage space allocated for the failed-to-find laser data; The three-dimensional map data corresponding to the successfully found laser data is used to update the original three-dimensional map data in the storage space corresponding to the successfully found laser data, so as to complete the three-dimensional map construction.
4. The method according to claim 2, characterized in that: The step of storing the three-dimensional map data corresponding to the laser data into a storage space corresponding to the laser data to complete the three-dimensional map construction includes: Determine whether there is an intersection between the storage spaces corresponding to the multiple segments of laser data; If so, the three-dimensional map data corresponding to the multiple segments of laser data corresponding to the multiple storage spaces with intersections are sequentially stored in the storage space corresponding to each segment of laser data to complete the three-dimensional map construction.
5. The method according to claim 2, characterized in that: The step of storing the three-dimensional map data corresponding to the laser data into a storage space corresponding to the laser data to complete the three-dimensional map construction includes: The three-dimensional map data corresponding to the laser data of the multiple laser rays are stored in parallel in a storage space corresponding to the laser data of each laser ray. When storing the laser data of each laser ray, the three-dimensional map data corresponding to the laser data of the same laser ray are stored serially in a storage space corresponding to the laser data of the laser ray to complete the construction of the three-dimensional map.
6. The method according to claim 5, characterized in that The three-dimensional map data corresponding to the laser data of the plurality of laser rays are stored in parallel in a storage space corresponding to the laser data of each laser ray, wherein when storing the laser data of each laser ray, the three-dimensional map data corresponding to the laser data of the same laser ray are stored serially in the storage space corresponding to the laser data of the laser ray to complete the three-dimensional map construction, including: The three-dimensional map data corresponding to the laser data of the plurality of laser rays are stored in parallel in a storage space corresponding to the laser data of each laser ray, wherein when storing the laser data of each laser ray, Determine whether there is an intersection between the storage space corresponding to the laser data of the laser ray and the storage space corresponding to other laser rays; If so, the three-dimensional map data corresponding to the laser ray is serially stored in the storage space corresponding to the laser ray, starting from the portion of the storage space corresponding to the laser ray that is far from the intersection.
7. The method according to claim 1, characterized in that The laser data of each laser ray in the plurality of laser rays is segmented according to a preset length to obtain a plurality of segments of laser data, including: Determining whether each of the plurality of laser beams reaches a preset length; The laser data of the laser beam reaching the preset length is segmented to obtain multiple segments of laser data.
8. A three-dimensional map construction device based on GPU, characterized in that: The three-dimensional map constructed by the device is an occupancy grid map constructed based on voxel data, and the device comprises: An acquisition module, used for acquiring laser data of a plurality of laser rays, wherein each laser ray includes a plurality of laser data corresponding to a voxel passed by the laser ray; A segmentation module, used for segmenting the laser data of each laser ray in the plurality of laser rays according to a preset length to obtain a plurality of segments of laser data; A processing module, used for allocating the multiple segments of laser data to multiple threads of the GPU for parallel processing to obtain three-dimensional map data; The storage module is used to store the three-dimensional map data into the storage space of the GPU to complete the three-dimensional map construction.
9. A three-dimensional map construction device based on GPU, characterized in that: The three-dimensional map constructed by the device is an occupancy grid map constructed based on voxel data, including: a processor and a memory, wherein the memory stores executable instructions, and the processor can execute the executable instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein at least one executable instruction is stored in the storage medium, characterized in that: When the executable instructions are executed, the method according to any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
Method for quickly filtering airborne laser point cloud data
CN102419794A
Method, system and device for constructing three-dimensional point cloud map
CN113424232A
Radar point cloud resolving method, device and system and storage medium
CN115756859A
Grid map construction method and device, equipment and storage medium
CN116954203A
GPU-based three-dimensional map construction method, apparatus and device, and storage medium
CN117351167A