Cost map updating method, robot, and computer storage medium

By extracting obstacle edge nodes and adjusting the cost of non-edge nodes according to a preset expansion radius, the problems of time-consuming cost map updates and high memory consumption are solved, thus improving data processing performance and real-time performance.

CN116929355BActive Publication Date: 2026-06-05SHENZHEN PUDU TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN PUDU TECH CO LTD
Filing Date
2022-04-08
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, the costmap generation method for path search based on cost maps is time-consuming and consumes a lot of memory, resulting in poor real-time performance and affecting system smoothness.

Method used

By extracting obstacle edge nodes from the cost map to be updated, determining the expansion region based on the preset expansion radius, identifying the pixels within the expansion region as non-edge nodes of the edge nodes, and adjusting the cost value of the non-edge nodes based on the cost value of the edge nodes, the updated cost map is obtained.

Benefits of technology

This reduced the amount of processing required, improved the data processing performance for cost map updates, and enhanced the system's real-time performance and smoothness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116929355B_ABST
    Figure CN116929355B_ABST
Patent Text Reader

Abstract

The application relates to a cost map updating method, a robot, a computer storage medium and a computer program product. The method comprises the following steps: acquiring a to-be-updated cost map in a working area, and acquiring first position coordinates of a forbidden passing area; according to the first position coordinates, a first target area corresponding to the first position coordinates of the forbidden passing area is confirmed in the to-be-updated cost map, and the cost value of each pixel in the first target area is adjusted to a second cost value; according to edge nodes extracted from the first target area and a preset inflation radius, an inflation area is determined; non-edge nodes of the pixels in the inflation area are confirmed to be non-edge nodes, and a non-edge node set is obtained; according to the second cost value of the edge nodes, the first cost value of each non-edge node in the non-edge node set is adjusted, and an updated cost map is obtained. The method can improve the data processing performance of cost map updating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robotics, and in particular to a cost map updating method, a robot, and a computer storage medium. Background Technology

[0002] Indoor robots or robotic vacuum cleaners mostly rely on grid maps for navigation planning, which effectively represent traversable areas and obstacles. Typically, the traversable area is set to 0, and obstacles to 254. During navigation planning, to avoid obstacles, the cost of each grid point within a certain threshold range around the obstacle is reduced. The basic principle is that the closer to the obstacle, the higher the cost value; the farther away, the lower the cost value, even to zero. Selecting the path with the lowest cumulative cost is crucial.

[0003] However, the current method of generating costmaps for path search based on costmaps is time-consuming and consumes a lot of memory, resulting in poor real-time performance and affecting system smoothness. Summary of the Invention

[0004] Therefore, it is necessary to provide a cost map updating method, robot, device, computer equipment, computer-readable storage medium, and computer program product that can improve the data processing performance of cost map updating in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a robot, the robot including a memory and a processor, the memory storing executable program code, and the processor executing the executable code to perform the following steps:

[0006] Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value;

[0007] Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value.

[0008] Extract the edge nodes of the first target region;

[0009] Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated.

[0010] The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes;

[0011] Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map.

[0012] In one embodiment, obtaining the first location coordinates of the restricted area includes:

[0013] Obtain the second coordinates of the obstacle and the third coordinates of the restricted area;

[0014] The second and third position coordinates are used as the first position coordinates of the prohibited area.

[0015] In one embodiment, extracting the edge nodes of the first target region includes:

[0016] The first target region is dilated to obtain the dilated first target region, and the cost value of each pixel in the dilated first target region is the second generation value.

[0017] The edge pixels of the first target region after dilation are extracted using the m-neighborhood method, and the edge pixels are identified as edge nodes of the first target region.

[0018] In one embodiment, adjusting the first-generation values ​​of each non-edge node in the non-edge node set based on the second-generation values ​​of the edge nodes to obtain an updated cost map includes:

[0019] Determine the distance values ​​between each non-edge node in the set of non-edge nodes and the first target region;

[0020] Based on the distance values ​​between each non-edge node in the non-edge node set and the first target region, and the second-generation value of the edge node, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map.

[0021] The smaller the distance between the non-edge nodes in the non-edge node set and the first target region, the smaller the absolute value of the difference between the first-generation value of the corresponding non-edge node and the second-generation value of the edge node in the adjusted non-edge node set, and the smaller the probability that the robot can pass through the corresponding non-edge node.

[0022] In one embodiment, adjusting the first-generation value of each non-edge node in the non-edge node set based on the distance values ​​between each non-edge node in the non-edge node set and the first target region, and the second-generation value of the edge nodes, includes:

[0023] Based on the order of distance values ​​between each non-edge node in the non-edge node set and the first target region from smallest to largest, the first-generation values ​​of each non-edge node in the non-edge node set are adjusted exponentially according to the second-generation values ​​of the edge nodes to obtain the updated cost map.

[0024] In one embodiment, before adjusting the first-generation values ​​of each of the non-edge nodes in the set of non-edge nodes according to the second-generation values ​​of the edge nodes to obtain the updated cost map, the processor also executes code to perform the following steps:

[0025] Obtain a bitmap that matches the cost map to be updated;

[0026] Based on the positional mapping relationship between the bitmap and the cost map to be updated, the target pixel corresponding to the non-edge node to be adjusted is determined in the bitmap;

[0027] Obtain the bitmap value of the target pixel. If the bitmap value of the target pixel is a first preset value, it indicates that the first generation value of the non-edge node to be adjusted has not been adjusted. When the first generation value of the non-edge node to be adjusted has not been adjusted, the first generation value of the non-edge node to be adjusted is adjusted according to the generation value of the edge node.

[0028] If the bitmap value of the target pixel is a second preset value, it indicates that the first generation value of the non-edge node to be adjusted has been adjusted. When the first generation value of the non-edge node to be adjusted has been adjusted, there is no need to adjust the first generation value of the non-edge node to be adjusted.

