A map generation method, apparatus, device and product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]有鉴于此,本发明实施例提供了一种地图生成方法、装置、设备及产品,以解决现有技术存在基于CPU串行计算的ESDF生成算法因计算范式与硬件特性不匹配,在动态场景下易出现分支预测失败,导致距离场更新延迟高、稳定性差的问题
[0015]本发明以栅格图为基础构建种子坐标张量,将障碍物网格的真实坐标与空闲网格的无穷大值统一为张量数据,规避了动态队列维护与分支判断的计算范式;其次,通过张量化迭代机制对种子坐标张量进行多轮邻域更新,以固定步长的并行张量运算替代串行BFS波前传播,利用硬件并行特性实现无分支、全并行的距离计算,避免了串行计算带来的延迟抖动;然后,基于迭代收敛的种子坐标张量生成距离场地图,其迭代过程无需条件分支与动态调度;最后,通过语义修正矩阵对距离场地图进行修正,在不破坏并行计算流程的前提下,融合障碍物语义信息优化距离场,兼顾了实时性与场景适配性,解决了现有 CPU 串行算法因计算范式冲突导致的延迟高、稳定性差的问题。
Smart Images

Figure CN122574158A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of environmental modeling, and specifically to a map generation method, apparatus, device, and product. Background Technology
[0002] The Euclidean Distance Field (EDF) is an environmental representation of high-frequency obstacle avoidance planning (such as TEB and CHOMP trajectory optimization) for mobile robots. Its generation efficiency and stability directly determine the obstacle avoidance performance of the robot in dynamic and complex scenarios.
[0003] Current mainstream ESDF generation algorithms (such as FIESTA and Voxblox) mostly rely on embedded CPUs to perform serial computations. The core computational paradigm is based on breadth-first search (BFS) or wavefront propagation, which requires frequent maintenance of dynamic queues and execution of a large number of conditional branch judgments. In dynamic scenes with dense pedestrians, the distribution of obstacles is complex and variable, and the failure rate of CPU branch prediction increases significantly, resulting in severe delay jitter in distance field map updates. This makes it difficult to meet the stringent requirements of high-frequency obstacle avoidance planning for the real-time performance and stability of the distance field. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a map generation method, apparatus, device and product to solve the problem that the existing ESDF generation algorithm based on CPU serial computing is prone to branch prediction failure in dynamic scenarios due to the mismatch between the computing paradigm and hardware characteristics, resulting in high distance field update delay and poor stability.
[0005] In a first aspect, embodiments of the present invention provide a map generation method, the method comprising: Acquire the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment, wherein the grid map includes multiple grids, each grid carrying a corresponding label, the label being used to indicate whether the corresponding grid contains dynamic obstacles; A seed coordinate tensor is constructed based on the grid diagram. In the seed coordinate tensor, the actual coordinates of the grid with dynamic obstacles are used as the tensor value, and the preset infinite floating-point value is used as the tensor value for the grid without dynamic obstacles. The seed coordinate tensor is updated in multiple rounds using a tensor quantization iterative mechanism to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, and a distance field map is generated based on the Euclidean distances of all grids. Obtain the semantic correction matrix that matches the pose data, and use the semantic correction matrix to correct the range field map to obtain the target range field map.
[0006] Furthermore, acquiring the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment includes: Real-time environmental images of the environment are acquired through a camera; The radar point cloud data of the environment is acquired using lidar; The first neural network processor extracts the pose data of dynamic obstacles from the real-time environmental image, and the second neural network processor converts the radar point cloud data into a raster image.
[0007] Furthermore, the method also includes: After the first neural network processor extracts the pose data of the dynamic obstacle, it writes the first synchronization flag bit to the on-chip static memory; and after the second neural network processor converts the radar point cloud data into a raster image, it writes the second synchronization flag bit to the on-chip static memory. After confirming that both the first synchronization flag and the second synchronization flag in the on-chip static memory are set, the construction of the seed coordinate tensor is triggered.
[0008] Furthermore, the construction of the seed coordinate tensor based on the raster image includes: Using the markers on each grid in the grid diagram, a first grid containing dynamic obstacles and a second grid without dynamic obstacles are divided; Assign its own corresponding real coordinates to the first grid to obtain the first coordinate data, and assign a preset infinite floating-point value to the second grid to obtain the second coordinate data; The first coordinate data and the second coordinate data are combined according to the grid position to construct the seed coordinate tensor.
[0009] Furthermore, the step of using a tensor quantization iterative mechanism to perform multiple rounds of neighborhood updates on the seed coordinate tensor to obtain the Euclidean distance from each grid to the nearest dynamic obstacle includes: The maximum iteration step size is initialized based on the side length of the grid image, and a decreasing rule is set to halve the step size each time. In each iteration, the seed coordinate tensor is translated along multiple directions by the current step size to obtain multiple sets of neighborhood tensors, where each set of neighborhood tensors corresponds to a direction; The squared Euclidean distance between each grid and the corresponding position of the neighborhood tensor is calculated in parallel. The seed coordinates corresponding to the minimum distance are retained for each grid, and the seed coordinate tensor is updated to obtain the seed coordinate tensor after this iteration. The neighborhood update operation is repeated according to the step size decreasing rule until the step size is 1. The Euclidean distance from each grid to the nearest dynamic obstacle is calculated based on the finally obtained seed coordinate tensor.
[0010] Furthermore, the calculation of the Euclidean distance from each grid to the nearest dynamic obstacle based on the finally obtained seed coordinate tensor includes: Obtain the seed coordinate tensor after the iteration is completed, and extract the most recent dynamic obstacle coordinate data stored in each grid from it; Based on the grid index of the raster image, obtain the actual coordinates corresponding to each grid. For each grid cell, calculate the Euclidean distance between its true coordinates and the coordinates of the nearest dynamic obstacle; Arrange the Euclidean distances calculated from all grids according to their grid positions to obtain the Euclidean distance from each grid to the nearest dynamic obstacle.
[0011] Furthermore, the step of correcting the distance field map using the semantic correction matrix to obtain the target distance field map includes: Obtain a blank semantic correction tensor with the same size as the distance field map, and paste the semantic correction matrix into the corresponding area of the semantic correction tensor according to the pixel position of the dynamic obstacle; The semantic correction tensor after pasting is filled to obtain a semantic correction tensor that completely covers the entire image; The distance field map and the semantic correction tensor are fused element-wise to generate corrected distance field data, and the corrected distance field data is arranged according to the grid position to obtain the target distance field map.
[0012] Secondly, embodiments of the present invention provide a map generation apparatus, the apparatus comprising: The acquisition module is used to acquire the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment. The grid map includes multiple grids, each grid carrying a corresponding marker, which is used to indicate whether there are dynamic obstacles in the corresponding grid. The construction module is used to construct a seed coordinate tensor based on the grid map. In the seed coordinate tensor, for grids with dynamic obstacles, the tensor value is the grid's own real coordinates, and for grids without dynamic obstacles, the tensor value is a preset infinite floating-point value. The update module is used to perform multiple rounds of neighborhood updates on the seed coordinate tensor using a tensor quantization iteration mechanism to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, and generate a distance field map based on the Euclidean distances corresponding to all grids. The processing module is used to obtain the semantic correction matrix that matches the pose data, and to use the semantic correction matrix to correct the distance field map to obtain the target distance field map.
[0013] Thirdly, embodiments of the present invention provide a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0014] Fourthly, embodiments of the present invention provide a computer program product storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.
[0015] This invention constructs a seed coordinate tensor based on a raster graph, unifying the real coordinates of obstacle grids and the infinite values of free grids into tensor data, thus avoiding the computational paradigm of dynamic queue maintenance and branch judgment. Secondly, it performs multiple rounds of neighborhood updates on the seed coordinate tensor through a tensor iteration mechanism, replacing serial BFS wavefront propagation with parallel tensor operations of fixed step size. This leverages hardware parallelism to achieve branchless, fully parallel distance calculation, avoiding the latency jitter caused by serial computation. Then, a distance field map is generated based on the iteratively converged seed coordinate tensor, with its iteration process requiring no conditional branches or dynamic scheduling. Finally, the distance field map is corrected using a semantic correction matrix, optimizing the distance field by integrating obstacle semantic information without disrupting the parallel computation process. This balances real-time performance and scene adaptability, solving the problems of high latency and poor stability caused by computational paradigm conflicts in existing CPU serial algorithms. Attached Figure Description
[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a schematic flowchart of a map generation method according to some embodiments of the present invention; Figure 2 This is a schematic diagram of tensor quantization step size update according to some embodiments of the present invention; Figure 3 This is a schematic diagram of the framework of a map generation system according to some embodiments of the present invention; Figure 4 This is a structural block diagram of a map generation apparatus according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] According to embodiments of the present invention, a map generation method, apparatus, device, and product are provided. It should be noted that the steps shown in the flowcharts in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0020] This embodiment provides a map generation method. Figure 1 This is a flowchart of a map generation method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment. The grid map includes multiple grids, each grid carrying a corresponding label, which is used to indicate whether there are dynamic obstacles in the corresponding grid.
[0021] In this embodiment, dynamic obstacle pose estimation is performed on the acquired real-time environmental images. The mask, semantic ID, and orientation angle data of the obstacles are extracted through image segmentation and target detection algorithms. The mask is used to mark the region of the obstacle in the image, the semantic ID is used to distinguish the type of obstacle, and the orientation angle θ represents the direction of movement of the obstacle. These data together constitute the pose data of the dynamic obstacle. At the same time, coordinate transformation is performed on the acquired lidar point cloud data to convert the three-dimensional point cloud from the lidar coordinate system to the environmental coordinate system. Then, the point cloud is projected onto a two-dimensional plane through rasterization to generate a two-dimensional probabilistic occupancy map. The occupancy map is divided into multiple equal-sized grids. Each grid is marked as occupied or idle according to the distribution density of the projected point cloud. The occupied state corresponds to the region where there is a dynamic obstacle, and the idle state corresponds to the region where there is no dynamic obstacle. Finally, the raster map corresponding to the environment is obtained.
[0022] Step S102: Construct a seed coordinate tensor based on the raster graph. In the seed coordinate tensor, the real coordinates of the grid with dynamic obstacles are used as the tensor value, and the preset infinite floating-point value is used as the tensor value for the grid without dynamic obstacles.
[0023] In this embodiment, a feature tensor of shape (2,H,W) is constructed based on the grid image size H×W and the grid resolution. The seed coordinate tensor stores the X-coordinates of each grid cell in channel 0 and the Y-coordinates of each grid cell in channel 1. Each element of the tensor corresponds to the coordinate information of a grid cell in the raster image. Subsequently, each grid cell in the raster image is traversed, and values are assigned according to the grid cell's marking information. For occupied grid cells marked as having dynamic obstacles, their actual physical coordinates are written to the corresponding position of the seed coordinate tensor as the initial seed value. These grid cells are called "occupied pixels," and their initial coordinates are their actual positions. For free grid cells marked as not having dynamic obstacles, a preset infinite floating-point value is written to the corresponding position of the tensor. These grid cells are called "free pixels," and their initial value is infinite to indicate that no valid nearest obstacle coordinates have been found. Throughout the construction process, the data of the seed coordinate tensor is forcibly locked in the high-speed on-chip SRAM physical region and does not need to be written back to shared main memory.
[0024] Step S103: The seed coordinate tensor is updated in multiple rounds using a tensor quantization iteration mechanism to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, and a distance field map is generated based on the Euclidean distances of all grids.
[0025] In this embodiment, the maximum iteration step size k = N / 2 is initialized based on the grid map side length N, and a decreasing rule of halving the step size each time is set until the step size is 1. The step size needs to be a power of 2 to adapt to hardware shift instructions. In each iteration, the seed coordinate tensor is... Translate the current step size k in eight directions (up, down, left, right, and four diagonals) to generate eight sets of neighborhood tensors. Translation operations are implemented through hardware shift instructions, eliminating the need for complex index calculations.
[0026] Subsequently, the squared Euclidean distance between each grid cell and the corresponding position of the neighborhood tensor is calculated in parallel, using the following formula:
[0027] The computation process employs tensor parallel processing, performing operations on all grids simultaneously. Then, using the tensor min operator, the seed coordinates corresponding to the minimum distance between the original coordinates and their eight neighbors are retained grid-by-grid, and the seed coordinate tensor is updated. That is, for each grid, the coordinates of the grid itself are compared with the coordinates of the corresponding positions of the eight neighboring tensors, and the coordinates with the smallest distance are selected as the new seed value. During the iteration process, the seed coordinate tensor resides in the on-chip SRAM throughout the process, and the data transfer is directly completed by the internal DMA engine without CPU intervention, realizing zero-copy data transfer.
[0028] When the step size decreases to 1, the iteration ends. At this point, the seed coordinate tensor stores the precise coordinates of the nearest dynamic obstacle corresponding to each grid. Based on this coordinate data, the Euclidean distance between the current grid coordinates and the coordinates of the nearest obstacle is calculated grid by grid.
[0029] Then, arrange the Euclidean distances of all the grids according to their grid positions to generate a distance field map. The value of each grid is the Euclidean distance from that position to the nearest dynamic obstacle.
[0030] It should be noted that the seed tensor is a set of multidimensional data tables whose size corresponds completely to the environmental grid map and is specifically designed for hardware parallel computing. It is mainly used to uniformly store the positions of all obstacles as the starting point of the calculation. It stores spatial coordinates in separate channels. Where there are obstacles, the real geographical location is directly filled in as the calculation seed, and an invalid number is uniformly filled in the blank areas without obstacles. Then it is used as input for batch calculations of hardware such as NPU and GPU, so that the computer does not need to read the data grid by grid in a loop.
[0031] The dual-channel tensor structure used in this application perfectly matches the shift and batch comparison operations built into the NPU. The eight-way neighborhood update can be completed in parallel at once, which is faster than calculating the map grid by grid. Secondly, only one tensor is needed to store obstacle coordinates and blank area markers at the same time, without needing to allocate an additional memory block to store the mask, thus saving NPU cache space. Furthermore, the entire tensor can be kept in high-speed on-chip storage, without frequent read and write to slow external memory, reducing data transmission latency. Finally, this unified tensor format can directly connect to subsequent steps such as window sliding, dynamic and static layer calculation, and semantic correction, avoiding the performance loss caused by CPU serial scheduling.
[0032] Step S104: Obtain the semantic correction matrix that matches the pose data, and use the semantic correction matrix to correct the range field map to obtain the target range field map.
[0033] In this embodiment, based on the semantic ID of the dynamic obstacle and the quantized orientation angle θq, a corresponding two-dimensional correction matrix Mij(θ) is matched from the set of semantic correction matrices pre-stored in the hardware LUT. The index of the LUT is jointly determined by the semantic ID of the obstacle and the quantized orientation angle. The matrix Mij(θ) contains the safety distance correction coefficients under different orientation angles and is stored in the form of an asymmetric two-dimensional Gaussian kernel to characterize the "social distance" correction requirements in different directions around the obstacle. Subsequently, based on the pixel position of the dynamic obstacle in the distance field map, the correction matrix M is pasted into a semantic correction tensor of the same size as the distance field map. The corresponding regions are then processed by matrix filling to generate a semantic correction tensor that fully covers the entire graph. During the filling process, regions not affected by obstacles are assigned a value of 0, while regions affected by obstacles are assigned values according to the matrix coefficients.
[0034] Finally, the base distance field map is generated according to the following formula. With semantic correction tensor Perform element-wise fusion calculations to generate the final target distance field map:
[0035] Where α is a preset fusion weight coefficient used to adjust the intensity of semantic correction. For semantically modified tensors in The numerical value of the location; the fusion process is completed directly in the on-chip SRAM without the need to write data back to the main memory. The generated target distance field map contains both geometric distance information and semantic safe distance information. The value of each grid is the corrected comprehensive distance value.
[0036] In one embodiment of this application, acquiring the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment includes: Step A1: Obtain real-time environmental images of the environment using a camera.
[0037] Specifically, real-time environmental images are acquired through cameras. These images provide raw visual data for subsequent dynamic obstacle detection and pose estimation. The image resolution and frame rate must meet the requirements for obstacle recognition accuracy and real-time performance in order to present the outline, texture, and motion state of dynamic obstacles in the environment.
[0038] Step A2: Acquire radar point cloud data of the environment using lidar.
[0039] The radar point cloud data of the environment is obtained by LiDAR. This data contains the three-dimensional spatial coordinate information of objects in the environment and needs to cover the area where obstacles are located in order to accurately reflect the location, size and distribution of obstacles.
[0040] Step A3 involves extracting the pose data of dynamic obstacles from the real-time environmental image using a first neural network processor, and converting the radar point cloud data into a raster image using a second neural network processor.
[0041] In this embodiment of the application, the method further includes: writing a first synchronization flag bit to the on-chip static memory after the first neural network processor extracts the pose data of the dynamic obstacle; and writing a second synchronization flag bit to the on-chip static memory after the second neural network processor converts the radar point cloud data into a raster image; and triggering the construction of a seed coordinate tensor after determining that both the first synchronization flag bit and the second synchronization flag bit in the on-chip static memory are set.
[0042] As an example, in a robot's indoor dynamic obstacle avoidance scenario, the first neural network processor completes image feature analysis of dynamic obstacles such as pedestrians and mobile devices within the scene. After accurately extracting the pose data of all dynamic obstacles, including their position, orientation, and size, it writes and activates the first synchronization flag in a preset storage unit of the on-chip static memory. Simultaneously, the second neural network processor synchronously analyzes, projects, and rasterizes the LiDAR point cloud data of the current frame, generating a complete environmental raster map marked with obstacle distribution markers. After the preprocessing is completed, the second synchronization flag is immediately activated in the corresponding storage area of the on-chip static memory. The status of the two flags in the on-chip static memory is monitored in real time. Only when both the first and second synchronization flags are detected to be in a valid state, confirming that both the dynamic obstacle pose data and the environmental raster map are complete, valid, and preprocessed, will the initialization and construction process of the seed coordinate tensor be automatically started. This effectively ensures the timing alignment of the two parallel preprocessing tasks and avoids tensor assignment errors and iterative calculation anomalies caused by incomplete data.
[0043] This application embodiment delegates the entire geometric topology calculation process of map generation to a neural network processor, thereby solving the problem of unbalanced computing power distribution in embedded SoCs. After acquiring environmental data through cameras and LiDAR, the neural network processor performs dynamic obstacle pose extraction and point cloud rasterization conversion, respectively. The process is linked by a synchronization flag bit in the on-chip static memory. Subsequently, based on the raster image, grid types are divided, differentiated values are assigned, and a seed coordinate tensor is constructed. Then, a series of geometric topology-related operations, such as tensor translation, parallel distance calculation, coordinate updates, and Euclidean distance calculation, are performed using a tensor iteration mechanism. All the above calculation steps are adapted to the tensor parallel operation characteristics of the neural network processor, fully utilizing its high tensor throughput capability. This eliminates the reliance on CPU for serial processing, avoiding the problem of low efficiency in CPU processing of geometric topology logic. Simultaneously, it revitalizes the previously idle computing power of the neural network processor, allowing for a reasonable allocation of hardware load within the SoC and effectively improving the current situation of unbalanced system computing power distribution.
[0044] In one embodiment of this application, constructing a seed coordinate tensor based on a raster graph includes: Step B1: Using the markers of each grid in the grid diagram, divide the grid into a first grid containing dynamic obstacles and a second grid without dynamic obstacles.
[0045] In this embodiment of the application, the markings of each grid in the grid diagram are used to divide the first grid with dynamic obstacles into a second grid without dynamic obstacles. This division is based on the occupancy markings of each grid in the grid diagram. Grids with occupancy markings indicating the presence of dynamic obstacles are classified as the first grid, and grids without occupancy markings are classified as the second grid, thus clarifying the distribution areas of the two types of grids.
[0046] Step B2: Assign the corresponding real coordinates to the first grid to obtain the first coordinate data, and assign a preset infinite floating-point value to the second grid to obtain the second coordinate data.
[0047] Assign its own real coordinates to the first grid to obtain the first coordinate data, which is the actual physical location of the grid in the environment and serves as the initial seed value; at the same time, assign a preset infinite floating-point value to the second grid to obtain the second coordinate data, which indicates that the grid has not yet found the coordinates of the nearest valid obstacle.
[0048] Step B3: Combine the first coordinate data and the second coordinate data according to the grid position to construct the seed coordinate tensor.
[0049] Based on the one-to-one correspondence of the grids, the coordinate data of the two types of grids are integrated and assembled into a seed coordinate tensor. The tensor has two channels: channel 0 stores the X-axis coordinates of all grids, and channel 1 stores the Y-axis coordinates. The two types of initial values previously set for obstacle grids and blank grids are completely retained as the raw data for subsequent JFA tensor iterative calculations. For example, the pedestrian position in the tensor stores 3.2 in channel 0 and 1.8 in channel 1. The two channels of the remaining blank grids store the invalid seed placeholder threshold, thus forming the complete seed coordinate tensor.
[0050] In one embodiment of this application, a tensor quantization iterative mechanism is used to perform multiple rounds of neighborhood updates on the seed coordinate tensor to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, including: Step C1: Initialize the maximum iteration step size based on the side length of the raster image, and set a decreasing rule that halves the step size each time.
[0051] The iteration parameters are initialized based on the overall side length of the raster map. The maximum iteration step size is set based on the complete spatial scale of the raster map, and is set to half the side length of the raster map. This maximum step size adapts to the global search range of the entire raster area, covering the distribution range of all dynamic obstacles in the environment, and ensuring that the initial iteration can complete a coarse-grained scan of the entire domain. A step size reduction mechanism is simultaneously constructed, establishing a gradient update rule that automatically halves the step size after each iteration, forming an iterative logic that gradually transitions from large-scale coarse traversal to small-scale fine calibration.
[0052] This decreasing rule, based on powers of two, is adapted to tensor translation operations and parallel computing logic, avoids coordinate offsets and calculation errors caused by non-integer step sizes, and balances global search efficiency and calculation accuracy through multi-level gradient iteration.
[0053] Step C2: In each iteration, the seed coordinate tensor is translated along multiple directions by the current step size to obtain multiple sets of neighborhood tensors, where each set of neighborhood tensors corresponds to a direction.
[0054] Within each iteration cycle, multi-directional translation sampling of the seed coordinate tensor is completed based on the currently effective iteration step size. The translation direction covers the eight-neighbor full-dimensional space in the up, down, left, right, and four diagonal directions, and comprehensively covers all neighborhood spatial positions within the grid map, with no blind spots in angle and orientation sampling.
[0055] Using the current iteration step size as a fixed translation offset, perform global translation operations in eight directions on the original seed coordinate tensor. Each translation operation in a single direction can generate a set of independent neighborhood tensors with dimensions and sizes completely identical to the original tensor. Each set of neighborhood tensors corresponds to neighborhood coordinate information in different directions.
[0056] Multiple sets of neighborhood tensors completely retain all seed coordinate data of each grid around the current step size, realizing the collection of global neighborhood information in a single iteration and breaking through the limitations of single-direction sampling.
[0057] Step C3: Calculate the squared Euclidean distance between each grid and the corresponding position of the neighborhood tensor in parallel. Retain the seed coordinates corresponding to the minimum distance for each grid and update the seed coordinate tensor to obtain the seed coordinate tensor after this iteration.
[0058] Based on the generated multiple sets of neighborhood tensors, parallel distance calculations and tensor optimization updates are performed across the entire grid. A unified Euclidean distance squared formula is used for numerical solutions, omitting square root operations. This reduces the overall computational load and improves iterative efficiency while maintaining distance comparison accuracy. For all grid positions within the raster image, the squared Euclidean distance between the original seed coordinates and the corresponding coordinates in each set of neighborhood tensors is calculated simultaneously, enabling batch distance comparison calculations across the entire grid.
[0059] Based on the results of all squared distance calculations, the seed coordinate corresponding to the minimum value is independently selected for each grid. This coordinate is the coordinate of the nearest dynamic obstacle at the current iteration step. The selected optimal seed coordinate replaces the corresponding value of the original seed coordinate tensor grid by grid, completing the tensor update optimization for a single iteration. This outputs a new seed coordinate tensor with more accurate parameters and higher distance convergence, achieving fine-grained correction of global obstacle coordinate information in each iteration.
[0060] Step C4: Repeat the neighborhood update operation according to the step size decreasing rule until the step size is 1. Calculate the Euclidean distance from each grid to the nearest dynamic obstacle based on the finally obtained seed coordinate tensor.
[0061] Specifically, the Euclidean distance from each grid to the nearest dynamic obstacle is calculated based on the final obtained seed coordinate tensor. This includes: obtaining the seed coordinate tensor after iteration and extracting the coordinate data of the nearest dynamic obstacle stored in each grid; obtaining the true coordinates of each grid based on the grid index; calculating the Euclidean distance between the true coordinates and the coordinates of the nearest dynamic obstacle for each grid; and arranging the Euclidean distances calculated for all grids according to the grid position to obtain the Euclidean distance from each grid to the nearest dynamic obstacle.
[0062] It should be noted that after the iterative process has fully converged, the seed coordinate tensor that has completed multiple rounds of neighborhood updates is read. This tensor has undergone multi-level step-size decreasing iterative optimization, and its internal values have achieved global convergence, discarding the infinite floating-point values in the initial state. Each grid position within the tensor accurately stores the true coordinate information of the nearest dynamic obstacle retrieved at the current grid position. The coordinate data of the nearest dynamic obstacle corresponding to all grids in the tensor is completely extracted, ensuring that the extracted coordinate data covers the entire grid area with no missing data or positional deviation.
[0063] Based on the inherent grid indexing rules of the raster map, and matching the row and column layout and spatial resolution of the raster map, the true physical coordinates of each grid in the environmental coordinate system are obtained one by one. The true coordinates of all grids follow the raster spatial topology, ensuring a one-to-one correspondence between spatial positions and uniform scale. Taking a single grid as the smallest computational unit, a coordinate mapping relationship is established between the grid's own true coordinates and the coordinates of the nearest dynamic obstacle. According to the standard Euclidean distance calculation formula, distance calculations are performed point by point on all grids in the entire domain to solve for the straight-line spatial distance between each grid position and the corresponding nearest dynamic obstacle.
[0064] The Euclidean distance values calculated for each grid cell across the entire region are then sorted and integrated according to the original grid index order and spatial arrangement of the raster map, maintaining a one-to-one correspondence between distance data and grid spatial positions, as well as topological consistency. The neatly arranged distance data completely covers the entire raster map area, with each grid position corresponding to a unique and accurate Euclidean distance value. This forms a globally continuous, regularly distributed, and dimensionally regular grid distance dataset, providing a complete output of the Euclidean distances from all grid cells to the nearest dynamic obstacle.
[0065] As an example, taking a grid side length of N=256, this quantization iteration process adopts a multi-round update mechanism with a halved step size: In the first iteration, the step size is k=128 (i.e., N / 2). Tensor Shift(128,128) is used to query the seed coordinates outside 128 pixels, and then the distance comparison and tensor update are completed by combining the Min operator; In the second iteration, the step size is halved to 64, and Tensor Shift(64,64)+Min operation is executed to shrink the neighborhood search range to 64 pixels; Subsequent rounds continue to halve the step size until the step size k=1 in the log2Nth round (i.e., the 8th round). The neighborhood comparison within the last 1 pixel is completed by Tensor Shift(1,1) and Min Pooling. With only log2N iterations, the convergence of the shortest obstacle coordinates in the whole domain is achieved from coarse to fine. At the same time, it is fully compatible with NPU hardware shift instructions and parallel computing units, and the distance field calculation can be completed efficiently without relying on complex loop logic.
[0066] In one embodiment of this application, a target range field map is obtained by correcting the range field map using a semantic correction matrix, including: Step D1: Obtain a blank semantic correction tensor with the same size as the distance field map, and paste the semantic correction matrix into the corresponding area of the semantic correction tensor according to the pixel position of the dynamic obstacle.
[0067] A blank semantic correction tensor is constructed that is completely identical to the generated distance field map in size, resolution, and spatial dimensions, ensuring that the tensor's row and column dimensions and pixel indices are aligned with the distance field map. Based on the pixel coordinates and actual occupied area of the dynamic obstacle in the distance field map, the range of influence and center position of the obstacle in the entire tensor are located. Combined with the semantic correction matrix obtained by matching the dynamic obstacle pose data, the matrix is accurately fitted and mapped.
[0068] The semantic correction matrix has its own gradient semantic weight coefficients, which can characterize the differentiated safety constraint features of obstacles in different directions. The pasting process follows the spatial correspondence, and the matrix is completely pasted to the obstacle corresponding area of the semantic correction tensor, realizing the binding of semantic correction parameters with the actual spatial position of the obstacle. The parameter is assigned only in the area of effective influence of the obstacle, while the other areas remain in the initial blank state, thus completing the initial assignment and construction of the semantic correction tensor.
[0069] The semantic correction matrix contains gradient-varying weight coefficients to simulate the varying safety constraints around obstacles. The closer an obstacle is to it and the more directly facing it, the stricter the safety restrictions and the higher the weight. Weights gradually decrease for areas to the side and further away. When pasting the matrix, this gradient weight matrix is applied to the dynamic obstacle's occupied area and influence range in the tensor according to spatial location. Differentiated semantic weight parameters are only written within the effective area of the obstacle to distinguish the obstacle avoidance safety level from different directions. Blank areas on the map without obstacles remain unassigned and in their original state, thus completing the initialization of the entire semantic correction tensor.
[0070] For example, for dynamic obstacles to pedestrians on the road, the corresponding semantic correction matrix will show a gradient effect with the highest weight at the center and decreasing layer by layer towards the surroundings. The weight of the pedestrian's forward direction will be significantly greater than that of the side and rear, which is consistent with the actual characteristic that pedestrians have a higher risk of frontal collision. The system can attach this gradient matrix to the pedestrian area of the tensor so that the map can reflect the differentiated safety constraints of obstacles in each direction.
[0071] Step D2 involves filling the pasted semantic correction tensor to obtain a semantic correction tensor that fully covers the entire image.
[0072] For semantic correction tensors with local blank areas after the semantic correction matrix is applied, a global filling optimization process is performed to eliminate tensor data gaps and numerical discontinuities, achieving full coverage assignment of the entire tensor. For blank grid areas without the semantic correction matrix applied and without the semantic influence of obstacles, zero values are uniformly filled as basic weights, representing that the area is not constrained by the semantic rules of dynamic obstacles; for obstacle-surrounding areas with the semantic correction matrix applied, the original gradient weight coefficients are retained to maintain the semantic constraint differentiation characteristics of near and far obstacle areas.
[0073] The filling process follows the principle of grid space continuity, smoothly transitions the numerical differences between the core area of the obstacle and the blank area, avoids the problem of local numerical mutation, and finally forms a complete semantic correction tensor with continuous numerical values, regular gradients, and no gaps in the whole domain, so that each grid is equipped with corresponding semantic correction weight parameters.
[0074] Step D3 involves performing element-wise fusion calculations between the distance field map and the semantic correction tensor to generate corrected distance field data. The corrected distance field data is then arranged according to the grid positions to obtain the target distance field map.
[0075] Based on the constructed global semantic correction tensor and the original distance field map, pixel-by-pixel and grid-by-grid element fusion calculations are performed to achieve deep coupling between geometric distance and semantic weight data. The fusion calculation adopts a fixed weighted operation logic, using the Euclidean distance values of the original distance field map as a basis, and dynamically correcting them by combining the weight coefficients of the semantic correction tensor. This compensates for the deficiency of pure geometric distance calculation in not considering the semantic attributes of obstacles, and generates corrected distance field data that combines physical distance accuracy with scene semantic rationality.
[0076] All fusion operations are performed using tensor parallel logic, ensuring the uniformity and efficiency of global grid data correction and avoiding local data deviations. The corrected distance field data is then organized and integrated according to the row and column spatial positions and grid layout rules of the original raster image, unifying the data arrangement order and spatial dimensions. This ultimately generates a complete and accurate target distance field map, which can accurately adapt to the semantic safety constraints of dynamic obstacles, effectively improving scene adaptability and practicality.
[0077] This application adopts a fully integrated processing mode within the neural network processor, eliminating the latency and bandwidth bottlenecks caused by cross-core data transfer. After dynamic obstacle semantics, pose information, and grid map data are generated within the neural network processor, they are stored entirely in on-chip static memory, without needing to be transferred through DDR main memory. After the distance field map is generated, semantic correction matrix matching, semantic correction tensor construction, and global filling are performed directly within the neural network processor. Then, semantic correction of the distance field map is achieved through element-by-element fusion calculation, without transferring data to the CPU for weight adjustment. This eliminates the traditional data transfer pattern of NPU, DDR, and CPU, saving multiple cross-core and cross-storage region data transfer operations, fundamentally avoiding communication latency caused by data transfer, alleviating memory bandwidth pressure, and improving the generation and updating efficiency of semantic obstacle avoidance related map data.
[0078] In one embodiment of this application, in order to avoid repeated calculations of the static environment during robot movement and to achieve dynamic-static decoupling, a mechanism based on NPU scrolling window translation and dynamic-static layering fusion is further adopted.
[0079] Specifically, when the robot moves normally, the odometry calculates its distance and direction of movement in real time. Instead of deleting the previously built static distance field map, the NPU translates the entire map in the opposite direction of the robot's movement, simulating the visual effect of the robot moving forward. After the translation, a new field of view will appear at the edge of the map. The system treats this area as an uncertain blank area by default. Only newly detected obstacles in this new area will be recorded as new calculation starting points. The old areas where the robot's field of view overlaps will directly use the previously calculated distances without recalculation.
[0080] To further reduce unnecessary computations, the NPU's bitwise AND operator automatically identifies areas in the map that have actually changed, generating a change mask layer. During subsequent distance iterations, only the changed areas marked by the mask are updated; static areas that remain unchanged are directly locked by hardware, preventing data rewriting and redundant calculations. This avoids a large amount of unnecessary redundant computations and, through NPU hardware acceleration, improves the speed of map updates.
[0081] The process of generating the change mask layer includes: generating two binary state masks, one before the tensor translation and one after. In the mask, a value of 1 represents a region with valid distance data and belonging to the historical preservation area, while a value of 0 represents a blank, unknown new observation edge region. The two masks are input into the NPU's bitwise AND operator for pixel-by-pixel computation. Only in overlapping areas where both the mask values before and after translation are 1 will the bitwise AND result be 1, indicating that the map information in that area has not changed. If any mask pixel value is 0, the computation result is 0, corresponding to data changes such as new field-of-view edges or newly added obstacles. The final output is the entire change area mask layer. In the subsequent JFA distance iteration stage, the NPU uses this mask for hardware read / write permission control. Change areas with a mask value of 0 allow distance updates and the writing of new calculation results, while static areas with a mask value of 1 are directly shielded from write operations by hardware, eliminating repetitive calculations such as neighborhood traversal and distance comparison. Iterative updates are only performed on a small number of change areas, reducing redundant computation.
[0082] Subsequently, to separate the calculations for the static environment and dynamic obstacles, the map data for dynamic obstacles is processed separately. After detecting dynamic obstacles such as pedestrians and mobile devices in each frame, the robot defines a local area containing these obstacles as a dynamic region of interest (ROI). Distance iteration calculations are then performed only within this small area, generating a distance field layer that only reflects the dynamic obstacles. This process is completely independent of the static map. When a dynamic object moves or disappears, only this dynamic map layer needs to be locally refreshed; the stable static map remains unchanged, truly achieving decoupling between static and dynamic data.
[0083] Based on the bounding boxes of all dynamic obstacles obtained through target detection and image segmentation in the current frame, a small amount of safe expansion is made to the outer rectangle of each obstacle to avoid missing obstacle edges and causing insufficient calculation range. All expanded rectangular regions are merged to obtain a continuous local grid region without overlap. This merged region is the dynamic region of interest. This region only covers all current dynamic obstacles and a very small area of grid around them, eliminating large unchanging areas where the static environment is located, and limiting the calculation boundary of the dynamic distance field.
[0084] The generation process of the distance field layer includes: initializing a seed coordinate tensor separately within the dynamic region of interest (ROI); setting only all dynamic obstacle grids detected in the current frame as seed points and filling them with the actual physical positions of the obstacles; filling all other grids within the ROI with invalid floating-point values; and directly masking all grids outside the ROI and excluding them from this calculation. A complete round of JFA eight-neighborhood tensor quantization iteration is performed on this local tensor, with multiple rounds of neighborhood coordinate propagation following a preset step-size decreasing rule. The Euclidean distance from each grid to the nearest dynamic obstacle is calculated grid by grid. After the iteration, a dynamic EDF distance field layer is generated based on the distance values of all local grids. This layer only represents the safety distance constraints imposed by dynamic obstacles and does not call static map data throughout the process. When pedestrians or mobile devices change position or disappear from the field of view, it is only necessary to iterate and refresh this dynamic layer within the new ROI. The underlying static distance field data is retained without modification, thus decoupling the calculation of the static environment and dynamic obstacles.
[0085] Finally, the entire map synthesis is completed by the NPU hardware, without CPU intervention. The system calls the NPU's minimum value operator to compare the static map distance with the dynamic map distance for each grid location, directly taking the minimum value, which is the true distance of that location to the nearest obstacle. Through this direct hardware-level fusion method, the final complete distance field map is synthesized in one go, saving the time spent on CPU data transfer and ensuring efficient reuse of static maps and timely updates of dynamic obstacles.
[0086] Figure 3 This embodiment provides a schematic diagram of the framework of a map generation system, such as... Figure 3 As shown, This architecture is a heterogeneous pipeline semantic enhancement distance field generation system based on the NPU subsystem. It is initiated by the CPU-side task descriptor and relies on on-chip SRAM to achieve zero-copy data transfer. NPU core 0 performs dynamic obstacle posture and orientation recognition, while NPU core 1 simultaneously completes the rasterization processing of LiDAR data. After both are completed, the completion flag bit in the on-chip SRAM triggers NPU core 2 to start the JFA main loop iteration and semantic fusion process. At the same time, it calls the semantic correction matrix library in the hardware LUT to obtain correction parameters. The final semantically enhanced EDF map is directly stored in the on-chip SRAM for the local planner of the mobile robot to read and use.
[0087] The system adopts a heterogeneous pipeline scheduling model. The CPU is only responsible for constructing and issuing task descriptors, specifically including configuring the task types of each NPU core, the physical address pointers to the input data, the LUT base address, and the step size and number of iterations. Key interaction details include two aspects: First, there is the memory-resident strategy. All intermediate feature maps (including Tcoord, neighborhood tensor, and semantic correction tensor) are forcibly locked in the high-speed on-chip SRAM physical area of the NPU throughout their entire lifecycle. The CPU informs the NPU of the SRAM address through memory-mapped I / O. Data transfer is directly completed by the DMA engine inside the NPU. There is no need to write the data back to the SoC's shared DDR main memory, achieving "zero copy" of the computing pipeline.
[0088] Secondly, there is an inter-core synchronization mechanism. After NPU core 0 and core 1 complete their respective preprocessing tasks, they write a completion number to the agreed synchronization flag in the on-chip SRAM. The controller built into NPU core 2 automatically triggers the JFA iteration process and subsequent semantic fusion process by polling the flag, without CPU intervention, thus achieving efficient pipeline synchronization at the hardware level.
[0089] This embodiment also provides a map generation apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0090] This embodiment provides a map generation device, such as... Figure 4 As shown, it includes: The acquisition module 301 is used to acquire the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment. The grid map includes multiple grids, each grid carries a corresponding label, and the label is used to indicate whether there are dynamic obstacles in the corresponding grid. The construction module 302 is used to construct a seed coordinate tensor based on the raster map. In the seed coordinate tensor, the real coordinates of the grid with dynamic obstacles are used as the tensor value, and the preset infinite floating-point value is used as the tensor value for the grid without dynamic obstacles. The update module 303 is used to perform multiple rounds of neighborhood updates on the seed coordinate tensor using a tensor quantization iteration mechanism to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, and generate a distance field map based on the Euclidean distances corresponding to all grids. The processing module 304 is used to obtain the semantic correction matrix that matches the pose data, and to use the semantic correction matrix to correct the range field map to obtain the target range field map.
[0091] In this embodiment of the application, the acquisition module 301 is used to acquire real-time environmental images of the environment through a camera; acquire radar point cloud data of the environment through a lidar; extract pose data of dynamic obstacles from the real-time environmental images through a first neural network processor; and convert the radar point cloud data into a raster image through a second neural network processor.
[0092] In this embodiment of the application, the device further includes: a trigger module, configured to write a first synchronization flag bit to the on-chip static memory after the first neural network processor extracts the pose data of the dynamic obstacle, and to write a second synchronization flag bit to the on-chip static memory after the second neural network processor converts the radar point cloud data into a raster image; and to trigger the construction of a seed coordinate tensor after determining that both the first synchronization flag bit and the second synchronization flag bit in the on-chip static memory are set.
[0093] In this embodiment of the application, the construction module 302 is used to divide the first grid with dynamic obstacles and the second grid without dynamic obstacles by using the markings of each grid in the grid diagram; to assign the first grid its own corresponding real coordinates to obtain the first coordinate data, and to assign the second grid a preset infinite floating-point value to obtain the second coordinate data; and to combine the first coordinate data and the second coordinate data according to the grid position to construct the seed coordinate tensor.
[0094] In this embodiment, the update module 303 is used to initialize the maximum iteration step size according to the side length of the grid map and set a decreasing rule that halves the step size each time. In each iteration, the seed coordinate tensor is translated along multiple directions by the current step size to obtain multiple sets of neighborhood tensors, where each set of neighborhood tensors corresponds to a direction. The square of the Euclidean distance between each grid and the corresponding position of the neighborhood tensor is calculated in parallel. The seed coordinate corresponding to the minimum distance is retained for each grid, and the seed coordinate tensor is updated to obtain the seed coordinate tensor after this iteration. The neighborhood update operation is repeated according to the step size decreasing rule until the step size is 1. The Euclidean distance from each grid to the nearest dynamic obstacle is calculated based on the finally obtained seed coordinate tensor.
[0095] In this embodiment, the update module 303 is used to obtain the seed coordinate tensor after the iteration is completed, extract the coordinate data of the nearest dynamic obstacle stored in each grid; obtain the real coordinates corresponding to each grid based on the grid index of the raster; calculate the Euclidean distance between the real coordinates and the coordinates of the nearest dynamic obstacle for each grid; arrange the Euclidean distances calculated for all grids according to the grid position to obtain the Euclidean distance from each grid to the nearest dynamic obstacle.
[0096] In this embodiment, the processing module 304 is used to obtain a blank semantic correction tensor with the same size as the distance field map, and paste the semantic correction matrix into the corresponding area of the semantic correction tensor according to the pixel position of the dynamic obstacle; fill the pasted semantic correction tensor to obtain a semantic correction tensor that completely covers the entire map; perform element-wise fusion calculation between the distance field map and the semantic correction tensor to generate corrected distance field data, and arrange the corrected distance field data according to the grid position to obtain the target distance field map.
[0097] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system).
[0098] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0099] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0100] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0101] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0102] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0103] This invention also provides a computer program product. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0104] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A map generation method, characterized in that, The method includes: Acquire the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment, wherein the grid map includes multiple grids, each grid carrying a corresponding label, the label being used to indicate whether the corresponding grid contains dynamic obstacles; A seed coordinate tensor is constructed based on the grid diagram. In the seed coordinate tensor, the actual coordinates of the grid with dynamic obstacles are used as the tensor value, and the preset infinite floating-point value is used as the tensor value for the grid without dynamic obstacles. The seed coordinate tensor is updated in multiple rounds using a tensor quantization iterative mechanism to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, and a distance field map is generated based on the Euclidean distances of all grids. Obtain the semantic correction matrix that matches the pose data, and use the semantic correction matrix to correct the range field map to obtain the target range field map.
2. The method according to claim 1, characterized in that, The acquisition of pose data of dynamic obstacles in the environment and the corresponding grid map of the environment includes: Real-time environmental images of the environment are acquired through a camera; The radar point cloud data of the environment is acquired using lidar; The first neural network processor extracts the pose data of dynamic obstacles from the real-time environmental image, and the second neural network processor converts the radar point cloud data into a raster image.
3. The method according to claim 2, characterized in that, The method further includes: After the first neural network processor extracts the pose data of the dynamic obstacle, it writes the first synchronization flag bit to the on-chip static memory; and after the second neural network processor converts the radar point cloud data into a raster image, it writes the second synchronization flag bit to the on-chip static memory. After confirming that both the first synchronization flag and the second synchronization flag in the on-chip static memory are set, the construction of the seed coordinate tensor is triggered.
4. The method according to claim 1, characterized in that, The construction of the seed coordinate tensor based on the raster image includes: Using the markers on each grid in the grid diagram, a first grid containing dynamic obstacles and a second grid without dynamic obstacles are divided; Assign its own corresponding real coordinates to the first grid to obtain the first coordinate data, and assign a preset infinite floating-point value to the second grid to obtain the second coordinate data; The first coordinate data and the second coordinate data are combined according to the grid position to construct the seed coordinate tensor.
5. The method according to claim 1, characterized in that, The process of using a tensor quantization iterative mechanism to perform multiple rounds of neighborhood updates on the seed coordinate tensor to obtain the Euclidean distance from each grid to the nearest dynamic obstacle includes: The maximum iteration step size is initialized based on the side length of the grid image, and a decreasing rule is set to halve the step size each time. In each iteration, the seed coordinate tensor is translated along multiple directions by the current step size to obtain multiple sets of neighborhood tensors, where each set of neighborhood tensors corresponds to a direction; The squared Euclidean distance between each grid and the corresponding position of the neighborhood tensor is calculated in parallel. The seed coordinates corresponding to the minimum distance are retained for each grid, and the seed coordinate tensor is updated to obtain the seed coordinate tensor after this iteration. The neighborhood update operation is repeated according to the step size decreasing rule until the step size is 1. The Euclidean distance from each grid to the nearest dynamic obstacle is calculated based on the finally obtained seed coordinate tensor.
6. The method according to claim 4, characterized in that, The calculation of the Euclidean distance from each grid to the nearest dynamic obstacle based on the finally obtained seed coordinate tensor includes: Obtain the seed coordinate tensor after the iteration is completed, and extract the most recent dynamic obstacle coordinate data stored in each grid from it; Based on the grid index of the raster image, obtain the actual coordinates corresponding to each grid. For each grid cell, calculate the Euclidean distance between its true coordinates and the coordinates of the nearest dynamic obstacle; Arrange the Euclidean distances calculated from all grids according to their grid positions to obtain the Euclidean distance from each grid to the nearest dynamic obstacle.
7. The method according to claim 1, characterized in that, The step of correcting the distance field map using the semantic correction matrix to obtain the target distance field map includes: Obtain a blank semantic correction tensor with the same size as the distance field map, and paste the semantic correction matrix into the corresponding area of the semantic correction tensor according to the pixel position of the dynamic obstacle; The semantic correction tensor after pasting is filled to obtain a semantic correction tensor that completely covers the entire image; The distance field map and the semantic correction tensor are fused element-wise to generate corrected distance field data, and the corrected distance field data is arranged according to the grid position to obtain the target distance field map.
8. A map generation device, characterized in that, The device includes: The acquisition module is used to acquire the pose data of dynamic obstacles in the environment and the corresponding grid map of the environment. The grid map includes multiple grids, each grid carrying a corresponding marker, which is used to indicate whether there are dynamic obstacles in the corresponding grid. The construction module is used to construct a seed coordinate tensor based on the grid map. In the seed coordinate tensor, for grids with dynamic obstacles, the tensor value is the grid's own real coordinates, and for grids without dynamic obstacles, the tensor value is a preset infinite floating-point value. The update module is used to perform multiple rounds of neighborhood updates on the seed coordinate tensor using a tensor quantization iteration mechanism to obtain the Euclidean distance from each grid to the nearest dynamic obstacle, and generate a distance field map based on the Euclidean distances corresponding to all grids. The processing module is used to obtain the semantic correction matrix that matches the pose data, and to use the semantic correction matrix to correct the distance field map to obtain the target distance field map.
9. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product stores computer instructions that are used to cause the computer to perform the method of any one of claims 1 to 7.