Method and device for compressing three-dimensional occupied map
By compressing the 3D occupancy map into a 2D raster, the problem of wasted computational resources in path planning of the 3D occupancy map is solved, realizing fast path planning and efficient navigation, which is suitable for a wide range of environments.
Patent Information
- Application Number
- CN202411006082.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-19
AI Technical Summary
Existing 3D occupancy maps waste significant computational resources during path planning, and point cloud maps have low storage and search efficiency in large-scale environments, making them difficult to use for robot navigation.
The 3D occupancy map is compressed into a 2D raster. Through mapping and dilation, the point cloud in the 3D occupancy map that conforms to the robot's height range is mapped to the planar raster map. Dilation is then performed based on the robot's size to mark and update the raster state.
It achieves rapid path planning, saves computing resources, and improves map search efficiency and robot navigation accuracy, making it suitable for a wide range of environments.
Smart Images

Figure CN118980367A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic maps, and in particular to a method and device for compressing a three-dimensional occupancy map. Background Art
[0002] Currently commonly used depth sensors such as 3D lidar, RGB-D cameras, and binocular stereo cameras can detect the depth information of the surrounding environment and collect environmental point cloud data. However, considering the storage capacity of the embedded platform, if the collected depth information is directly converted into point cloud data for point cloud map construction, there will be the following problems. First, the point cloud map does not have an efficient data structure, and its data search speed is very slow. Secondly, since the point cloud map stores spatial point coordinates and colors, it is not easy for robots to distinguish obstacles and free areas from it, so it is difficult to use for robot navigation. Finally, point cloud data will cause huge memory consumption, resulting in it only being used in small-scale three-dimensional environments and not suitable for large-scale environments.
[0003] Another commonly used three-dimensional map representation method is the three-dimensional occupancy map, which can better overcome the shortcomings of the point cloud map. Similar to the two-dimensional grid map, the three-dimensional occupancy map uses three states: idle, occupied, and unknown to represent the occupancy of each point. Among them, OctoMap, as a three-dimensional occupancy map representation method based on octree, has a strong spatial decomposition capability. The root node of the octree represents the entire real three-dimensional space, and the eight child nodes under the root node correspond to the eight subspaces divided under the space. Layer by layer, until the leaf node of the octree (the smallest basic unit in this space). The smallest basic unit can be determined by the Octomap resolution set this time. The size of the resolution will directly affect the memory occupation scale of Octomap. In actual application, it is often determined based on engineering factors such as the maximum mapping error that the robot can tolerate and the mapping memory limit. At the same time, the voxel occupancy probability model established by Octomap can cooperate well with the SLAM system to observe the spatial point in multiple frames, jointly represent the occupancy state of the point, and improve the accuracy of the map. Because Octomap adopts a tree structure, combined with pruning operations, it can greatly reduce the map's demand for memory, which is convenient for embedded system implementation. For working environments that are mostly flat roads or up and down slopes with a certain slope, there is no need to perform operations such as up and down vertical movement, so directly using the three-dimensional occupancy map mentioned above for path planning is a waste of computing resources. Summary of the invention
[0004] In order to solve the above technical problems, the present invention proposes a method and device for compressing a three-dimensional occupancy map, so as to solve the technical problem that the existing direct use of a three-dimensional occupancy map for path planning wastes computing resources.
[0005] The present invention proposes a method for compressing a three-dimensional occupancy map, the method comprising:
[0006] Step S1: Acquire a constructed three-dimensional occupancy map and a plane grid map corresponding to the three-dimensional occupancy map; the three-dimensional occupancy map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, the positive left direction as the y-axis, and the upward direction as the z-axis; the plane grid map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, and the positive left direction as the y-axis; the x-axis and y-axis of the three-dimensional occupancy map are respectively mapped with the x-axis and y-axis of the plane grid map, and the area corresponding to the mapped plane grid map is obtained on the three-dimensional occupancy map, the upper limit of the height that the robot can pass is determined based on the height of the robot and the visual device configured by the robot, and the point cloud with a height between 0 and the upper limit of the height in the three-dimensional occupancy map is mapped to the plane grid map according to the set resolution, and the grids with mapped points in the plane grid map are recorded as occupied points, and the grids corresponding to the occupied points are occupied;
[0007] Step S2: the robot moves along a preset route in the mapped plane grid map to detect each grid of the mapped plane grid map, the robot moving in a horizontal or vertical direction, wherein each step length of the robot moving corresponds to a grid; each time the robot moves a step length, the grid where the robot is currently located is used as the current grid;
[0008] The grid is detected in the following manner: based on the current grid, determining whether there is a new occupied point in the mapped plane grid map, and if so, marking the new occupied point in the mapped plane grid map;
[0009] Step S3: Obtain the size of the robot, and perform expansion processing on all occupied points based on the maximum radius of the robot; in the mapped plane grid map, obtain grids that are not marked as occupied points and have overlapping parts with the grid after the expansion processing of occupied points, and mark them as occupied points.
[0010] Preferably, in step S1, the visual device is a lidar scanning device, and the state of each grid in the mapped plane grid map is one of occupied, idle, and unknown. The state of the grid corresponding to the occupied point is occupied, the state of the grid in the straight line direction between the robot and the occupied point is idle, and the state of the grid outside the straight line direction between the robot and the occupied point and corresponding to the area not detected by the visual device is unknown.
[0011] Preferably, the set resolution corresponds to the size of the grid of the planar grid map.
[0012] Preferably, the step S2: determining whether there is a new occupied point in the mapped plane grid map based on the current grid, comprises:
[0013] The grid adjacent to the current grid in the direction of the robot's movement is used as the grid to be predicted; the state S of the grid to be predicted in the mapped map is obtained. - , determine the actual state of the grid to be predicted, the actual state S + for:
[0014]
[0015] Wherein, z is the observation value of the visual device, and the observation value is 0 or 1, s is the grid state, s=1 indicates that the grid state is idle, s=0 indicates that the grid state is occupied, p(z|s=1) indicates the probability that the observation value of the visual device is 1 in the grid idle state, and p(z|s=0) indicates the probability that the observation value of the visual device is 0 in the grid occupied state;
[0016] If the actual state of the grid to be predicted is occupied, setting the states of the grid to be predicted and all grids behind the grid to be predicted in the mapped map in the traveling direction to occupied; updating the mapped map;
[0017] If the actual state of the grid to be predicted is idle, the mapped map is not updated.
[0018] The present invention provides a device for compressing a three-dimensional occupancy map, the device comprising:
[0019] A mapping module: configured to obtain a constructed three-dimensional occupancy map and a plane grid map corresponding to the three-dimensional occupancy map; the three-dimensional occupancy map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, the positive left direction as the y-axis, and the upward direction as the z-axis; the plane grid map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, and the positive left direction as the y-axis; the x-axis and y-axis of the three-dimensional occupancy map are respectively mapped with the x-axis and y-axis of the plane grid map, and the area corresponding to the mapped plane grid map is obtained on the three-dimensional occupancy map, the upper limit of the height that the robot can pass is determined based on the height of the robot and the visual device configured by the robot, and the point cloud with a height between 0 and the upper limit of the height in the three-dimensional occupancy map is mapped to the plane grid map according to the set resolution, and the grids with mapped points in the plane grid map are recorded as occupied points, and the grids corresponding to the occupied points are occupied;
[0020] Detection module: configured so that the robot moves along a preset route in the mapped plane grid map to detect each grid of the mapped plane grid map, the robot moving in a horizontal or vertical direction, wherein each step length of the robot moving corresponds to a grid; each time the robot moves a step length, the grid where the robot is currently located is used as the current grid;
[0021] The grid is detected in the following manner: based on the current grid, determining whether there is a new occupied point in the mapped plane grid map, and if so, marking the new occupied point in the mapped plane grid map;
[0022] Expansion module: configured to obtain the size of the robot and perform expansion processing on all occupied points based on the maximum radius of the robot; in the mapped plane grid map, obtain grids that are not marked as occupied points and have overlapping parts with the grid after the expansion processing of the occupied points, and mark them as occupied points.
[0023] The present invention provides an electronic device, comprising:
[0024] at least one processor; and
[0025] a memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0027] The present invention provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method as described above.
[0028] The present invention has the following beneficial technical effects:
[0029] The present invention performs fast two-dimensional raster compression on the three-dimensional occupancy map, and satisfies the requirement of saving resources while performing accurate path planning.
[0030] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0032] Figure 1 A schematic flow chart of a method for compressing a three-dimensional occupancy map proposed by the present invention;
[0033] Figure 2 This is a schematic diagram of the structure of the device for compressing a three-dimensional occupancy map proposed by the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0035] Figure 1 FIG. 1 is a flow chart showing a method for compressing a three-dimensional occupancy map. Figure 1 As shown, the method includes:
[0036] Step S1: Acquire a constructed three-dimensional occupancy map and a plane grid map corresponding to the three-dimensional occupancy map; the three-dimensional occupancy map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, the positive left direction as the y-axis, and the upward direction as the z-axis; the plane grid map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, and the positive left direction as the y-axis; the x-axis and y-axis of the three-dimensional occupancy map are respectively mapped with the x-axis and y-axis of the plane grid map, and the area corresponding to the mapped plane grid map is obtained on the three-dimensional occupancy map, the upper limit of the height that the robot can pass is determined based on the height of the robot and the visual device configured by the robot, and the point cloud with a height between 0 and the upper limit of the height in the three-dimensional occupancy map is mapped to the plane grid map according to the set resolution, and the grids with mapped points in the plane grid map are recorded as occupied points, and the grids corresponding to the occupied points are occupied;
[0037] Step S2: the robot moves along a preset route in the mapped plane grid map to detect each grid of the mapped plane grid map, the robot moving in a horizontal or vertical direction, wherein each step length of the robot moving corresponds to a grid; each time the robot moves a step length, the grid where the robot is currently located is used as the current grid;
[0038] The grid is detected in the following manner: based on the current grid, determining whether there is a new occupied point in the mapped plane grid map, and if so, marking the new occupied point in the mapped plane grid map;
[0039] Step S3: Obtain the size of the robot, and perform expansion processing on all occupied points based on the maximum radius of the robot; in the mapped plane grid map, obtain grids that are not marked as occupied points and have overlapping parts with the grid after the expansion processing of occupied points, and mark them as occupied points.
[0040] Further, in step S1, the visual device is a lidar scanning device, and the state of each grid in the mapped plane grid map is one of occupied, idle, and unknown. The state of the grid corresponding to the occupied point is occupied, the state of the grid within the straight line direction between the robot and the occupied point is idle, and the state of the grid outside the straight line direction between the robot and the occupied point and corresponding to the area not detected by the visual device is unknown.
[0041] The set resolution corresponds to the size of the grid of the planar grid map.
[0042] In this embodiment, occupied represents an obstacle area, free represents an open area without obstacles, and unknown represents an area that is not detected by the visual device.
[0043] In step S2, the robot is mounted on a vehicle and moves along a preset route.
[0044] The step S2: determining whether there is a new occupied point in the mapped plane grid map based on the current grid, comprises:
[0045] The grid adjacent to the current grid in the direction of the robot's movement is used as the grid to be predicted; the state S of the grid to be predicted in the mapped map is obtained. - , determine the actual state of the grid to be predicted, the actual state S + for:
[0046]
[0047] Wherein, z is the observation value of the visual device, and the observation value is 0 or 1, s is the grid state, s=1 indicates that the grid state is idle, s=0 indicates that the grid state is occupied, p(z|s=1) indicates the probability that the observation value of the visual device is 1 in the grid idle state, and p(z|s=0) indicates the probability that the observation value of the visual device is 0 in the grid occupied state;
[0048] If the actual state of the grid to be predicted is occupied, setting the states of the grid to be predicted and all grids behind the grid to be predicted in the mapped map in the traveling direction to occupied; updating the mapped map;
[0049] If the actual state of the grid to be predicted is idle, the mapped map is not updated.
[0050] In this embodiment, based on the state S of the grid to be predicted - , determine the actual state S of the grid to be predicted + The derivation process is:
[0051] For each grid, p(s=1) represents the probability of the idle state, and p(s=0) represents the probability of the occupied state, p(s=1)+p(s=0)=1.
[0052] It is not appropriate to use two values to represent the state of a grid, so the ratio of the two is introduced to represent the state of the grid:
[0053] When the observation result (z~{0,1}) of the lidar measurement value arrives, the related grid will update the grid state Odd(s).
[0054] Assume that before the laser radar test value comes, the state of the grid is Odd(s), then after it comes, the state of the updated grid is
[0055] This expression is similar to conditional probability, which represents the state of the grid under the condition that z occurs.
[0056] According to the Bayesian formula, the following two formulas are obtained:
[0057]
[0058] Substituting the above two equations into Odd(s|z), we have:
[0059]
[0060] Taking the logarithm of both sides of the above equation, we can obtain that the method of representing the grid state has changed again, and logOdd(s) is used to represent the state of a grid.
[0061]
[0062] At this point, the only terms containing measurements are This ratio is called the measurement value model.
[0063] There are only two options: lofree and looccu, because the lidar has only two observation results for a grid, namely occupied and free.
[0064]
[0065] At this time, if logOdd(s) is used to represent the state S of grid y, the update rule is further simplified to
[0066]
[0067] Among them, S + and S-represent the state of grid S after and before the measurement, respectively.
[0068] In this embodiment, visual observation is impenetrable. If a point in space is confirmed to be occupied, we do not know whether the points after this point in the observation direction are occupied. Here, all unknown points after the occupied point in the observation direction in the two-dimensional grid map are marked as occupied. Since the robot is not a particle, we have to consider the collision volume of the robot in actual path planning. Here, all occupied points are expanded according to the maximum radius of the robot. Each original occupied point will cause the surrounding points to be occupied, which is used to simulate the collision volume of the robot.
[0069] The compressed 2D grid map can be quickly navigated using a static path planning algorithm. After the obstacle expansion, there is no need to worry about the robot's external collisions when planning the path.
[0070] The present invention provides a device for compressing a three-dimensional occupancy map, the device comprising:
[0071] A mapping module: configured to obtain a constructed three-dimensional occupancy map and a plane grid map corresponding to the three-dimensional occupancy map; the three-dimensional occupancy map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, the positive left direction as the y-axis, and the upward direction as the z-axis; the plane grid map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, and the positive left direction as the y-axis; the x-axis and y-axis of the three-dimensional occupancy map are respectively mapped with the x-axis and y-axis of the plane grid map, and the area corresponding to the mapped plane grid map is obtained on the three-dimensional occupancy map, the upper limit of the height that the robot can pass is determined based on the height of the robot and the visual device configured by the robot, and the point cloud with a height between 0 and the upper limit of the height in the three-dimensional occupancy map is mapped to the plane grid map according to the set resolution, and the grids with mapped points in the plane grid map are recorded as occupied points, and the grids corresponding to the occupied points are occupied;
[0072] Detection module: configured so that the robot moves along a preset route in the mapped plane grid map to detect each grid of the mapped plane grid map, the robot moving in a horizontal or vertical direction, wherein each step length of the robot moving corresponds to a grid; each time the robot moves a step length, the grid where the robot is currently located is used as the current grid;
[0073] The grid is detected in the following manner: based on the current grid, determining whether there is a new occupied point in the mapped plane grid map, and if so, marking the new occupied point in the mapped plane grid map;
[0074] Expansion module: configured to obtain the size of the robot and perform expansion processing on all occupied points based on the maximum radius of the robot; in the mapped plane grid map, obtain grids that are not marked as occupied points and have overlapping parts with the grid after the expansion processing of the occupied points, and mark them as occupied points.
[0075] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0076] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.
[0077] It should be noted that the above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0078] The present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.
[0079] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0082] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
Claims
1. A method for compressing a three-dimensional occupancy map, It is characterized in that The method comprises: Step S1: Acquire a constructed three-dimensional occupancy map and a plane grid map corresponding to the three-dimensional occupancy map; the three-dimensional occupancy map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, the positive left direction as the y-axis, and the upward direction as the z-axis; the plane grid map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, and the positive left direction as the y-axis; the x-axis and y-axis of the three-dimensional occupancy map are respectively mapped with the x-axis and y-axis of the plane grid map, and the area corresponding to the mapped plane grid map is obtained on the three-dimensional occupancy map, the upper limit of the height that the robot can pass is determined based on the height of the robot and the visual device configured by the robot, and the point cloud with a height between 0 and the upper limit of the height in the three-dimensional occupancy map is mapped to the plane grid map according to the set resolution, and the grids with mapped points in the plane grid map are recorded as occupied points, and the grids corresponding to the occupied points are occupied; Step S2: the robot moves along a preset route in the mapped plane grid map to detect each grid of the mapped plane grid map, the robot moving in a horizontal or vertical direction, wherein each step length of the robot moving corresponds to a grid; each time the robot moves a step length, the grid where the robot is currently located is used as the current grid; The grid is detected in the following manner: based on the current grid, determining whether there is a new occupied point in the mapped plane grid map, and if so, marking the new occupied point in the mapped plane grid map; Step S3: Obtain the size of the robot, and perform expansion processing on all occupied points based on the maximum radius of the robot; in the mapped plane grid map, obtain grids that are not marked as occupied points and have overlapping parts with the grid after the expansion processing of occupied points, and mark them as occupied points.
2. The method according to claim 1, It is characterized in that In step S1, the visual device is a laser radar scanning device, and the state of each grid in the mapped plane grid map is one of occupied, idle, and unknown. The state of the grid corresponding to the occupied point is occupied, the state of the grid in the straight line between the robot and the occupied point is idle, and the state of the grid outside the straight line between the robot and the occupied point and corresponding to the area not detected by the visual device is unknown.
3. The method according to claim 1, It is characterized in that The set resolution corresponds to the size of the grid of the planar grid map.
4. The method according to claim 1, It is characterized in that The step S2: determining whether there is a new occupied point in the mapped plane grid map based on the current grid, comprises: The grid adjacent to the current grid in the direction of the robot's movement is used as the grid to be predicted; the state S of the grid to be predicted in the mapped map is obtained. - , determine the actual state of the grid to be predicted, the actual state S + for: Wherein, z is the observation value of the visual device, and the observation value is 0 or 1, s is the grid state, s=1 indicates that the grid state is idle, s=0 indicates that the grid state is occupied, p(z|s=1) indicates the probability that the observation value of the visual device is 1 in the grid idle state, and p(z|s=0) indicates the probability that the observation value of the visual device is 0 in the grid occupied state; If the actual state of the grid to be predicted is occupied, setting the states of the grid to be predicted and all grids behind the grid to be predicted in the mapped map in the traveling direction to occupied; updating the mapped map; If the actual state of the grid to be predicted is idle, the mapped map is not updated.
5. A device for compressing a three-dimensional occupancy map, It is characterized in that The device comprises: A mapping module: configured to obtain a constructed three-dimensional occupancy map and a plane grid map corresponding to the three-dimensional occupancy map; the three-dimensional occupancy map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, the positive left direction as the y-axis, and the upward direction as the z-axis; the plane grid map takes the position of the robot as the origin, the direction of the front of the vehicle carrying the robot as the x-axis, and the positive left direction as the y-axis; the x-axis and y-axis of the three-dimensional occupancy map are respectively mapped with the x-axis and y-axis of the plane grid map, and the area corresponding to the mapped plane grid map is obtained on the three-dimensional occupancy map, the upper limit of the height that the robot can pass is determined based on the height of the robot and the visual device configured by the robot, and the point cloud with a height between 0 and the upper limit of the height in the three-dimensional occupancy map is mapped to the plane grid map according to the set resolution, and the grids with mapped points in the plane grid map are recorded as occupied points, and the grids corresponding to the occupied points are occupied; Detection module: configured so that the robot moves along a preset route in the mapped plane grid map to detect each grid of the mapped plane grid map, the robot moving in a horizontal or vertical direction, wherein each step length of the robot moving corresponds to a grid; each time the robot moves a step length, the grid where the robot is currently located is used as the current grid; The grid is detected in the following manner: based on the current grid, determining whether there is a new occupied point in the mapped plane grid map, and if so, marking the new occupied point in the mapped plane grid map; Expansion module: configured to obtain the size of the robot and perform expansion processing on all occupied points based on the maximum radius of the robot; in the mapped plane grid map, obtain grids that are not marked as occupied points and have overlapping parts with the grid after the expansion processing of the occupied points, and mark them as occupied points.
6. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium storing computer instructions, It is characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1-4.