[0029] In one embodiment, after adjusting the first-generation values ​​of each non-edge node in the non-edge node set according to the distance values ​​between each non-edge node in the non-edge node set and the first target region and the second-generation values ​​of the edge nodes to obtain an updated cost map, the processor further executes code to implement the following steps:

[0030] Obtain a bitmap that matches the cost map to be updated;

[0031] Based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the non-edge node to be adjusted in the cost map to be updated, the target pixel corresponding to the non-edge node to be adjusted is determined in the bitmap;

[0032] After adjusting the first-generation value of the non-edge node to be adjusted, the bitmap value of the target pixel is adjusted from the first preset value to the second preset value to obtain the updated bitmap.

[0033] In one embodiment, after adjusting the bitmap value of the target pixel from a first preset value to a second preset value to obtain an updated cost map, the processor further executes code to implement the following steps:

[0034] Based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the inflated region in the cost map to be updated, a second target region corresponding to the inflated region is determined in the bitmap;

[0035] The update of the cost map to be updated is completed when the bitmap values ​​of all pixels in the second target area are updated to the second preset value.

[0036] Secondly, this application also provides a cost map updating method. The method includes:

[0037] Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value;

[0038] Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value.

[0039] Extract the edge nodes of the first target region;

[0040] Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated.

[0041] The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes;

[0042] Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map.

[0043] Thirdly, this application also provides a cost map updating apparatus. The apparatus includes:

[0044] The cost map acquisition module is used to acquire the cost map to be updated in the work area and to acquire the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value;

[0045] The target area determination module is used to identify, based on the first location coordinates, a first target area in the cost map to be updated that corresponds to the first location coordinates of the prohibited area, and to adjust the first generation value of each pixel in the first target area to a second generation value, wherein the second generation value is different from the first generation value.

[0046] An edge node extraction module is used to extract edge nodes of the first target region;

[0047] The expansion region determination module is used to determine the expansion region in the cost map to be updated based on the preset expansion radius and the position of the edge node in the cost map to be updated.

[0048] The non-edge node determination module is used to identify pixels within the expansion region as non-edge nodes of the edge nodes, thereby obtaining a set of non-edge nodes;

[0049] The cost map update module is used to adjust the first-generation value of each non-edge node in the non-edge node set according to the second-generation value of the edge node, so as to obtain the updated cost map.

[0050] Fourthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0051] Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value;

[0052] Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value.

[0053] Extract the edge nodes of the first target region;

[0054] Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated.

[0055] The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes;

[0056] Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map.

[0057] Fifthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0058] Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value;

[0059] Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value.

[0060] Extract the edge nodes of the first target region;

[0061] Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated.

[0062] The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes;

[0063] Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map.

[0064] Sixthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0065] Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value;

[0066] Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value.

[0067] Extract the edge nodes of the first target region;

[0068] Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated.

[0069] The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes;

[0070] Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map.

[0071] The aforementioned cost map updating method, robot, apparatus, computer equipment, storage medium, and computer program product extract edge nodes of obstacles in the cost map to be updated; determine an expansion region based on a preset expansion radius and the edge nodes; identify pixels within the expansion region as non-edge nodes of the edge nodes, obtaining a set of non-edge nodes; and adjust the first-generation value of each non-edge node in the set of non-edge nodes based on the cost value of the edge nodes to obtain the updated cost map. This method only needs to extract edge nodes from the cost map to be updated, rather than all nodes, and only processes the boundaries of obstacles, reducing the processing load; it only requires expansion processing of edge nodes, improving the data processing performance of cost map updating. Attached Figure Description

[0072] Figure 1 This is an application environment diagram of the cost map update method in one embodiment;

[0073] Figure 2 This is a flowchart illustrating a cost map update method in one embodiment;

[0074] Figure 3 This is a flowchart illustrating the cost map update method in another embodiment;

[0075] Figure 4 This is a flowchart illustrating the cost map update method in another embodiment;

[0076] Figure 5 This is a schematic diagram of the updated cost map in one embodiment;

[0077] Figure 6 This is a flowchart illustrating the cost map update method in another embodiment;

[0078] Figure 7 This is a structural block diagram of a cost map updating device in one embodiment;

[0079] Figure 8 This is a diagram of the internal structure of a robot in one embodiment. Detailed Implementation

[0080] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0081] The cost map update method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. The robot obtains the cost map to be updated in the work area and the first location coordinates of the prohibited area from the server. Each pixel in the cost map to be updated has a corresponding first-generation value. Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first-generation value of each pixel in the first target area is adjusted to a second-generation value, which is different from the first-generation value. Edge nodes of the first target area are extracted. Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, an expansion area is determined in the cost map to be updated. Pixels within the expansion area are identified as non-edge nodes of the edge nodes, resulting in a set of non-edge nodes. Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node in the set of non-edge nodes is adjusted to obtain the updated cost map. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0082] In one embodiment, such as Figure 2 As shown, a cost map update method is provided. Taking the application of this method to a robot as an example, the robot includes a memory and a processor. The memory stores executable program code, and the processor executes the executable code to implement the following steps:

[0083] Step 202: Obtain the cost map to be updated in the work area and obtain the first location coordinates of the prohibited area. Each pixel in the cost map to be updated has a corresponding first-generation value.

[0084] The operating area can be, but is not limited to, the area where the robot performs tasks such as cleaning, patrolling, mine clearance, and harvesting. The cost map is used for navigation path planning. Optionally, the cost map sets the passable area to 0 and obstacles to 254. The cost value represents the distance to obstacles; a higher cost value indicates a closer distance to obstacles, and a lower cost value indicates a farther distance.

[0085] Optionally, in one embodiment, obtaining the first location coordinates of the prohibited area includes: obtaining the second location coordinates of the obstacle and the third location coordinates of the restricted area; and using the second and third location coordinates as the first location coordinates of the prohibited area. The second location coordinates of the obstacle may be, but are not limited to, obtained through a sensor (e.g., LiDAR), and the restricted area includes a virtual wall.

