Grid map construction method and device, storage medium and program product
By filtering and indexing the original point cloud map, a two-dimensional raster map is generated, which solves the problem of high computing complexity in the existing technology and realizes efficient raster map construction and path planning.
Patent Information
- Application Number
- CN202510648197.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, when converting a three-dimensional point cloud map directly into a raster map, the calculation complexity is high, resulting in low construction efficiency.
By filtering the original point cloud map, the size of the raster matrix and the matrix index of each point are determined, and a two-dimensional raster map is generated by projecting the raster matrix.
Improve the efficiency of raster map construction, reduce the use of computing resources, and ensure the accuracy of path planning.
Smart Images

Figure CN120445236A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of path planning, and in particular to a grid map construction method and device, a storage medium, and a program product. Background Art
[0002] Point cloud maps constructed using SLAM (Simultaneous Localization and Mapping) technology consist of a large number of three-dimensional points and contain rich environmental information. However, the amount of data in point cloud maps is usually very large, and there is a lack of direct topological relationships between points. Directly using point cloud maps for path planning has high computational complexity and low computational efficiency. Raster maps, on the other hand, are regular two-dimensional mesh structures, where each grid cell has the same fixed size and has clear row and column indices. Raster maps have a simple structure and are easy for computers to process. Therefore, converting point cloud maps into raster maps can improve the efficiency of subsequent algorithms such as path planning. Summary of the Invention
[0003] The inventors have noticed that in related art, the generated 3D point cloud map is projected according to elevation to generate a raster map. Projecting the 3D point cloud map according to elevation consumes a lot of computing resources, thereby reducing the efficiency of building the raster map.
[0004] Accordingly, the present disclosure provides a grid map construction method that can effectively improve the construction efficiency of the grid map.
[0005] According to a first aspect of an embodiment of the present disclosure, a grid map construction method is provided, comprising: filtering an original point cloud map to obtain a point cloud map to be processed; determining the size of a grid matrix based on the length of a first interval of the point cloud map to be processed on a first coordinate axis and the length of a second interval on a second coordinate axis perpendicular to the first coordinate axis, and the grid unit size; determining the matrix index of each point in the point cloud map to be processed based on the position coordinates of the point, the first lower boundary value of the first interval, the second lower boundary value of the second interval, the size of the grid matrix, and the grid unit size; setting the grid value corresponding to the matrix index in the grid matrix to a predetermined value; and performing grid projection on the point cloud map to be processed using the grid matrix to generate a two-dimensional grid map.
[0006] In some embodiments, determining the size of the grid matrix includes: creating a grid, wherein the grid cells in the grid have the grid cell size; obtaining the size of the grid matrix based on the maximum length of the first interval and the second interval, and the grid cell size.
[0007] In some embodiments, obtaining the size of the grid matrix includes: obtaining a first intermediate value according to the maximum length and a predetermined parameter value; and obtaining the size of the grid matrix according to the first intermediate value and the grid unit size.
[0008] In some embodiments, obtaining the first intermediate value includes: calculating the sum of the maximum length and the predetermined parameter value to obtain the first intermediate value; obtaining the size of the grid matrix includes: calculating the ratio of the first intermediate value and the grid unit size to obtain the size of the grid matrix.
[0009] In some embodiments, determining the matrix index of each point includes: determining the index coordinates of each point based on the position coordinates of each point, the first lower boundary value, the second lower boundary value and the grid unit size; and determining the matrix index of each point based on the index coordinates of each point and the size of the grid matrix.
[0010] In some embodiments, the index coordinates include a first index coordinate value on the first coordinate axis and a second index coordinate value on the second coordinate axis, and determining the matrix index of each point includes: obtaining a second intermediate value based on the second index coordinate value and the size of the grid matrix; and obtaining the matrix index of each point based on the second intermediate value and the first index coordinate value.
[0011] In some embodiments, obtaining the second intermediate value includes: calculating the product of the second index coordinate value and the size of the grid matrix to obtain the second intermediate value; obtaining the matrix index of each point includes: calculating the sum of the second intermediate value and the first index coordinate value to obtain the matrix index of each point.
[0012] In some embodiments, the position coordinates of each point include a first coordinate value on the first coordinate axis and a second coordinate value on the second coordinate axis, and determining the index coordinates of each point includes: determining the first index coordinate value of each point on the first coordinate axis based on the first coordinate value, the first lower boundary value and the grid unit size; and determining the second index coordinate value of each point on the second coordinate axis based on the second coordinate value, the second lower boundary value and the grid unit size.
[0013] In some embodiments, determining the first index coordinate value of each point on the first coordinate axis includes: obtaining a third intermediate value based on the first coordinate value and the first lower boundary value; obtaining the first index coordinate value of each point on the first coordinate axis based on the third intermediate value and the grid unit size; determining the second index coordinate value of each point on the second coordinate axis includes: obtaining a fourth intermediate value based on the second coordinate value and the second lower boundary value; obtaining the second index coordinate value of each point on the second coordinate axis based on the fourth intermediate value and the grid unit size.
[0014] In some embodiments, obtaining the third intermediate value includes: calculating the difference between the first coordinate value and the first lower boundary value to obtain the third intermediate value; obtaining the first index coordinate value of each point on the first coordinate axis includes: calculating the ratio of the third intermediate value and the grid unit size to obtain the first index coordinate value; obtaining the fourth intermediate value includes: calculating the difference between the second coordinate value and the second lower boundary value to obtain the fourth intermediate value; obtaining the second index coordinate value of each point on the second coordinate axis includes: calculating the ratio of the fourth intermediate value and the grid unit size to obtain the second index coordinate value.
[0015] In some embodiments, the length of the first interval is the distance between the first upper boundary value and the first lower boundary value of the first interval; the length of the second interval is the distance between the second upper boundary value and the second lower boundary value of the second interval.
[0016] In some embodiments, the filtering includes at least one of the following: removing ground point cloud data in the original point cloud map, and removing roof point cloud data in the original point cloud map.
[0017] In some embodiments, it also includes: generating an original point cloud map, wherein generating the original point cloud map includes: using a real-time differential positioning RTK device to determine the target orientation angle for constructing the map; at the starting point of constructing the map, using the RTK device to measure the current orientation angle for constructing the map and the longitude coordinates, latitude coordinates and altitude coordinates of the starting point; constructing a rotation matrix based on the deviation between the current orientation angle and the target orientation angle; converting the longitude coordinates, latitude coordinates and altitude coordinates into a geodetic coordinate system to obtain three-dimensional coordinates; determining a first transformation matrix based on the rotation matrix and the three-dimensional coordinates; and using the first transformation matrix, a second transformation matrix between the lidar and the RTK device to convert the local point cloud map collected by the lidar into a geodetic coordinate system to generate an original point cloud map.
[0018] In some embodiments, generating the original point cloud map includes: calculating the product of the first transformation matrix, the second transformation matrix, and the local point cloud map to generate the original point cloud map.
[0019] According to a second aspect of an embodiment of the present disclosure, a grid map construction device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute, based on instructions stored in the memory, a grid map construction method as described in any of the above embodiments.
[0020] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, a grid map construction method as involved in any of the above embodiments is implemented.
[0021] According to a fourth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, the grid map construction method involved in any of the above embodiments is implemented.
[0022] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A flowchart of a grid map construction method according to an embodiment of the present disclosure is shown;
[0025] Figure 2 A schematic diagram of a flow chart of a method for generating an original point cloud map according to an embodiment of the present disclosure;
[0026] Figure 3 A schematic structural diagram of a grid map construction device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is in no way intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0028] Unless specifically stated otherwise, the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0029] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0030] Technologies, methods and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, such technologies, methods and equipment should be considered part of the authorization specification.
[0031] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0032] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0033] Figure 1 The flowchart of the grid map construction method according to one embodiment of the present disclosure is shown in FIG. In some embodiments, the following grid map construction method is executed by a grid map construction device, including steps 11-15.
[0034] In step 11, the original point cloud map is filtered to obtain a point cloud map to be processed.
[0035] In some embodiments, filtering includes at least one of the following: removing ground point cloud data in the original point cloud map, and removing roof point cloud data in the original point cloud map.
[0036] It's important to note that the ground point cloud data in the original point cloud map can cause the path planning algorithm to mistakenly identify obstacles in the ground area. Furthermore, the raster projection of the rooftop point cloud data in the original point cloud map can also cause the path planning algorithm to mistakenly identify obstacles in the ground area, thus causing errors and interference in path planning. The aforementioned filtering process effectively prevents errors and interference in path planning caused by noisy point cloud data in the original point cloud map.
[0037] In some embodiments, using Figure 2 The process described generates an original point cloud map.
[0038] In step 12, the size of the grid matrix is determined according to the length of a first interval on a first coordinate axis, the length of a second interval on a second coordinate axis perpendicular to the first coordinate axis, and the size of the grid unit of the point cloud map to be processed.
[0039] In some embodiments, the length of the first interval is the distance between the first upper boundary value and the first lower boundary value of the first interval. The length of the second interval is the distance between the second upper boundary value and the second lower boundary value of the second interval.
[0040] For example, the first upper boundary value of the first interval of the point cloud map to be processed on the first coordinate axis is , the first lower boundary value is The second upper boundary value of the second interval of the point cloud map to be processed on the second coordinate axis perpendicular to the first coordinate axis is , the second lower boundary value is , then the length of the first interval As shown in formula (1), the length of the second interval As shown in formula (2).
[0041] (1)
[0042] (2)
[0043] In some embodiments, the step of determining the size of the grid matrix includes the following steps S1 - S2 .
[0044] S1) creating a grid, wherein grid cells in the grid have a grid cell size.
[0045] S2) Obtaining a size of the grid matrix according to a maximum length of the first interval and the second interval, and a grid unit size.
[0046] In some embodiments, an intermediate value is obtained based on the maximum length and a predetermined parameter value, and the size of the grid matrix is obtained based on the intermediate value and the grid cell size.
[0047] For example, the sum of the maximum length and the predetermined parameter value is calculated to obtain the intermediate value, and the ratio of the intermediate value to the grid cell size is calculated to obtain the size of the grid matrix.
[0048] For example, let the maximum length of the first interval and the second interval be , the reservation parameter value is 1, and the grid cell size is , then the maximum length As shown in formula (3), the size of the grid matrix As shown in formula (4).
[0049] (3)
[0050] (4)
[0051] It should be noted that the grid cell size and the predetermined parameter values can be determined empirically. The grid cell size will affect the accuracy and computational complexity of the grid map. The smaller the grid cell size, the higher the grid map accuracy and the higher the computational complexity.
[0052] In addition, the size of the grid matrix is determined according to the maximum length of the first interval and the second interval and a predetermined parameter value, which can ensure that the created grid completely covers the projection range of the point cloud map to be processed while reducing the redundant space of the grid map.
[0053] In step 13, the matrix index of each point is determined according to the position coordinates of each point in the point cloud map to be processed, the first lower boundary value of the first interval, the second lower boundary value of the second interval, the size of the grid matrix and the grid cell size.
[0054] In some embodiments, the step of determining the matrix index of each point includes the following steps S1-S2.
[0055] S1) determining the index coordinates of each point according to the position coordinates, the first lower boundary value, the second lower boundary value, and the grid unit size of each point.
[0056] It should be noted here that the position coordinates of each point include a first coordinate value on the first coordinate axis and a second coordinate value on the second coordinate axis perpendicular to the first coordinate axis, and also include a third coordinate value on the third coordinate axis perpendicular to the first coordinate axis and the second coordinate axis, that is, the position coordinates of each point are its three-dimensional coordinates in the point cloud map to be processed.
[0057] In some embodiments, the step of determining the index coordinates of each point includes steps S11 - S12 .
[0058] S11) determining a first index coordinate value of each point on the first coordinate axis according to the first coordinate value of each point on the first coordinate axis, the first lower boundary value, and the grid unit size.
[0059] In some embodiments, an intermediate value is obtained based on the first coordinate value and the first lower boundary value of each point on the first coordinate axis, and a first index coordinate value of each point on the first coordinate axis is obtained based on the intermediate value and the grid cell size.
[0060] For example, the difference between the first coordinate value and the first lower boundary value of each point on the first coordinate axis is calculated to obtain the intermediate value, and the ratio of the intermediate value to the grid unit size is calculated to obtain the first index coordinate value.
[0061] For example, suppose the position coordinates of the i-th point in the point cloud map to be processed are , where the first coordinate value on the first coordinate axis is The first lower boundary value of the first interval of the point cloud map to be processed on the first coordinate axis is , the grid cell size is , then the first index coordinate value As shown in formula (5).
[0062] (5)
[0063] S12) Determine a second index coordinate value of each point on the second coordinate axis according to the second coordinate value of each point on the second coordinate axis, the second lower boundary value, and the grid unit size.
[0064] In some embodiments, an intermediate value is obtained based on the second coordinate value and the second lower boundary value of each point on the second coordinate axis, and a second index coordinate value of each point on the second coordinate axis is obtained based on the intermediate value and the grid cell size.
[0065] For example, the difference between the second coordinate value of each point on the second coordinate axis and the second lower boundary value is calculated to obtain the intermediate value, and the ratio of the intermediate value to the grid unit size is calculated to obtain the second index coordinate value.
[0066] For example, suppose the position coordinates of the i-th point in the point cloud map to be processed are , where the second coordinate value on the second coordinate axis is The second lower boundary value of the second interval of the point cloud map to be processed on the second coordinate axis is , the grid cell size is , then the second index coordinate value As shown in formula (6).
[0067] (6)
[0068] For example, the first index coordinate value of the index coordinate of the i-th point is determined by the above formulas (5) and (6): and the second index coordinate value , then the index coordinates of the i-th point are .
[0069] S2) determining the matrix index of each point according to the index coordinates of each point and the size of the grid matrix.
[0070] In some embodiments, an intermediate value is obtained based on a second index coordinate value of the index coordinate on the second coordinate axis and the size of the grid matrix, and a matrix index of each point is obtained based on the intermediate value and a first index coordinate value of the index coordinate on the first coordinate axis.
[0071] For example, the product of the second index coordinate value and the size of the grid matrix is calculated to obtain the intermediate value, and the sum of the intermediate value and the first index coordinate value is calculated to obtain the matrix index of each point.
[0072] For example, let the index coordinates of the i-th point be , where the first index coordinate value is , the second index coordinate value is , the size of the grid matrix is m, then the matrix index of the i-th point is As shown in formula (7).
[0073] (7)
[0074] In step 14, the grid value corresponding to the matrix index in the grid matrix is set to a predetermined value.
[0075] For example, assuming the predetermined value is 100, as shown in formula (8), the grid matrix The matrix index of the i-th point The corresponding grid values are set to predetermined values.
[0076] (8)
[0077] It should be noted here that by converting the raster matrix into a one-dimensional array, the processing of raster values can be accelerated.
[0078] In step 15, the point cloud map to be processed is subjected to grid projection using a grid matrix to generate a two-dimensional grid map.
[0079] For example, the OccupancyGrid algorithm of ROS (Robot Operating System) is used to perform grid projection on the point cloud map to be processed using the grid and matrix index created above to generate a two-dimensional grid map.
[0080] The grid map construction method provided by the above embodiment can quickly convert a discrete three-dimensional point cloud map into a two-dimensional grid map, thereby effectively improving the efficiency of grid map construction.
[0081] Figure 2 The figure is a flowchart of a method for generating an original point cloud map according to an embodiment of the present disclosure. In some embodiments, the following method for generating an original point cloud map is performed by a grid map construction device, including steps 21-26.
[0082] In step 21, a Real-Time Kinematic (RTK) device is used to determine the target orientation angle for constructing the map.
[0083] For example, SLAM technology is used to generate and build maps.
[0084] It should be noted that RTK is a high-precision satellite navigation technology based on carrier phase differential technology, capable of providing centimeter-level positioning accuracy. The target orientation angle for map construction can be determined based on road conditions or the direction of interest.
[0085] In step 22, at the starting point of map construction, the current orientation angle of the map construction and the longitude coordinates, latitude coordinates and altitude coordinates of the starting point are measured using RTK equipment.
[0086] In step 23, a rotation matrix is constructed based on the deviation between the current heading angle and the target heading angle.
[0087] For example, let the current heading angle be , the target heading angle is , then according to the deviation between the current heading angle and the target heading angle , construct the rotation matrix R. The deviation between the current heading angle and the target heading angle is shown in formula (9).
[0088] (9)
[0089] In step 24, the longitude coordinates, the latitude coordinates and the altitude coordinates are converted into a geodetic coordinate system to obtain three-dimensional coordinates.
[0090] For example, let the longitude coordinate of the starting point be , the latitude coordinate is , the height coordinate is , convert it to the geodetic coordinate system, and the three-dimensional coordinates are .
[0091] It should be noted that the geodetic coordinate system is the Earth's standard coordinate system, with the origin at the Earth's center. The three-dimensional coordinates of the geodetic coordinate system represent longitude, latitude, and altitude. Common geodetic coordinate systems include WGS84 (World Geodetic System 1984).
[0092] In step 25, a first transformation matrix is determined according to the rotation matrix and the three-dimensional coordinates.
[0093] For example, according to the rotation matrix R and the three-dimensional coordinates , determine the first transformation matrix .
[0094] It should be noted here that the first transformation matrix can realize the coordinate transformation from the RTK device to the geodetic coordinate system.
[0095] In step 26 , the local point cloud map collected by the lidar is converted into a geodetic coordinate system using the first transformation matrix and the second transformation matrix between the lidar and the RTK device to generate an original point cloud map.
[0096] In some embodiments, the product of the first transformation matrix, the second transformation matrix, and the local point cloud map is calculated to generate an original point cloud map.
[0097] For example, let the first transformation matrix be , the second transformation matrix is , the local point cloud map is , then use formula (10) to generate the original point cloud map.
[0098] (10)
[0099] It should be noted that the second transformation matrix between the laser radar and the RTK device can be obtained through calibration. The second transformation matrix can realize the coordinate transformation between the laser radar and the RTK device.
[0100] It should be noted here that converting the local point cloud map to the geodetic coordinate system can improve positioning accuracy and reduce cumulative errors. At the same time, it can ensure the standardization of the data format and facilitate fusion analysis with other forms of data (for example, satellite images).
[0101] By using the method provided in the above embodiment, the local point cloud map collected by the lidar is converted into a geodetic coordinate system, thereby achieving automatic correction of the point cloud map.
[0102] Figure 3 This is a schematic diagram of the structure of a grid map construction device according to an embodiment of the present disclosure. Figure 3As shown, the grid map construction device 30 includes a memory 31, a processor 32 and a bus 33 connecting different system components.
[0103] The memory 31 may include, for example, system memory, non-volatile storage media, and the like. The system memory may store, for example, an operating system, application programs, a boot loader, and other programs. The system memory may include volatile storage media, such as random access memory (RAM) and / or cache memory. The non-volatile storage media may store, for example, instructions corresponding to at least one embodiment of the currently executing raster map construction method. Non-volatile storage media include, but are not limited to, disk storage, optical storage, and flash memory.
[0104] The processor 32 may be implemented using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, or discrete hardware components such as discrete gates or transistors. Accordingly, the method in any of the above embodiments may be implemented by a central processing unit (CPU) executing instructions in a memory that execute the corresponding steps, or by dedicated circuits that execute the corresponding steps.
[0105] For example, the processor 32 is configured to execute instructions stored in the memory to implement the following Figure 1 or Figure 2 The method according to any one of the embodiments.
[0106] The bus 33 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
[0107] These interfaces 34, 35, and 36 of the raster map construction device 30, as well as the memory 31 and the processor 32, can be connected via a bus 33. The input / output interface 34 provides a connection interface for input / output devices such as a display, mouse, and keyboard. The network interface 35 provides a connection interface for various networked devices. The storage interface 36 provides a connection interface for external storage devices such as floppy disks, USB flash drives, and SD cards.
[0108] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks, can be implemented by computer-readable program instructions.
[0109] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowcharts and / or block diagrams.
[0110] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to operate in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowcharts and / or block diagrams.
[0111] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0112] The present disclosure also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the following Figure 1 or Figure 2 The method according to any one of the embodiments.
[0113] The present disclosure also provides a computer program product, including computer instructions, wherein when the computer instructions are executed by a processor, the following is achieved: Figure 1 or Figure 2 The method according to any one of the embodiments.
[0114] By implementing the above-mentioned embodiments of the present disclosure, the following beneficial effects can be obtained.
[0115] 1) Ability to quickly construct a grid map using discrete 3D point cloud maps to meet the needs of subsequent path planning and task scheduling development;
[0116] 2) It can efficiently align the point cloud map with the actual working environment to build a high-precision raster map.
[0117] In some embodiments, the functional units described above may be implemented as general-purpose processors, programmable logic controllers (PLCs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or any appropriate combination thereof, for performing the functions described in the present disclosure.
[0118] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0119] The description of the present disclosure is provided for purposes of illustration and description and is not intended to be exhaustive or to limit the disclosure to the disclosed form. Many modifications and variations will be apparent to those skilled in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure and to enable those skilled in the art to understand the present disclosure and design various embodiments with various modifications suitable for specific applications.
Claims
1. A grid map construction method, performed by a grid map construction device, comprising: Filter the original point cloud map to obtain the point cloud map to be processed; Determining a size of a grid matrix according to a length of a first interval of the point cloud map to be processed on a first coordinate axis, a length of a second interval on a second coordinate axis perpendicular to the first coordinate axis, and a grid unit size; Determining a matrix index of each point according to the position coordinates of each point in the point cloud map to be processed, a first lower boundary value of the first interval, a second lower boundary value of the second interval, a size of the grid matrix, and a size of the grid cell; Setting the grid value corresponding to the matrix index in the grid matrix to a predetermined value; The grid matrix is used to perform grid projection on the point cloud map to be processed to generate a two-dimensional grid map.
2. The method according to claim 1, wherein Determining the size of the grid matrix includes: creating a grid, wherein grid cells in the grid have the grid cell size; The size of the grid matrix is obtained according to the maximum length of the first interval and the second interval, and the grid unit size.
3. The method according to claim 2, wherein: Obtaining the size of the grid matrix includes: Obtaining a first intermediate value according to the maximum length and a predetermined parameter value; The size of the grid matrix is obtained according to the first intermediate value and the grid unit size.
4. The method according to claim 3, wherein: Obtaining the first intermediate value includes: Calculating the sum of the maximum length and the predetermined parameter value to obtain the first intermediate value; Obtaining the size of the grid matrix includes: The ratio of the first intermediate value to the grid unit size is calculated to obtain the size of the grid matrix.
5. The method according to claim 1, wherein Determining the matrix index of each point includes: determining the index coordinates of each point according to the position coordinates of each point, the first lower boundary value, the second lower boundary value, and the grid unit size; The matrix index of each point is determined according to the index coordinates of each point and the size of the grid matrix.
6. The method according to claim 5, wherein: The index coordinates include a first index coordinate value on the first coordinate axis and a second index coordinate value on the second coordinate axis, Determining the matrix index of each point includes: Obtaining a second intermediate value according to the second index coordinate value and the size of the grid matrix; A matrix index of each point is obtained according to the second intermediate value and the first index coordinate value.
7. The method according to claim 6, wherein: Obtaining the second intermediate value includes: Calculating the product of the second index coordinate value and the size of the grid matrix to obtain the second intermediate value; Obtaining the matrix index of each point includes: The sum of the second intermediate value and the first index coordinate value is calculated to obtain the matrix index of each point.
8. The method according to claim 5, wherein The position coordinates of each point include a first coordinate value on the first coordinate axis and a second coordinate value on the second coordinate axis. Determining the index coordinates of each point includes: Determine a first index coordinate value of each point on the first coordinate axis according to the first coordinate value, the first lower boundary value, and the grid unit size; A second index coordinate value of each point on the second coordinate axis is determined according to the second coordinate value, the second lower boundary value, and the grid unit size.
9. The method according to claim 8, wherein Determining the first index coordinate value of each point on the first coordinate axis includes: Obtaining a third intermediate value according to the first coordinate value and the first lower boundary value; Obtaining a first index coordinate value of each point on the first coordinate axis according to the third intermediate value and the grid unit size; Determining the second index coordinate value of each point on the second coordinate axis includes: Obtaining a fourth intermediate value according to the second coordinate value and the second lower boundary value; A second index coordinate value of each point on the second coordinate axis is obtained according to the fourth intermediate value and the grid unit size.
10. The method according to claim 9, wherein: Obtaining the third intermediate value includes: Calculating the difference between the first coordinate value and the first lower boundary value to obtain the third intermediate value; Obtaining the first index coordinate value of each point on the first coordinate axis includes: Calculating a ratio of the third intermediate value to the grid unit size to obtain the first index coordinate value; Obtaining the fourth intermediate value includes: Calculating the difference between the second coordinate value and the second lower boundary value to obtain the fourth intermediate value; Obtaining the second index coordinate value of each point on the second coordinate axis includes: The ratio of the fourth intermediate value to the grid unit size is calculated to obtain the second index coordinate value.
11. The method according to claim 1, wherein The length of the first interval is the distance between a first upper boundary value and a first lower boundary value of the first interval; The length of the second interval is the distance between the second upper boundary value and the second lower boundary value of the second interval.
12. The method according to claim 1, wherein The filtering includes at least one of the following: removing ground point cloud data in the original point cloud map, and removing roof point cloud data in the original point cloud map.
13. The method according to any one of claims 1 to 12, further comprising: Generate the original point cloud map, wherein generating the original point cloud map includes: Use real-time differential positioning (RTK) equipment to determine the target orientation angle for map construction; At the starting point of the map construction, using the RTK device to measure the current orientation angle of the map construction and the longitude coordinates, latitude coordinates and altitude coordinates of the starting point; Constructing a rotation matrix based on the deviation between the current orientation angle and the target orientation angle; Converting the longitude coordinate, the latitude coordinate, and the altitude coordinate into a geodetic coordinate system to obtain three-dimensional coordinates; Determine a first transformation matrix according to the rotation matrix and the three-dimensional coordinates; The local point cloud map collected by the laser radar is converted into a geodetic coordinate system by using the first transformation matrix and a second transformation matrix between the laser radar and the RTK device to generate the original point cloud map.
14. The method according to claim 13, wherein Generating the original point cloud map includes: Calculate the product of the first transformation matrix, the second transformation matrix, and the local point cloud map to generate the original point cloud map.
15. A grid map construction device, comprising: Memory; A processor is coupled to the memory, and the processor is configured to execute the method according to any one of claims 1 to 14 based on instructions stored in the memory.
16. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the method according to any one of claims 1 to 14 is implemented.
17. A computer program product comprising computer instructions, wherein when the computer instructions are executed by a processor, the method according to any one of claims 1 to 14 is implemented.