[0086] Step 204: Based on the first location coordinates, identify the first target area corresponding to the first location coordinates of the prohibited area in the cost map to be updated, and adjust the first generation value of each pixel in the first target area to the second generation value. The second generation value is different from the first generation value.

[0087] Specifically, based on the conversion relationship between location coordinates, a first target area corresponding to the first location coordinate of the prohibited area is identified in the cost map to be updated, and the first-generation value of each pixel in the first target area is adjusted to the second-generation value; wherein the second-generation value is different from the first-generation value.

[0088] Step 206: Extract the edge nodes of the first target region.

[0089] Specifically, based on the cost value of each pixel in the first target region, pixels with a cost value of the second cost value are determined as nodes in the first target region, and nodes with a value of 0 in their 8 neighborhoods around each node in the first target region are determined as edge nodes; wherein, there are multiple edge nodes.

[0090] Optionally, in one embodiment, extracting edge nodes of the first target region includes: dilating the first target region to obtain a dilated first target region, where the cost value of each pixel in the dilated first target region is a second-generation value; extracting edge pixels of the dilated first target region using the m-neighborhood method, and identifying these edge pixels as edge nodes of the first target region; and placing the extracted edge nodes into a priority queue, where these edge nodes are nodes with an expansion distance of 0. Here, the m-neighborhood method uses an 8-neighborhood; an edge pixel is defined as a pixel whose 8-neighborhood has a value of 0. By extracting edge nodes from the nodes, the amount of data processing is reduced.

[0091] Step 208: Determine the expansion region in the cost map to be updated based on the preset expansion radius and the position of the edge nodes in the cost map to be updated.

[0092] The preset expansion radius is customizable and is generally larger than the robot's radius. The expansion region is centered on the edge nodes.

[0093] Step 210: Identify the pixels within the expansion region as non-edge nodes that are edge nodes, and obtain the set of non-edge nodes.

[0094] Step 212: Based on the second-generation value of the edge nodes, adjust the first-generation value of each non-edge node in the non-edge node set to obtain the updated cost map.

[0095] Specifically, based on the preset expansion radius and the positions of edge nodes in the cost map to be updated, an expansion region is determined in the cost map. A priority queue is created, including all edge nodes arranged sequentially. The distance between each pixel in the expansion region and each edge node is calculated sequentially, resulting in multiple distance values ​​between each pixel in the expansion region and all edge nodes. The edge node with the smallest distance value among these multiple distance values ​​is taken as the corresponding edge node, thus determining all pixels in the expansion region of each edge node and obtaining the non-edge node set for each edge node. The distance values ​​between each non-edge node in the non-edge node set and the first target region are determined. Based on the distance values ​​between each non-edge node in the non-edge node set and the first target region, and the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted until the first-generation value of each non-edge node in the non-edge node set of all edge nodes in the priority queue is adjusted, resulting in the updated cost map. Among them, the smaller the distance between the non-edge node in the non-edge node set and the first target region, the smaller the absolute value of the difference between the first generation value of the corresponding non-edge node in the adjusted non-edge node set and the first generation value of the non-edge node, and the smaller the probability that the robot can pass through the corresponding non-edge node.

[0096] The aforementioned cost map update robot extracts edge nodes of obstacles from the cost map to be updated; determines expansion regions in the cost map based on a preset expansion radius and the positions of the edge nodes; identifies pixels within the expansion regions as non-edge nodes of the edge nodes, obtaining a set of non-edge nodes; and adjusts the first-generation values ​​of each non-edge node in the set of non-edge nodes based on the second-generation values ​​of the edge nodes, thus obtaining the updated cost map. This method only needs to extract edge nodes from the cost map to be updated, rather than all nodes, and only creates a priority queue for obstacle boundaries, reducing the processing load; it only needs to expand edge nodes, improving the data processing performance of cost map updates.

[0097] In another embodiment, such as Figure 3 As shown, a cost map update method is provided. Taking the application of this method to a robot as an example, the robot includes a memory and a processor. The memory stores executable program code, and the processor executes the executable code to implement the following steps.

[0098] Step 302: Obtain the cost map to be updated in the work area and obtain the first location coordinates of the prohibited area. Each pixel in the cost map to be updated has a corresponding first-generation value.

[0099] Step 304: Based on the first location coordinates, identify the first target area corresponding to the first location coordinates of the prohibited area in the cost map to be updated, and adjust the first generation value of each pixel in the first target area to the second generation value. The second generation value is different from the first generation value.

[0100] Step 306: Extract the edge nodes of the first target region.

[0101] Specifically, the first target region is dilated to obtain the dilated first target region. The cost value of each pixel in the dilated first target region is the second generation value. The edge pixels of the dilated first target region are extracted using the m-neighborhood method, and the edge pixels are identified as the edge nodes of the first target region.

[0102] Step 308: Determine the expansion region in the cost map to be updated based on the preset expansion radius and the position of the edge nodes in the cost map to be updated.

[0103] Step 310: Identify the pixels within the expansion region as non-edge nodes that are edge nodes, and obtain the set of non-edge nodes.

[0104] Step 312: Determine the distance values ​​between each non-edge node in the non-edge node set and the first target region.

[0105] Step 314: Based on the order of distance values ​​between each non-edge node in the non-edge node set and the first target region from smallest to largest, determine the non-edge nodes to be adjusted in sequence.

[0106] The distance between each non-edge node in the set of non-edge nodes and the first target region can be determined by either of the following two methods:

[0107] The first method is to calculate the distance between each non-edge node in the non-edge node set and the center of the first target region, thus obtaining the distance value between each non-edge node in the non-edge node set and the first target region.

[0108] The second method is to obtain multiple distance values ​​for each non-edge node in the non-edge node set by measuring the distance between each non-edge node and the edge node; and to take the minimum distance value among the multiple distance values ​​of each non-edge node in the non-edge node set as the distance value between each non-edge node in the non-edge node set and the first target region.

[0109] Step 316: Obtain the bitmap that matches the cost map to be updated.

[0110] Specifically, based on the size conversion relationship between the bitmap and the cost map, a bitmap matching the size of the cost map to be updated is obtained. For example, if the cost map to be updated is 640*480, then the size of the matching bitmap is 640*480 / 8 = 3840 bytes.

[0111] Step 318: Based on the positional mapping relationship between the bitmap and the cost map to be updated, determine the target pixel corresponding to the non-edge node to be adjusted in the bitmap.

[0112] The bitmap is used to record the adjustment status of non-edge nodes in the cost map. The update status of target pixels in the bitmap is used to detect whether the cost map to be updated has been fully updated. After obtaining the bitmap that matches the cost map to be updated, the bitmap values ​​of each pixel in the bitmap are initialized to a first preset value, indicating that the first-generation value of the non-edge node to be adjusted has not been adjusted. Based on the positional mapping relationship between the bitmap and the cost map to be updated, the target pixel corresponding to the non-edge node to be adjusted is determined in the bitmap. The number of target pixels in the bitmap is the same as the number of non-edge nodes in the first target region.

[0113] Step 320: Obtain the bitmap value of the target pixel. If the bitmap value of the target pixel is the first preset value, it indicates that the first generation value of the non-edge node to be adjusted has not been adjusted. When the first generation value of the non-edge node to be adjusted has not been adjusted, the first generation value of the non-edge node to be adjusted is adjusted according to the second generation value of the edge node.

[0114] Specifically, before adjusting the first-generation value of each non-edge node in the non-edge node set using an exponential decay method based on the value of edge nodes, it is necessary to detect the bitmap value of the target pixel of each non-edge node to determine whether the first-generation value of that non-edge node has been adjusted. That is, the bitmap value of the target pixel is obtained; if the bitmap value of the target pixel is a first preset value, it indicates that the first-generation value of the non-edge node to be adjusted has not been adjusted. In other words, the first-generation value of that non-edge node needs to be adjusted.

[0115] Step 322: If the bitmap value of the target pixel is the second preset value, it indicates that the first generation value of the non-edge node to be adjusted has been adjusted.

[0116] Specifically, before adjusting the first-generation values ​​of each non-edge node in the non-edge node set using an exponential decay method based on the second-generation values ​​of the edge nodes, the bitmap value of the target pixel is obtained. If the bitmap value of the target pixel is a first preset value, it indicates that the first-generation value of the non-edge node to be adjusted has not been adjusted. If the first-generation value of the non-edge node to be adjusted has already been adjusted, then there is no need to adjust the first-generation value of the non-edge node to be adjusted. In other words, it is not necessary to adjust the first-generation value of the non-edge node.

[0117] Step 324: Adjust the first generation value of each non-edge node in the non-edge node set in an exponential decay manner according to the generation value of the edge node.

[0118] The method of calculating the cost value using exponential decay is an existing approach and will not be elaborated upon here.

[0119] Specifically, the distance values ​​between each non-edge node in the non-edge node set and the first target region are determined. Based on the order of the distance values ​​between each non-edge node in the non-edge node set and the first target region from small to large, the first-generation values ​​of each non-edge node in the non-edge node set are adjusted in an exponential decay manner according to the second-generation values ​​of the edge nodes.

[0120] Step 326: After adjusting the first-generation value of the non-edge node to be adjusted, the bitmap value of the target pixel is also adjusted from the first preset value to the second preset value to obtain the updated bitmap.

[0121] When adjusting the first-generation value of each non-edge node in the set of non-edge nodes, it is necessary to obtain the bitmap value of the target pixel. If the bitmap value of the target pixel is a first preset value, it indicates that the first-generation value of the non-edge node to be adjusted has not been adjusted. Then, the first-generation value of each non-edge node in the set of non-edge nodes is adjusted according to the value of the edge node; the adjustment of the first-generation value of the non-edge node of the edge node is then performed. If the bitmap value of the target pixel is a second preset value, it indicates that the first-generation value of the non-edge node to be adjusted has been adjusted, and no adjustment is needed for the current non-edge node. Based on the order of distance values ​​between each non-edge node in the set of non-edge nodes and the first target region from smallest to largest, the first-generation value of each non-edge node in the set of non-edge nodes is adjusted exponentially according to the value of the edge node, resulting in an updated cost map. Before adjusting the non-edge nodes, the bitmap value of the corresponding target pixel is detected, which can reduce data processing operations and avoid repeated adjustments to the same non-edge node, thus preventing data inaccuracies.

[0122] For example, the acquired edge nodes include edge node 1, edge node 2, edge node 3, and edge node n. Each edge node has a set of non-edge nodes (including non-edge node 1, non-edge node 2, non-edge node 3, ..., non-edge node m). First, the first-generation values ​​of the non-edge nodes in the non-edge node set of edge node 1 are processed. The distance values ​​between each non-edge node in the non-edge node set and the first target region are in ascending order: non-edge node 1 → non-edge node 2 → non-edge node 3 → ... → non-edge node m. Based on this order, the first-generation values ​​of the non-edge nodes are adjusted, and the bitmap value of the target pixel in the bitmap is obtained. If the bitmap value of the target pixel is a first preset value, it indicates that the first-generation value of the non-edge node to be adjusted has not been adjusted. According to the generation value of the edge node, the first-generation value of each non-edge node in the non-edge node set is adjusted in an exponential decay manner. If the bitmap value of the target pixel is the second preset value, it indicates that the first generation value of the non-edge node to be adjusted has been adjusted; until the first generation value of each non-edge node in the set of all non-edge nodes is adjusted, the updated cost map is obtained.

[0123] Optionally, in one embodiment, adjusting the bitmap value of the target pixel from a first preset value to a second preset value to obtain an updated bitmap includes: determining a second target region corresponding to the dilated region in the bitmap based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the dilated region in the cost map to be updated; detecting whether the bitmap values ​​of all pixels in the second target region have been updated to the second preset value; if the bitmap values ​​of all pixels in the second target region have been updated to the second preset value, it indicates that the update of the cost map to be updated has been completed. By detecting whether the bitmap values ​​of the corresponding target pixels in the bitmap have all been adjusted, it is easy to determine whether the cost map has been completely updated, thus improving the accuracy of the cost map.

[0124] The aforementioned cost map update robot extracts edge nodes of obstacles from the cost map to be updated; determines expansion regions in the cost map based on preset expansion radii and the positions of edge nodes in the cost map; identifies pixels within the expansion regions as non-edge nodes of the edge nodes, obtaining a set of non-edge nodes; and, based on the second-generation values ​​of the edge nodes, before adjusting the first-generation values ​​of each non-edge node in the set, detects the bitmap values ​​of the target pixels of the non-edge nodes in the bit map. If the first-generation values ​​of the non-edge nodes are not adjusted, the first-generation values ​​of each non-edge node in the set are adjusted exponentially based on the second-generation values ​​of the edge nodes, and the bitmap values ​​of the target pixels are adjusted from a first preset value to a second preset value, resulting in an updated cost map. This method only needs to extract edge nodes from the cost map to be updated, rather than all nodes, and only processes the boundaries of obstacles, reducing the processing load; it only needs to expand edge nodes, improving the data processing performance of cost map updates; and it uses a bit map to record the update status of the standby map, ensuring the accuracy of cost map updates.

[0125] In another embodiment, such as Figure 4 As shown, a cost map update method is provided. Taking the application of this method to a robot as an example, the robot includes a memory and a processor. The memory stores executable program code, and the processor executes the executable code to implement the following steps:

[0126] Step 402: Obtain the cost map to be updated in the work area and obtain the first location coordinates of the prohibited area. Each pixel in the cost map to be updated has a corresponding first-generation value.

[0127] Specifically, the cost map to be updated in the work area is obtained, as well as the second position coordinates of obstacles and the third position coordinates of restricted areas; the second and third position coordinates are used as the first position coordinates of the prohibited area.

[0128] Step 404: Based on the first location coordinates, identify the first target area corresponding to the first location coordinates of the prohibited area in the cost map to be updated, and adjust the first generation value of each pixel in the first target area to the second generation value. The second generation value is different from the first generation value.

[0129] Step 406: Extract the edge nodes of the first target region.

[0130] Specifically, the first target region is dilated to obtain the dilated first target region. The cost value of each pixel in the dilated first target region is the second generation value. The edge pixels of the dilated first target region are extracted using the m-neighborhood method, and the edge pixels are identified as the edge nodes of the first target region.

[0131] Step 408: Determine the expansion region based on the preset expansion radius and edge nodes.

[0132] Specifically, based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated.

[0133] Step 410: Identify the non-edge nodes that are edge nodes within the expansion region in the cost map to be updated, and obtain the set of non-edge nodes in the cost map to be updated.

[0134] Step 412: Determine the distance values ​​between each non-edge node in the non-edge node set and the first target region.

[0135] Specifically, the distance between each non-edge node in the non-edge node set and the center of the first target region is calculated to obtain the distance value between each non-edge node in the non-edge node set and the first target region. Optionally, in one embodiment, multiple distance values ​​for each non-edge node in the non-edge node set can be obtained based on the distance between each non-edge node in the non-edge node set and the edge node; the minimum distance value among the multiple distance values ​​for each non-edge node in the non-edge node set is taken as the distance value between each non-edge node in the non-edge node set and the first target region.

[0136] Among them, the smaller the distance between the non-edge node in the non-edge node set and the first target region, the smaller the absolute value of the difference between the first generation value of the corresponding non-edge node in the adjusted non-edge node set and the first generation value of the non-edge node, and the smaller the probability that the robot can pass through the corresponding non-edge node.

[0137] Step 414: Obtain the bitmap that matches the cost map to be updated.

[0138] Step 416: Based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the non-edge node to be adjusted in the cost map to be updated, determine the target pixel corresponding to the non-edge node to be adjusted in the bitmap.

[0139] Specifically, based on the order of distance values ​​between each non-edge node in the non-edge node set and the first target region from small to large, the non-edge nodes to be adjusted in the non-edge node set are determined sequentially. According to the position mapping relationship between the bit map and the cost map to be updated, and the position of the non-edge node to be adjusted in the cost map to be updated, the target pixel corresponding to the non-edge node to be adjusted is determined in the bit map.

[0140] Step 418: After adjusting the first-generation value of the non-edge node to be adjusted, the bitmap value of the target pixel is adjusted from the first preset value to the second preset value to obtain the updated bitmap.

[0141] Specifically, based on the order of distance values ​​between each non-edge node in the non-edge node set and the first target region from smallest to largest, the adjustment order of each non-edge node is determined. According to the adjustment order of each non-edge node, after adjusting the first-generation values ​​of the non-edge nodes to be adjusted, the bitmap value of the target pixel is adjusted from a first preset value to a second preset value, resulting in an updated cost map. For example... Figure 5 The diagram shown is a schematic of the updated cost map in one embodiment; where 254 represents an obstacle, and the other values ​​are used to characterize the cost value. As can be seen from the diagram, the closer to the obstacle, the greater the cost value, and the farther away from the obstacle, the smaller the cost value.

[0142] Step 420: Based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the dilated region in the cost map to be updated, determine the second target region corresponding to the dilated region in the bitmap. When it is detected that the bitmap values ​​of all pixels in the second target region have been updated from the first preset value to the second preset value, it indicates that the update of the cost map to be updated has been completed.

[0143] Optionally, in one embodiment, adjusting the bitmap value of the target pixel from a first preset value to a second preset value to obtain an updated bitmap includes: determining a second target region in the bitmap corresponding to the dilated region based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the dilated region in the cost map to be updated; detecting whether the bitmap values ​​of all pixels in the second target region have been updated to the second preset value, and indicating that the update of the cost map to be updated is completed when the bitmap values ​​of all pixels in the second target region have been updated to the second preset value, thereby obtaining the updated cost map.

[0144] The aforementioned cost map update robot extracts edge nodes of obstacles in the cost map to be updated; determines expansion regions in the cost map based on a preset expansion radius and the positions of the edge nodes; identifies pixels within the expansion regions as non-edge nodes of the edge nodes, obtaining a set of non-edge nodes; and adjusts the first-generation value of each non-edge node in the set of non-edge nodes based on the cost value of the edge nodes, thus obtaining the updated cost map. This method only needs to extract edge nodes from the cost map to be updated, rather than all nodes, and only processes the boundaries of obstacles, reducing the processing load; it only needs to expand edge nodes, improving the data processing performance of cost map updates. Furthermore, it uses a bitmap to record the update status of the standby map, thus obtaining the cost map update status.

[0145] It is understood that, based on the same inventive concept, this application also provides an embodiment for applying the aforementioned cost map update method to a working device, wherein the working device is described as a robot. The solution provided by this cost map update method is similar to the implementation described in the above method. Therefore, the specific limitations in one or more cost map update method embodiments provided below can be found in the limitations of the cost map update method executed by the robot described above, and will not be repeated here.

[0146] In one embodiment, such as Figure 6 As shown, a cost map update method is provided. Taking the application of this method to a robot as an example, the method includes the following steps:

[0147] Step 602: Obtain the cost map to be updated in the work area and obtain the first location coordinates of the prohibited area. Each pixel in the cost map to be updated has a corresponding first-generation value.

[0148] The operating area can be, but is not limited to, the area where the robot performs tasks such as cleaning, patrolling, mine clearance, and harvesting. The cost map is used for navigation path planning. Optionally, the cost map can be set to 0 for passable areas and 254 for obstacles.

[0149] Optionally, in one embodiment, obtaining the first location coordinates of the prohibited area includes: obtaining the second location coordinates of the obstacle and the third location coordinates of the restricted area; and using the second and third location coordinates as the first location coordinates of the prohibited area. The second location coordinates of the obstacle may be, but are not limited to, obtained through a sensor (e.g., LiDAR), and the restricted area includes a virtual wall.

[0150] Step 604: Based on the first location coordinates, identify the first target area corresponding to the first location coordinates of the prohibited area in the cost map to be updated, and adjust the first generation value of each pixel in the first target area to the second generation value. The second generation value is different from the first generation value.

[0151] Specifically, based on the transformation relationship between location coordinates, a first target area corresponding to the first location coordinate of the prohibited area is identified in the cost map to be updated, and the cost value of each pixel in the first target area is adjusted to the second-generation value; wherein, the second-generation value is different from the first-generation value.

[0152] Step 606: Extract the edge nodes of the first target region.

[0153] Specifically, based on the cost value of each pixel in the first target region, pixels with a cost value of the second cost value are determined as nodes in the first target region, and nodes with a value of 0 in their 8 neighborhoods around each node in the first target region are determined as edge nodes; wherein, there are multiple edge nodes.

[0154] Optionally, in one embodiment, extracting edge nodes of the first target region includes: dilating the first target region to obtain a dilated first target region, where the cost value of each pixel in the dilated first target region is a second-generation value; extracting edge pixels of the dilated first target region using the m-neighborhood method, and identifying these edge pixels as edge nodes of the first target region; and placing the extracted edge nodes into a priority queue, where these edge nodes are nodes with an expansion distance of 0. Here, the m-neighborhood method uses an 8-neighborhood; an edge pixel is defined as a pixel whose 8-neighborhood has a value of 0. By extracting edge nodes from the nodes, the amount of data processing is reduced.

[0155] Step 608: Determine the expansion region in the cost map to be updated based on the preset expansion radius and the position of the edge nodes in the cost map to be updated.

[0156] The preset expansion radius is customizable and is generally larger than the robot's radius. The expansion region is centered on the edge nodes.

[0157] Step 610: Identify the pixels within the expansion region as non-edge nodes that are edge nodes, and obtain the set of non-edge nodes.

[0158] Step 612: Adjust the first generation value of each non-edge node in the non-edge node set according to the cost value of the edge nodes to obtain the updated cost map.

[0159] Specifically, the edge nodes at the head of the priority queue are dequeued sequentially. Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, expansion regions are determined in the cost map. All pixels within the expansion region of each edge node are then determined sequentially, resulting in a set of non-edge nodes for each edge node. The distance between each non-edge node in the non-edge node set and the first target region is determined. Based on the distance between each non-edge node in the non-edge node set and the first target region, and the cost value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map. The smaller the distance between a non-edge node in the non-edge node set and the first target region, the smaller the absolute value of the difference between the first-generation value of the corresponding non-edge node in the adjusted non-edge node set and the first-generation value of the non-edge node itself, indicating a lower probability that the robot can traverse the corresponding non-edge node.

[0160] The aforementioned cost map update method extracts edge nodes of obstacles from the cost map to be updated; determines expansion regions in the cost map based on a preset expansion radius and the positions of the edge nodes; identifies pixels within the expansion regions as non-edge nodes of the edge nodes, obtaining a set of non-edge nodes; and adjusts the first-generation value of each non-edge node in the set of non-edge nodes based on the cost value of the edge nodes, thus obtaining the updated cost map. This method only needs to extract edge nodes from the cost map to be updated, rather than all nodes, optimizes the queue only for obstacle boundaries, reducing the processing load; and only expands edge nodes, improving the data processing performance of cost map updates.

[0161] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0162] Based on the same inventive concept, this application also provides a cost map updating apparatus for implementing the cost map updating method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more cost map updating apparatus embodiments provided below can be found in the limitations of the cost map updating method described above, and will not be repeated here.

[0163] In one embodiment, such as Figure 7 As shown, a cost map updating device is provided, including: a cost map acquisition module 702, a target region determination module 704, an edge node extraction module 706, an expansion region determination module 708, a non-edge node determination module 710, and a cost map updating module 712, wherein:

[0164] The cost map acquisition module 702 is used to acquire the cost map to be updated in the work area and to acquire the first location coordinates of the prohibited area. Each pixel in the cost map to be updated has a corresponding first-generation value.

[0165] The target area determination module 704 is used to identify the first target area corresponding to the first location coordinates of the prohibited area in the cost map to be updated based on the first location coordinates, and adjust the first generation value of each pixel in the first target area to the second generation value, which is different from the first generation value.

[0166] Edge node extraction module 706 is used to extract edge nodes of the first target region.

[0167] The expansion region determination module 708 is used to determine the expansion region in the cost map to be updated based on the preset expansion radius and the position of the edge nodes in the cost map to be updated.

[0168] The non-edge node determination module 710 is used to identify non-edge nodes that are edge nodes within the expansion region, thereby obtaining a set of non-edge nodes.

[0169] The cost map update module 712 is used to adjust the first-generation value of each non-edge node in the non-edge node set according to the second-generation value of the edge node, so as to obtain the updated cost map.

[0170] In the aforementioned cost map update device, edge nodes of obstacles in the cost map to be updated are extracted; an expansion region is determined in the cost map based on a preset expansion radius and the position of the edge nodes; pixels within the expansion region are identified as non-edge nodes of the edge nodes, resulting in a set of non-edge nodes; and the first-generation values ​​of each non-edge node in the set of non-edge nodes are adjusted based on the second-generation values ​​of the edge nodes to obtain the updated cost map. This device only needs to extract edge nodes from the cost map to be updated, rather than all nodes, and only performs expansion processing on the boundaries of obstacles, reducing the processing load; it only needs to expand edge nodes, improving the data processing performance of cost map updates.

[0171] In another embodiment, a cost map updating apparatus is provided, which, in addition to including a cost map acquisition module 702, a target region determination module 704, an edge node extraction module 706, an dilated region determination module 708, a non-edge node determination module 710, and a cost map updating module 712, further includes: a dilation processing module, a bit map determination module, a target pixel determination module, and a detection module, wherein:

[0172] Optionally, in one embodiment, the cost map acquisition module 702 is further configured to acquire the second position coordinates of the obstacle and the third position coordinates of the restricted area; and use the second position coordinates and the third position coordinates as the first position coordinates of the prohibited area.

[0173] The dilation processing module is used to dilate the first target region to obtain the dilated first target region. The cost value of each pixel in the dilated first target region is the second generation value.

[0174] In one embodiment, the edge node extraction module 706 is further configured to extract the edge pixels of the dilated first target region using the m-neighborhood method, and identify the edge pixels as edge nodes of the first target region.

[0175] Optionally, in one embodiment, the cost map update module 712 is further configured to determine the distance values ​​between each non-edge node in the non-edge node set and the first target region; and adjust the first generation value of each non-edge node in the non-edge node set according to the distance values ​​between each non-edge node in the non-edge node set and the first target region and the cost value of the edge nodes, so as to obtain the updated cost map.

[0176] Among them, the smaller the distance between the non-edge node in the non-edge node set and the first target region, the smaller the absolute value of the difference between the first generation value of the corresponding non-edge node in the adjusted non-edge node set and the first generation value of the non-edge node, and the smaller the probability that the robot can pass through the corresponding non-edge node.

[0177] Optionally, in one embodiment, the cost map update module 712 is further configured to adjust the first generation value of each non-edge node in the non-edge node set in an exponential decay manner based on the order of the distance values ​​between each non-edge node in the non-edge node set and the first target region from small to large, according to the cost value of the edge node, so as to obtain an updated cost map.

[0178] The bitmap determination module is used to obtain a bitmap that matches the cost map to be updated.

[0179] The target pixel determination module is used to determine the target pixel corresponding to the non-edge node to be adjusted in the bit map based on the positional mapping relationship between the bit map and the cost map to be updated.

[0180] The detection module is used to obtain the bitmap value of the target pixel. If the bitmap value of the target pixel is the first preset value, it indicates that the first generation value of the non-edge node to be adjusted has not been adjusted.

[0181] If the bitmap value of the target pixel is the second preset value, it indicates that the first-generation value of the non-edge node to be adjusted has been adjusted.

[0182] Optionally, in one embodiment, the bitmap determination module is further configured to obtain a bitmap that matches the cost map to be updated.

[0183] Optionally, in one embodiment, the target pixel determination module is used to determine the target pixel corresponding to the non-edge node to be adjusted in the bit map based on the positional mapping relationship between the bit map and the cost map to be updated, and the position of the non-edge node to be adjusted in the cost map to be updated.

[0184] Optionally, in one embodiment, the cost map update module 712 is further configured to adjust the bitmap value of the target pixel from a first preset value to a second preset value after adjusting the first generation value of the non-edge node to be adjusted, so as to obtain an updated cost map.

[0185] Optionally, in one embodiment, the cost map update module 712 is further configured to determine a second target region corresponding to the expansion region in the bit map based on the positional mapping relationship between the bit map and the cost map to be updated, and the position of the expansion region in the cost map to be updated.

[0186] Detect whether the bitmap values ​​of all pixels in the second target area have been updated to the second preset value. If the bitmap values ​​of all pixels in the second target area have been updated to the second preset value, it indicates that the update of the cost map to be updated has been completed.

[0187] In one embodiment, the cost map updating device extracts edge nodes of obstacles in the cost map to be updated; determines an expansion region in the cost map based on a preset expansion radius and the position of the edge nodes in the cost map; identifies pixels within the expansion region as non-edge nodes of the edge nodes, obtaining a set of non-edge nodes; and, based on the second-generation value of the edge nodes, before adjusting the first-generation value of each non-edge node in the set of non-edge nodes, detects the bitmap value of the target pixel in the bit map of the non-edge nodes. If the first-generation value of the non-edge nodes has not been adjusted, the first-generation value of each non-edge node in the set of non-edge nodes is adjusted exponentially based on the second-generation value of the edge nodes, and the bitmap value of the target pixel is adjusted from a first preset value to a second preset value, resulting in an updated cost map. This method only needs to extract edge nodes in the cost map to be updated, instead of all nodes, and only processes the boundaries of obstacles, reducing the processing load; it only needs to expand the edge nodes, improving the data processing performance of cost map updating; and it uses a bit map to record the update status of the standby map, ensuring the accuracy of cost map updates.

[0188] The modules in the aforementioned cost map update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0189] In one embodiment, a computer device is provided, which may be a robot, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a cost map update method.

[0190] Those skilled in the art will understand that Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0191] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0192] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0194] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0195] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0196] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A robot, characterized in that, The robot includes a memory and a processor. The memory stores executable program code, and the processor executes the executable program code to perform the following steps: Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value; Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value. Extract the edge nodes of the first target region; Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated. The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes; Obtain a bitmap that matches the cost map to be updated; Based on the positional mapping relationship between the bitmap and the cost map to be updated, the target pixel corresponding to each of the non-edge nodes is determined in the bitmap. Based on the bitmap value corresponding to each target pixel in the bitmap, determine the non-edge nodes to be adjusted and the non-edge nodes that have been adjusted from the set of non-edge nodes; Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node to be adjusted in the non-edge node set is adjusted to obtain the updated cost map.

2. The robot of claim 1, wherein, Obtain the first location coordinates of the restricted area, including: Obtain the second coordinates of the obstacle and the third coordinates of the restricted area; The second and third position coordinates are used as the first position coordinates of the prohibited area.

3. The robot of claim 1, wherein, Extracting the edge nodes of the first target region includes: The first target region is dilated to obtain the dilated first target region, and the cost value of each pixel in the dilated first target region is the second generation value. The edge pixels of the first target region after dilation are extracted using the m-neighborhood method, and the edge pixels are identified as edge nodes of the first target region.

4. The robot of claim 1, wherein, The step of adjusting the first-generation values ​​of each non-edge node in the non-edge node set according to the second-generation values ​​of the edge nodes to obtain the updated cost map includes: Determine the distance values ​​between each non-edge node in the set of non-edge nodes and the first target region; Based on the distance values ​​between each non-edge node in the non-edge node set and the first target region, and the second-generation value of the edge node, the first-generation value of each non-edge node in the non-edge node set is adjusted to obtain the updated cost map. The smaller the distance between the non-edge nodes in the non-edge node set and the first target region, the smaller the absolute value of the difference between the first-generation value of the corresponding non-edge node and the second-generation value of the edge node in the adjusted non-edge node set, and the smaller the probability that the robot can pass through the corresponding non-edge node.

5. The robot of claim 4, wherein, Based on the distance values ​​between each non-edge node in the non-edge node set and the first target region, and the second-generation value of the edge nodes, the first-generation value of each non-edge node in the non-edge node set is adjusted, including: Based on the order of distance values ​​between each non-edge node in the non-edge node set and the first target region from smallest to largest, the first-generation values ​​of each non-edge node in the non-edge node set are adjusted exponentially according to the second-generation values ​​of the edge nodes to obtain the updated cost map.

6. The robot of claim 1, wherein, The step of determining the non-edge nodes to be adjusted and the adjusted non-edge nodes from the set of non-edge nodes based on the bitmap values ​​corresponding to each target pixel in the bitmap includes: For each non-edge node in the set of non-edge nodes, if the bitmap value of the target pixel corresponding to the non-edge node is a first preset value, indicating that the first generation value of the non-edge node has not been adjusted, then the non-edge node is determined to be a non-edge node to be adjusted. If the bitmap value of the target pixel corresponding to the non-edge node is a second preset value, indicating that the first-generation value of the non-edge node has been adjusted, then the non-edge node is determined to be an adjusted non-edge node.

7. The robot according to claim 6, characterized in that, The processor, when executing code, is also used to perform the following steps: Based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the non-edge node to be adjusted in the cost map to be updated, the target pixel corresponding to the non-edge node to be adjusted is determined in the bitmap; After adjusting the first-generation value of the non-edge node to be adjusted, the bitmap value of the target pixel is adjusted from the first preset value to the second preset value to obtain the updated bitmap.

8. The robot according to claim 7, characterized in that, After adjusting the bitmap value of the target pixel from a first preset value to a second preset value to obtain the updated bitmap, the processor, when executing code, further implements the following steps: Based on the positional mapping relationship between the bitmap and the cost map to be updated, and the position of the inflated region in the cost map to be updated, a second target region corresponding to the inflated region is determined in the bitmap; Detect whether the bitmap values ​​of all pixels in the second target area have been updated to the second preset value. If the bitmap values ​​of all pixels in the second target area have been updated to the second preset value, it indicates that the update of the cost map to be updated has been completed.

9. A cost map update method, characterized in that, The method includes: Obtain the cost map to be updated in the work area, and obtain the first location coordinates of the prohibited area, wherein each pixel in the cost map to be updated has a corresponding first-generation value; Based on the first location coordinates, a first target area corresponding to the first location coordinates of the prohibited area is identified in the cost map to be updated, and the first generation value of each pixel in the first target area is adjusted to the second generation value, the second generation value being different from the first generation value. Extract the edge nodes of the first target region; Based on the preset expansion radius and the position of the edge nodes in the cost map to be updated, the expansion region is determined in the cost map to be updated. The pixels within the expansion region are identified as non-edge nodes of the edge nodes, thus obtaining a set of non-edge nodes; Obtain a bitmap that matches the cost map to be updated; Based on the positional mapping relationship between the bitmap and the cost map to be updated, the target pixel corresponding to each of the non-edge nodes is determined in the bitmap. Based on the bitmap value corresponding to each target pixel in the bitmap, determine the non-edge nodes to be adjusted and the non-edge nodes that have been adjusted from the set of non-edge nodes; Based on the second-generation value of the edge nodes, the first-generation value of each non-edge node to be adjusted in the non-edge node set is adjusted to obtain the updated cost map.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method of claim 9.