Robot path confirmation method, robot, and storage medium
By equipping the robot with positioning sensors and a pixel index table, the path belonging to the robot's current position can be determined in real time, solving the problem of low efficiency in path confirmation in traditional methods and achieving fast and accurate path confirmation.
Patent Information
- Application Number
- CN202210124136.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-02-10
AI Technical Summary
Traditional methods cannot quickly determine the path a robot belongs to in a multi-path environment, resulting in low path selection efficiency.
By equipping the robot with positioning sensors, the current coordinates are acquired in real time and mapped onto a pixel image map. The path is quickly determined using a preset pixel index table, including finding the pixel index value and matching the target pixel.
It achieves faster and more accurate robot path confirmation, reduces computational complexity, and improves the efficiency of path selection.
Smart Images

Figure CN116619348B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics technology, and in particular to a robot path confirmation method, a robot, and a storage medium. Background Technology
[0002] With the development of science and technology, robots are increasingly being used to replace manual labor in various fields, improving work efficiency and convenience. In practical applications, multiple paths are usually pre-set for robots to choose from, allowing them to reach multiple destinations simultaneously. To manage multiple robots and achieve efficient scheduling or obstacle avoidance, it is necessary to promptly confirm the robot's location and the path it currently belongs to.
[0003] However, robots need to confirm the route they are taking and their corresponding location in real time during movement. The traditional method is to calculate the distance from each point on the map to any path on the map and select the path with the shortest distance as the path to that point's location, which cannot quickly select the appropriate path. Summary of the Invention
[0004] Therefore, it is necessary to provide a robot path confirmation method, a robot, and a computer-readable storage medium that can quickly determine the robot path, in order to address the above-mentioned technical problems.
[0005] In a first aspect, this application provides a robot equipped with a positioning sensor. 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:
[0006] The positioning sensor acquires the robot's current coordinates in a preset map when it is at its current position in real time, and the corresponding pixel coordinates are obtained based on the current coordinates.
[0007] Based on the pixel coordinates, the pixel index value corresponding to the pixel coordinates is obtained;
[0008] The target pixel corresponding to the pixel index value is found in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map;
[0009] Based on the target pixel, determine the path to which the robot's current position belongs from the preset path.
[0010] In one embodiment, obtaining the pixel index value corresponding to the pixel coordinates based on the pixel coordinates includes:
[0011] Determine the pixel size of the pixel image map corresponding to the preset map;
[0012] The pixel index value corresponding to the pixel coordinates is determined based on the pixel coordinates and the pixel size of the pixel image map.
[0013] In one embodiment, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and a preset path in the preset map, including:
[0014] Based on the position of the preset path in the preset map, the first target path of the preset path in the pixel image map corresponding to the preset map is obtained;
[0015] Based on the pixel size of the pixel image map and the coordinates of each pixel in the pixel image map, the pixel index value of each pixel in the pixel image map is obtained;
[0016] Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, the preset pixel index table is created by assigning each pixel in the pixel image map to the corresponding target path in the first target path.
[0017] In one embodiment, the step of creating the preset pixel index table by assigning each pixel in the pixel image map to the corresponding target path in the first target path according to a first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map includes:
[0018] The first target path is divided into N segments according to a preset length to obtain the position of each of the (N+1) nodes on the first target path; based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path, the node pixel coordinates corresponding to each of the (N+1) nodes on the first target path are determined.
[0019] Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, each pixel in the pixel image map is assigned to the corresponding node among the (N+1) nodes on the first target path, thereby obtaining a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table.
[0020] In one embodiment, the step of assigning each pixel in the pixel image map to a corresponding node among the (N+1) nodes on the first target path according to a first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates corresponding to each node among the (N+1) nodes on the first target path in the pixel image map, to obtain a multi-class pixel set corresponding to each node among the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table, includes:
[0021] Based on the pixel size of the pixel image map and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, determine the node pixel index value corresponding to each of the (N+1) nodes on the first target path.
[0022] Taking the pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map as the center, each pixel in the pixel image map is classified according to the distance between each pixel in the pixel image map and each of the (N+1) nodes on the first target path, so as to obtain a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path.
[0023] The preset pixel index table is created based on the pixel index value of each pixel in the multi-class pixel set corresponding to each of the (N+1) nodes on the first target path.
[0024] In one embodiment, determining the path to which the robot's current position belongs from the preset path based on the target pixel includes:
[0025] The set of pixels closest to the corresponding node in the multi-class pixel set corresponding to each node is used as the candidate pixel set;
[0026] If the candidate pixel set contains a candidate pixel set with the same pixel index value as the target pixel, then the candidate pixel set with the same pixel index value as the target pixel is taken as the target pixel set;
[0027] Based on the target pixel set, determine the path to which the robot's current position belongs from the preset path;
[0028] If there is no candidate pixel set with the same pixel index value as the target pixel in the candidate pixel set, then the pixel set that is second closest to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set, until a candidate pixel set with the same pixel index value as the target pixel is determined in the candidate pixel set.
[0029] In one embodiment, determining the path to which the robot's current position belongs from the preset path based on the target pixel set includes:
[0030] If the target pixel set is a single node, then the node corresponding to the target pixel set is used as the target node.
[0031] If the target pixel set consists of two or more objects, then any one of the target pixel sets corresponding to a node is selected as the target node.
[0032] The first target path corresponding to the target node in the first target path is taken as the undetermined target path to which the robot's current position belongs; the preset path corresponding to the undetermined target path to which the robot's current position belongs in the preset path is taken as the path to which the robot's current position belongs.
[0033] In one embodiment, obtaining the corresponding pixel coordinates based on the current coordinates includes:
[0034] Obtain the preset map including the current coordinates, and scale down the preset map to the pixel image map according to a preset ratio;
[0035] Based on the current coordinates and the preset ratio, determine the target position on the pixel image corresponding to the current coordinates;
[0036] Based on the target position and pixel coordinate system on the pixel image, the pixel coordinates on the pixel image corresponding to the current coordinates are obtained.
[0037] Secondly, this application also provides a robot path confirmation method. The method includes:
[0038] The robot's current coordinates in a preset map are obtained in real time when it is at its current position, and the corresponding pixel coordinates are obtained based on the current coordinates.
[0039] Based on the pixel coordinates, the pixel index value corresponding to the pixel coordinates is obtained;
[0040] The target pixel corresponding to the pixel index value is found in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map;
[0041] Based on the target pixel, determine the path to which the robot's current position belongs from the preset path.
[0042] Thirdly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the following steps:
[0043] The robot's current coordinates in a preset map are obtained in real time when it is at its current position, and the corresponding pixel coordinates are obtained based on the current coordinates.
[0044] Based on the pixel coordinates, the pixel index value corresponding to the pixel coordinates is obtained;
[0045] The target pixel corresponding to the pixel index value is found in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map;
[0046] Based on the target pixel, determine the path to which the robot's current position belongs from the preset path.
[0047] The aforementioned robot path confirmation method, robot, and storage medium include a robot equipped with a positioning sensor, a memory, and a processor. The processor uses the positioning sensor to acquire the robot's current coordinates in a preset map at its current position in real time. Based on these coordinates, it obtains the corresponding pixel coordinates; based on the pixel coordinates, it obtains the pixel index value corresponding to the pixel coordinates; it searches for the target pixel corresponding to the pixel index value in a preset pixel index table; and based on the target pixel, it determines the path to which the robot's current position belongs from a preset path. The preset pixel index table is determined based on a pixel image map corresponding to the preset map and preset paths within the preset map. This application achieves rapid path confirmation by mapping the robot's preset coordinates in the preset map to pixel coordinates on the corresponding pixel image map, obtaining the pixel index value from the pixel coordinates, searching for the target pixel corresponding to the pixel index value in the preset pixel index table, and determining the path to which the robot's current position belongs based on the target pixel. Attached Figure Description
[0048] Figure 1 This is an application environment diagram of a robot path confirmation method in one embodiment;
[0049] Figure 2 This is a flowchart illustrating a robot path confirmation method in one embodiment;
[0050] Figure 3 This is a flowchart illustrating step 204 in one embodiment;
[0051] Figure 4 This is a flowchart illustrating step 206 in one embodiment;
[0052] Figure 5 This is a flowchart illustrating step 406 in one embodiment;
[0053] Figure 6 This is a flowchart illustrating step 504 in one embodiment;
[0054] Figure 7 This is a flowchart illustrating step 208 in one embodiment;
[0055] Figure 8 This is a flowchart illustrating step 706 in one embodiment;
[0056] Figure 9 This is a flowchart illustrating step 202 in one embodiment;
[0057] Figure 10 This is a schematic diagram illustrating the conversion of a preset map into a pixel image map in one embodiment;
[0058] Figure 11 This is a flowchart illustrating the robot path confirmation method in another embodiment;
[0059] Figure 12 This is a structural block diagram of a robot path confirmation device in one embodiment. Detailed Implementation
[0060] 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.
[0061] The robot path confirmation method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown is illustrated. The robot includes a memory 102, a processor 104, and sensors 106. The memory 102 stores executable program code 108 and is connected to and communicates with the processor 104. Sensors 108, including a positioning sensor, transmit acquired sensing data to the processor 104. The processor 104 provides computational and control capabilities, executing the executable program code 108 to implement a robot path confirmation method.
[0062] It will be understood by those skilled in the art that Figure 1 The 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 robot to which the present application is applied. A specific robot may include more or fewer parts than shown in the figure, or combine certain parts, or have different part arrangements.
[0063] In one embodiment, such as Figure 2 As shown, a robot path confirmation method is provided, which is applied to... Figure 1 Taking the processor in the example, the following steps are included:
[0064] Step 202: Obtain the robot's current coordinates in the preset map when it is at its current position in real time, and obtain the corresponding pixel coordinates based on the current coordinates.
[0065] The robot is equipped with positioning sensors that can acquire real-time position and attitude data during its movement. The processor uses these sensors to obtain the robot's current coordinates on a pre-defined map, and then calculates the corresponding pixel coordinates. In specific applications, the geographical area that the robot's movement might involve is used as the pre-defined map, and the robot's position within this map is represented by its current coordinates. However, the pre-defined map is often quite large in real-world scenarios, making direct calculations difficult. Therefore, it can be scaled down to a corresponding pixel image map. Calculating and processing the robot's movement data on this pixel image map reduces computational complexity. The current coordinates on the pre-defined map correspond to the pixel coordinates on the pixel image map; in other words, the current coordinates and pixel coordinates are directly correlated.
[0066] Step 204: Obtain the pixel index value corresponding to the pixel coordinates.
[0067] The pixel index value corresponding to a pixel coordinate is obtained from the pixel coordinates in the pixel image map. Specifically, the pixel index value can be determined based on the pixel coordinates and the pixel size corresponding to those coordinates. In other words, for any pixel O corresponding to any point in the pixel image map, the pixel coordinates of pixel O and the size of pixel O in the corresponding pixel coordinate direction can be obtained. Based on the pixel coordinates and the size of pixel O in the pixel coordinate direction, the pixel index value of pixel O can be obtained.
[0068] Step 206: Search for the target pixel corresponding to the pixel index value in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map.
[0069] In this embodiment, a preset pixel index table is first established. This table is determined based on a pixel image map corresponding to a preset map and preset paths within that map. The corresponding paths in the pixel image map for the preset paths in the preset map can be used as pixel paths. The preset pixel index table is then determined based on these pixel paths and the pixel image map. The preset pixel index table includes all pixels in the pixel image map, their corresponding pixel coordinates, and pixel index values. A target pixel corresponding to the pixel index value is then searched within the preset pixel index table. Specifically, the target pixel corresponding to the pixel index value can be searched within a preset range in the preset pixel index table in a preset order. First, the preset pixel index table is checked to see if there is a target pixel index value that matches the given pixel index value. If so, the pixel corresponding to that target pixel index value is taken as the target pixel. In an optional implementation, a target pixel index value that matches the given pixel index value can also be searched sequentially throughout the entire preset pixel index table. If a target pixel index value is found, the pixel corresponding to that target pixel index value is taken as the target pixel.
[0070] Step 208: Determine the path to which the robot's current position belongs from the preset paths based on the target pixel.
[0071] The processor determines the path to which the robot's current position belongs based on the target pixel. In the pixel image map, the path formed by the position corresponding to the preset path in the preset map is called the pixel path. A target pixel may pass through one or more pixel paths, and it is considered that the target pixel belongs to one or more corresponding pixel paths. The pixel path to which the target pixel belongs is taken as the path to which the robot's current coordinates belong in the preset map. The processor also determines the preset path corresponding to the pixel path from the preset paths, thereby determining the path to which the robot's current position belongs.
[0072] The aforementioned robot path confirmation method acquires the robot's current coordinates on a preset map in real time, obtains the corresponding pixel coordinates based on the current coordinates, obtains the pixel index value corresponding to the pixel coordinates, searches for the target pixel corresponding to the pixel index value in a preset pixel index table, and determines the path to which the robot's current position belongs from a preset path based on the target pixel. The preset pixel index table is determined based on the pixel image map corresponding to the preset map and preset paths within the preset map. This embodiment of the application maps the robot's preset coordinates on the preset map to pixel coordinates on the corresponding pixel image map, obtains the pixel index value from the pixel coordinates, searches for the target pixel corresponding to the pixel index value in the preset pixel index table, and determines the path to which the robot's current position belongs from the preset path based on the target pixel, thus enabling rapid confirmation of the path to which the robot's current position belongs.
[0073] In one embodiment, such as Figure 3 As shown, in step 204, the pixel index value corresponding to the pixel coordinates is obtained based on the pixel coordinates, including:
[0074] Step 302: Determine the pixel size of the pixel image map corresponding to the preset map.
[0075] Based on the image information of the pixel image map, the pixel size of the pixel image map corresponding to the preset map is determined. The image information of the pixel image map includes its resolution and size. Generally, the image information of the pixel image map is preset, and the preset map is processed using appropriate methods based on this preset image information to obtain the pixel image map with the preset image information.
[0076] Step 304: Determine the pixel index value corresponding to the pixel coordinates based on the pixel coordinates and the pixel size of the pixel image map.
[0077] In this embodiment, the pixel index value corresponding to the pixel coordinate can be determined based on the pixel coordinate and the pixel size of the pixel image map in the pixel coordinate direction.
[0078] In one possible implementation, the pixel index value corresponding to the pixel coordinates is determined based on the pixel size of the pixel image map in one of the coordinate directions. For example, for a pixel O in the pixel image map, if the pixel coordinates of pixel O are (x, y), then the pixel index value I corresponding to the pixel coordinates (x, y) is: I = x * W + y;
[0079] Where W is the pixel size of the pixel image map in the x-direction.
[0080] In one embodiment, such as Figure 4 As shown, the preset pixel index table in step 206 is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map, including:
[0081] Step 402: Based on the position of the preset path in the preset map, obtain the first target path in the pixel image map corresponding to the preset map.
[0082] The position corresponding to the trajectory of the preset path in the preset map is mapped to the pixel map using the method of transforming the preset map to a pixel image map, thus obtaining the first target path in the pixel map.
[0083] Step 404: Based on the pixel size of the pixel image map and the coordinates of each pixel in the pixel image map, obtain the pixel index value of each pixel in the pixel image map.
[0084] In this embodiment, the pixel index value of each pixel in the pixel image map is obtained based on the pixel size of the pixel image map and the coordinates of each pixel in the pixel image map. The specific process can be referred to the content described in step 304 above, and will not be repeated here.
[0085] Step 406: Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, the preset pixel index table is created by assigning each pixel in the pixel image map to the corresponding target path in the first target path.
[0086] In this embodiment, the preset pixel index table includes a first target path, pixel coordinates in the pixel image map, and pixel index values corresponding to the pixel coordinates. Based on a first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, the preset pixel index table is created by assigning each pixel in the pixel image map to the corresponding target path in the first target path. The first preset rule includes the format and representation of the preset pixel index table, etc., which are not specifically limited here. During the creation of the preset pixel index table, each first target path is selected sequentially. For each first target path, pixels in the corresponding pixel image map are assigned to the first target path based on the distance relationship between the first target path and each pixel in the pixel image map. Therefore, in the preset pixel index table, each first target path corresponds to several pixels in the pixel image map.
[0087] In one embodiment, such as Figure 5 As shown, step 406, which involves creating a preset pixel index table by assigning each pixel in the pixel image map to the corresponding target path in the first target path, according to the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, includes:
[0088] Step 502: Divide the first target path into N segments according to a preset length to obtain the position of each of the (N+1) nodes on the first target path. Based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path, determine the corresponding node pixel coordinates in the pixel image map for each of the (N+1) nodes on the first target path.
[0089] In this embodiment, the first target path can be divided into N equal segments according to a preset length, or it can be divided into N unequal segments, depending on the actual application scenario. This yields the position of each of the (N+1) nodes on the first target path. Based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path, the corresponding pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map are determined. A node can be understood as the dividing point between two adjacent segments after the first target path is divided into N segments according to the preset length. A node also includes the start and end points of the first target path. Based on the position of each of the (N+1) nodes on the first target path and the coordinate system established in the pixel image map, the corresponding pixel coordinates of each node on the first target path can be obtained.
[0090] Step 504: Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the corresponding node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, assign each pixel in the pixel image map to the corresponding node among the (N+1) nodes on the first target path, thereby obtaining a multi-class pixel set corresponding to each of the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table.
[0091] In this embodiment, the preset pixel index table includes pixels in the pixel image map, the pixel index value corresponding to each pixel, and the pixel coordinates of the nodes. According to a first preset rule, each pixel in the pixel image map is assigned to a corresponding node among (N+1) nodes on the first target path. Each node has multiple corresponding pixels in the pixel image map; for each pixel in the pixel image map, it may be assigned to multiple nodes simultaneously. Specifically, the assignment can be based on the distance between the pixel in the pixel image map and each node. For example, pixels whose distance to a node is within a corresponding preset distance are assigned to that node.
[0092] In one embodiment, such as Figure 6 As shown, based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the corresponding node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, each pixel in the pixel image map is assigned to the corresponding node among the (N+1) nodes on the first target path, resulting in a multi-class pixel set corresponding to each of the (N+1) nodes on the first target path. This completes step 504 of creating the preset pixel index table, including:
[0093] Step 602: Based on the pixel size of the pixel image map and the corresponding node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, determine the node pixel index value corresponding to each of the (N+1) nodes on the first target path.
[0094] The first target path and its (N+1) nodes are all located on the pixel image map. After obtaining the node pixel coordinates of the corresponding (N+1) nodes, the node pixel index value can be determined based on the node pixel coordinates and the pixel size of the pixel image map. The pixel index value corresponding to each node is obtained in the same way. The specific execution process can be found in step 304 above, and will not be repeated here.
[0095] Step 604: Taking the node pixel coordinates corresponding to each of the (N+1) nodes on the first target path as the center, classify each pixel in the pixel image map according to the distance between each pixel in the pixel image map and each of the (N+1) nodes on the first target path, and obtain a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path.
[0096] In this embodiment, taking the node pixel coordinates corresponding to each of the (N+1) nodes on the first target path as the center, each pixel in the pixel image map is classified according to the distance between each pixel and each node in the pixel image map, so as to obtain a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path.
[0097] In one optional implementation, the (N+1) nodes on the first target path are {D1, D2, ..., D...} N D N+1 Let's take the first node D1 as an example; the other nodes are executed in the same way. The pixel coordinates (D1, D2, D3, D4) of the first node D1 are used as an example. 1x D 1y Centered on a pixel image map, each pixel is classified according to its distance from the first node D1. For example, pixels within a first preset distance from the first node D1 are classified into one type of pixel set, pixels within a second preset distance from the first node D1 are classified into two types of pixel sets, where the first preset distance is less than the second preset distance, and so on, resulting in multiple types of pixel sets corresponding to the first node D1. In this embodiment, the specific number of multiple types of pixel sets is set according to the specific situation; generally, the number of multiple types of pixel sets is greater than or equal to 1.
[0098] Step 606: Create a preset pixel index table based on the pixel index value of each pixel in the multi-class pixel set corresponding to each of the (N+1) nodes on the first target path.
[0099] In this embodiment, the preset pixel index table includes (N+1) nodes on the first target path, a set of multiple pixel types corresponding to each node, and the pixel index value corresponding to each pixel in each pixel set. The creation rules for the preset pixel index table are not specifically limited.
[0100] In one embodiment, such as Figure 7 As shown, step 208, determining the path to which the robot's current position belongs from the preset path based on the target pixel, includes:
[0101] Step 702: Select the set of pixels closest to the corresponding node from the set of pixels of the multi-class pixels corresponding to each node as the candidate pixel set.
[0102] In this embodiment, the set of pixels closest to each of the (N+1) nodes on the first target path is selected as the candidate pixel set from the multi-class pixel sets corresponding to each node. This means that, given the same method for dividing the multi-class pixel sets for each node, the pixel sets of the same class within each node are selected as the candidate pixel set. For example, if in each node's multi-class pixel sets, only one class of pixels is closest to the corresponding node, then only that class of pixels is selected as the candidate pixel set. Accordingly, since there are (N+1) nodes on the first target path, there are (N+1) pixel sets closest to each of the (N+1) nodes as the candidate pixel set.
[0103] Step 704: If there is a set of candidate pixels in the candidate pixel set that has the same pixel index value as the target pixel, then the set of candidate pixels in the candidate pixel set that has the same pixel index value as the target pixel is taken as the target pixel set.
[0104] In this embodiment, if there is a pixel in the (N+1) candidate pixel set that has the same pixel index value as the target pixel, then the candidate pixel set containing that pixel is taken as the target pixel set.
[0105] Step 706: Determine the path to which the robot's current position belongs from the preset paths based on the target pixel set.
[0106] In this embodiment, the target pixel set includes one or more, and the path to which the robot's current position belongs can be determined based on any one of the target pixel sets.
[0107] Step 708: If there is no candidate pixel set with the same pixel index value as the target pixel in the candidate pixel set, then the second closest pixel set to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set, until a candidate pixel set with the same pixel index value as the target pixel is determined in the candidate pixel set.
[0108] In this embodiment, if no pixel in the candidate pixel set has the same pixel index value as the target pixel, then the set of pixels in the multi-class pixel set corresponding to each node that is second closest to the corresponding node is taken as the candidate pixel set. In this way, it is searched in the candidate pixel set to see if the pixel index value of the corresponding pixel is the same as the pixel index value of the target pixel. Similarly, the set of pixels in the multi-class pixel set corresponding to each node that is third closest, fourth closest, etc., to the corresponding node can be taken as the candidate pixel set, until a candidate pixel set with the same pixel index value as the target pixel is determined.
[0109] In one embodiment, such as Figure 8 As shown, step 706, which determines the path to which the robot's current position belongs from a preset path based on the target pixel set, includes:
[0110] Step 802: If the target pixel set is a single set, then the node corresponding to the target pixel set is used as the target node.
[0111] Step 804: If there are two or more target pixel sets, then select any node corresponding to one of the target pixel sets as the target node.
[0112] Step 806: The first target path corresponding to the target node in the first target path is taken as the pending target path to which the robot's current position belongs; the preset path corresponding to the pending target path to which the robot's current position belongs in the preset path is taken as the path to which the robot's current position belongs.
[0113] In this embodiment, when there is only one target pixel set, the node corresponding to the target pixel set is used as the target node; when there are two or more target pixel sets, one node corresponding to any target pixel set is randomly selected as the target node, or the node corresponding to the first determined target pixel set can be used as the target node according to the execution order. The first target path corresponding to the target node in the first target path is used as the pending target path to which the robot's current position belongs. The preset path in the corresponding preset map is obtained based on the target path, and the preset path corresponding to the pending target path in the preset path is used as the path to which the robot's current position belongs. The robot can then perform subsequent movement or obstacle avoidance processing based on the path to which its current position belongs.
[0114] In one embodiment, such as Figure 9 As shown, step 202, obtaining the corresponding pixel coordinates based on the current coordinates, includes:
[0115] Step 902: Obtain a preset map including the current coordinates, and scale down the preset map to a pixel image map according to a preset ratio.
[0116] Step 904: Determine the target location on the pixel image map corresponding to the current coordinates based on the current coordinates and the preset scale.
[0117] Step 906: Based on the target location and pixel coordinate system on the pixel image map, obtain the pixel coordinates on the pixel image corresponding to the current coordinates.
[0118] In this embodiment, a preset map including the robot's current coordinates is obtained; the preset map is then scaled down to a corresponding pixel image map according to a preset ratio; based on the current coordinates and the preset ratio, the target position on the pixel image map corresponding to the current coordinates is obtained; and based on the target position on the pixel image map and the pixel coordinate system, the pixel coordinates on the pixel image corresponding to the current position are obtained. In a specific example, such as... Figure 10 As shown, image A is a preset map, i.e., the robot moves in image A, and image B is a pixel image map. Image A is scaled down to image B by a preset ratio. If the robot's current position in image A is Q, the position Q' corresponding to position Q in image B is obtained according to the preset ratio. According to the pixel coordinate system in image B, the pixel coordinates corresponding to position Q' can be obtained.
[0119] In one embodiment, such as Figure 11 As shown, the robot path confirmation method includes:
[0120] Step 1102: The current coordinates of the robot in the preset map when it is at its current position are obtained in real time through the positioning sensor, and the corresponding pixel coordinates are obtained based on the current coordinates.
[0121] The robot obtains its current coordinates on a preset map when it is in its current position using a positioning sensor. Based on these current coordinates, the corresponding pixel coordinates are obtained. The pixel coordinates are coordinates on a pixel image map. The preset map is scaled down to the corresponding pixel image map according to a preset ratio.
[0122] Step 1104: Obtain the pixel index value corresponding to the pixel coordinates based on the pixel coordinates and the pixel size of the pixel image map in the pixel coordinate direction.
[0123] The pixel index value corresponding to a pixel coordinate can be determined based on the pixel coordinates and the pixel size of the pixel image map in one of the coordinate directions. For example, for a pixel O in the pixel image map, the pixel coordinates of pixel O are (x, y), then the pixel index value I corresponding to the pixel coordinates (x, y) is: I = x * W + y; where W is the pixel size of the pixel image map in the x direction.
[0124] Step 1106: Based on the position of the preset path in the preset map, obtain the first target path in the pixel map corresponding to the preset path in the preset map.
[0125] The preset map contains multiple preset paths. Based on the position of the preset path in the preset map, the first target path corresponding to the preset path in the pixel image map can be obtained.
[0126] Step 1108: Divide the first target path into N segments according to a preset length to obtain the position of each of the (N+1) nodes on the first target path. Based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path, determine the corresponding node pixel coordinates in the pixel image map for each of the (N+1) nodes on the first target path.
[0127] In the pixel image map, the first target path is divided into N segments according to a preset length, and the position of each of the (N+1) nodes on the first target path is obtained. According to the coordinate system established in the pixel image map, the node pixel coordinates corresponding to each node in the pixel image map are obtained.
[0128] Step 1110: Taking the node pixel coordinates corresponding to each of the (N+1) nodes on the first target path as the center, classify each pixel in the pixel image map according to the distance between each pixel in the pixel image map and each of the (N+1) nodes on the first target path, and obtain a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path.
[0129] Taking one node as an example, using the node's pixel coordinates as the center, each pixel in the pixel image map is classified according to its distance from the node. Pixels within a first preset distance from the node can be classified into one set, pixels within a second preset distance can be classified into two sets, and so on. This yields multiple sets of pixels corresponding to the node. The same logic applies to other nodes.
[0130] Step 1112: Take the set of pixels that are closest to the corresponding node in order of distance from the corresponding node in the multi-class pixel set corresponding to each node as the candidate pixel set, until a candidate pixel set corresponding to the pixel index value is determined in the candidate pixel set, and then take it as the target pixel set.
[0131] First, the set of pixels closest to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set. If there is a pixel with the same pixel index value in the candidate pixel set, then the candidate set corresponding to that pixel is the target pixel set. If there is no pixel with the same pixel index value in the set of pixels closest to the corresponding node in the multi-class pixel set corresponding to each node, then the set of pixels second closest to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set. This process continues until there is a pixel with the same pixel index value in the candidate pixel set. That is, the target pixel set is determined from the candidate pixel set.
[0132] Step 1114: Take the node corresponding to the target pixel set as the target node, take the first target path corresponding to the target node in the first target path as the undetermined target path to which the robot's current position belongs, and take the preset path corresponding to the undetermined target path in the preset path as the path to which the robot's current position belongs.
[0133] The node corresponding to the target pixel set is taken as the target node, the first target path corresponding to the target node in the first target path is taken as the undetermined target path to which the robot's current position belongs, and the preset path corresponding to the undetermined target path in the preset path is taken as the path to which the robot's current position belongs.
[0134] It should be understood that although the steps in the flowcharts of the embodiments described above 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 embodiments described above 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.
[0135] Based on the same inventive concept, this application also provides a robot path confirmation device for implementing the robot path confirmation method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more robot path confirmation device embodiments provided below can be found in the limitations of the robot path confirmation method described above, and will not be repeated here.
[0136] In one embodiment, such as Figure 12 As shown, a robot path confirmation device is provided, including a coordinate acquisition module 1202, a pixel index module 1204, a target pixel module 1206, and a path attribution module 1208, wherein:
[0137] The coordinate acquisition module 1202 is used to acquire the current coordinates of the robot in the preset map when it is at its current position in real time through the positioning sensor, and to obtain the corresponding pixel coordinates based on the current coordinates.
[0138] The pixel index module 1204 is used to obtain the pixel index value corresponding to the pixel coordinates based on the pixel coordinates.
[0139] The target pixel module 1206 searches for the target pixel corresponding to the pixel index value in a preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and a preset path in the preset map;
[0140] The path attribution module 1208 is used to determine the path to which the robot's current position belongs from a preset path based on the target pixel.
[0141] In one embodiment, the pixel indexing module 1204 is further configured to:
[0142] Determine the pixel size of the pixel image map corresponding to the preset map;
[0143] The pixel index value corresponding to the pixel coordinates is determined based on the pixel coordinates and the pixel size of the pixel image map.
[0144] In one embodiment, the target pixel module 1206 includes:
[0145] The target path unit is used to obtain the first target path of the preset path in the pixel image map corresponding to the preset map based on the position of the preset path in the preset map.
[0146] A pixel index unit is used to obtain the pixel index value of each pixel in the pixel image map based on the pixel size of the pixel image map and the coordinates of each pixel in the pixel image map.
[0147] The index table creation unit is used to create the preset pixel index table by assigning each pixel in the pixel image map to the corresponding target path in the first target path according to the first preset rule, the pixel index value of each pixel in the pixel image map and the position of the first target path in the pixel image map.
[0148] In one embodiment, the index table creation unit is also used for:
[0149] The first target path is divided into N segments according to a preset length, and the position of each of the (N+1) nodes on the first target path is obtained. Based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path, the corresponding node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map are determined.
[0150] Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, each pixel in the pixel image map is assigned to the corresponding node among the (N+1) nodes on the first target path, thereby obtaining a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table.
[0151] In one embodiment, the index table creation unit is also used for:
[0152] Based on the pixel size of the pixel image map and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, determine the node pixel index value corresponding to each of the (N+1) nodes on the first target path.
[0153] Taking the pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map as the center, each pixel in the pixel image map is classified according to the distance between each pixel in the pixel image map and each of the (N+1) nodes on the first target path, so as to obtain a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path.
[0154] The preset pixel index table is created based on the pixel index value of each pixel in the multi-class pixel set corresponding to each of the (N+1) nodes on the first target path.
[0155] In one embodiment, the path attribution module 1208 is further configured to:
[0156] The set of pixels closest to the corresponding node in the multi-class pixel set corresponding to each node is used as the candidate pixel set;
[0157] If the candidate pixel set contains a candidate pixel set with the same pixel index value as the target pixel, then the candidate pixel set with the same pixel index value as the target pixel is taken as the target pixel set;
[0158] Based on the target pixel set, determine the path to which the robot's current position belongs from the preset path;
[0159] If there is no candidate pixel set with the same pixel index value as the target pixel in the candidate pixel set, then the pixel set that is second closest to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set, until a candidate pixel set with the same pixel index value as the target pixel is determined in the candidate pixel set.
[0160] In one embodiment, the path attribution module 1208 is further configured to:
[0161] If the target pixel set is a single node, then the node corresponding to the target pixel set is used as the target node.
[0162] If the target pixel set consists of two or more objects, then any one of the target pixel sets corresponding to a node is selected as the target node.
[0163] The first target path corresponding to the target node in the first target path is taken as the undetermined target path to which the robot's current position belongs; the preset path corresponding to the undetermined target path to which the robot's current position belongs in the preset path is taken as the path to which the robot's current position belongs.
[0164] In one embodiment, the coordinate acquisition module 1202 is further configured to:
[0165] Obtain the preset map including the current coordinates, and scale down the preset map to the pixel image map according to a preset ratio;
[0166] Based on the current coordinates and the preset ratio, determine the target position on the pixel image corresponding to the current coordinates;
[0167] Based on the target position and pixel coordinate system on the pixel image, the pixel coordinates on the pixel image corresponding to the current coordinates are obtained.
[0168] Each module in the aforementioned robot path confirmation 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.
[0169] In one embodiment, a robot is provided, equipped with positioning sensors. 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:
[0170] The positioning sensor acquires the robot's current coordinates in a preset map when it is at its current position in real time, and the corresponding pixel coordinates are obtained based on the current coordinates.
[0171] Based on the pixel coordinates, the pixel index value corresponding to the pixel coordinates is obtained;
[0172] The target pixel corresponding to the pixel index value is found in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map;
[0173] Based on the target pixel, determine the path to which the robot's current position belongs from the preset path.
[0174] The robot described above acquires its current coordinates on a preset map in real time using positioning sensors. Based on these coordinates, it obtains the corresponding pixel coordinates; based on the pixel coordinates, it obtains the pixel index value; and it searches for the target pixel corresponding to the pixel index value in a preset pixel index table. The preset pixel index table is determined based on a pixel image map corresponding to the preset map and preset paths within the preset map. Based on the target pixel, it determines the path to which the robot's current position belongs from the preset paths. This embodiment of the application enables the robot to quickly confirm the path to which its current position belongs.
[0175] In one embodiment, the processor further performs the following steps when executing executable program code:
[0176] The step of obtaining the pixel index value corresponding to the pixel coordinates based on the pixel coordinates includes:
[0177] Determine the pixel size of the pixel image map corresponding to the preset map;
[0178] The pixel index value corresponding to the pixel coordinates is determined based on the pixel coordinates and the pixel size of the pixel image map.
[0179] In one embodiment, the processor further performs the following steps when executing executable program code:
[0180] The preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map, including:
[0181] Based on the position of the preset path in the preset map, the first target path of the preset path in the pixel image map corresponding to the preset map is obtained;
[0182] Based on the pixel size of the pixel image map and the coordinates of each pixel in the pixel image map, the pixel index value of each pixel in the pixel image map is obtained;
[0183] Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, the preset pixel index table is created by assigning each pixel in the pixel image map to the corresponding target path in the first target path.
[0184] In one embodiment, the processor further performs the following steps when executing executable program code:
[0185] The step of creating the preset pixel index table by assigning each pixel in the pixel image map to the corresponding target path in the first target path, based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, includes:
[0186] The first target path is divided into N segments according to a preset length, and the position of each of the (N+1) nodes on the first target path is obtained. Based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path, the corresponding node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map are determined.
[0187] Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, each pixel in the pixel image map is assigned to the corresponding node among the (N+1) nodes on the first target path, thereby obtaining a set of multiple types of pixels corresponding to each of the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table.
[0188] In one embodiment, the processor further performs the following steps when executing executable program code:
[0189] The step of assigning each pixel in the pixel image map to a corresponding node among the (N+1) nodes on the first target path according to a first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates of each node among the (N+1) nodes on the first target path in the pixel image map, to obtain a multi-class pixel set corresponding to each node among the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table, includes:
[0190] Based on the pixel size of the pixel image map and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, determine the node pixel index value corresponding to each of the (N+1) nodes on the first target path.
[0191] Centered on the pixel coordinates of each of the (N+1) nodes on the first target path, each pixel in the pixel image map is classified according to the distance between each pixel in the pixel image map and each of the (N+1) nodes on the first target path, thus obtaining a set of multiple pixel types corresponding to each of the (N+1) nodes on the first target path.
[0192] The preset pixel index table is created based on the pixel index value of each pixel in the multi-class pixel set corresponding to each of the (N+1) nodes on the first target path.
[0193] In one embodiment, the processor further performs the following steps when executing executable program code:
[0194] The step of determining the path to which the robot's current position belongs from a preset path based on the target pixel includes:
[0195] The set of pixels closest to the corresponding node in the multi-class pixel set corresponding to each node is used as the candidate pixel set;
[0196] If the candidate pixel set contains a candidate pixel set with the same pixel index value as the target pixel, then the candidate pixel set with the same pixel index value as the target pixel is taken as the target pixel set;
[0197] Based on the target pixel set, determine the path to which the robot's current position belongs from the preset paths;
[0198] If there is no candidate pixel set with the same pixel index value as the target pixel in the candidate pixel set, then the pixel set that is second closest to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set, until a candidate pixel set with the same pixel index value as the target pixel is determined in the candidate pixel set.
[0199] In one embodiment, the processor further performs the following steps when executing executable program code:
[0200] Based on the target pixel set, determining the path to which the robot's current position belongs from a preset path includes:
[0201] If the target pixel set is a single node, then the node corresponding to the target pixel set is used as the target node.
[0202] If the target pixel set consists of two or more objects, then any one of the target pixel sets corresponding to a node is selected as the target node.
[0203] The first target path corresponding to the target node in the first target path is taken as the undetermined target path to which the robot's current position belongs; the preset path corresponding to the undetermined target path to which the robot's current position belongs is taken as the path to which the robot's current position belongs.
[0204] In one embodiment, the processor further performs the following steps when executing executable program code:
[0205] The step of obtaining the corresponding pixel coordinates based on the current coordinates includes:
[0206] Obtain the preset map including the current coordinates, and scale down the preset map to the pixel image map according to a preset ratio;
[0207] Based on the current coordinates and the preset ratio, determine the target position on the pixel image corresponding to the current coordinates;
[0208] Based on the target position and pixel coordinate system on the pixel image, the pixel coordinates on the pixel image corresponding to the current coordinates are obtained.
[0209] The steps implemented by the processor in the robot when executing the executable program code in the above embodiments can be referred to the description in the above robot path confirmation method embodiments, and will not be repeated here.
[0210] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method embodiments.
[0211] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method embodiments.
[0212] 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.
[0213] 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.
[0214] 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 is equipped with positioning sensors and 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: The positioning sensor obtains the robot's current coordinates in a preset map when it is at its current position in real time, and obtains the preset map including the current coordinates. The preset map is then scaled down to a pixel image map according to a preset ratio. Based on the current coordinates and the preset ratio, determine the target location on the pixel image map corresponding to the current coordinates; Based on the target location and pixel coordinate system on the pixel image map, obtain the pixel coordinates on the pixel image map corresponding to the current coordinates; Based on the pixel coordinates, the pixel index value corresponding to the pixel coordinates is obtained; The target pixel corresponding to the pixel index value is found in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map; Based on the target pixel, determine the path to which the robot's current position belongs from the preset path.
2. The robot according to claim 1, characterized in that, The step of obtaining the pixel index value corresponding to the pixel coordinates based on the pixel coordinates includes: Determine the pixel size of the pixel image map corresponding to the preset map; The pixel index value corresponding to the pixel coordinates is determined based on the pixel coordinates and the pixel size of the pixel image map.
3. The robot according to claim 1, characterized in that, The preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map, including: Based on the position of the preset path in the preset map, the first target path of the preset path in the pixel image map corresponding to the preset map is obtained; Based on the pixel size of the pixel image map and the coordinates of each pixel in the pixel image map, the pixel index value of each pixel in the pixel image map is obtained; Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, the preset pixel index table is created by assigning each pixel in the pixel image map to the corresponding target path in the first target path.
4. The robot according to claim 3, characterized in that, The step of creating the preset pixel index table by assigning each pixel in the pixel image map to the corresponding target path in the first target path, based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the position of the first target path in the pixel image map, includes: The first target path is divided into N segments according to a preset length, and the position of each of the (N+1) nodes on the first target path is obtained. Based on the position of the first target path in the pixel image map and the position of each of the (N+1) nodes on the first target path on the first target path, determine the corresponding node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map; Based on the first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates of each node in the (N+1) nodes on the first target path in the pixel image map, each pixel in the pixel image map is assigned to the corresponding node in the (N+1) nodes on the first target path, thereby obtaining a set of multiple types of pixels corresponding to each node in the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table.
5. The robot according to claim 4, characterized in that, The step of assigning each pixel in the pixel image map to a corresponding node among the (N+1) nodes on the first target path according to the first preset rule, the pixel index value of each pixel in the pixel image map, and the node pixel coordinates corresponding to each node among the (N+1) nodes on the first target path in the pixel image map, to obtain a multi-class pixel set corresponding to each node among the (N+1) nodes on the first target path, and completing the creation of the preset pixel index table, includes: Based on the pixel size of the pixel image map and the node pixel coordinates of each of the (N+1) nodes on the first target path in the pixel image map, determine the node pixel index value corresponding to each of the (N+1) nodes on the first target path. Centered on the pixel coordinates of each of the (N+1) nodes on the first target path, each pixel in the pixel image map is classified according to the distance between each pixel in the pixel image map and each of the (N+1) nodes on the first target path, thus obtaining a set of multiple pixel types corresponding to each of the (N+1) nodes on the first target path. The preset pixel index table is created based on the pixel index value of each pixel in the multi-class pixel set corresponding to each of the (N+1) nodes on the first target path.
6. The robot according to claim 4, characterized in that, Determining the path to which the robot's current position belongs from the preset path based on the target pixel includes: The set of pixels closest to the corresponding node in the multi-class pixel set corresponding to each node is used as the candidate pixel set; If the candidate pixel set contains a candidate pixel set with the same pixel index value as the target pixel, then the candidate pixel set with the same pixel index value as the target pixel is taken as the target pixel set; Based on the target pixel set, determine the path to which the robot's current position belongs from the preset path; If there is no candidate pixel set with the same pixel index value as the target pixel in the candidate pixel set, then the pixel set that is second closest to the corresponding node in the multi-class pixel set corresponding to each node is taken as the candidate pixel set, until a candidate pixel set with the same pixel index value as the target pixel is determined in the candidate pixel set.
7. The robot according to claim 6, characterized in that, Based on the target pixel set, determining the path to which the robot's current position belongs from the preset path includes: If the target pixel set is a single node, then the node corresponding to the target pixel set is used as the target node. If the target pixel set consists of two or more objects, then any one of the target pixel sets corresponding to a node is selected as the target node. The first target path corresponding to the target node in the first target path is taken as the undetermined target path to which the robot's current position belongs; the preset path corresponding to the undetermined target path to which the robot's current position belongs in the preset path is taken as the path to which the robot's current position belongs.
8. A method for confirming robot paths, characterized in that, include: The robot's current coordinates in a preset map are obtained in real time when it is at its current position, and the preset map including the current coordinates is obtained. The preset map is then scaled down to a pixel image map according to a preset ratio. Based on the current coordinates and the preset ratio, determine the target location on the pixel image map corresponding to the current coordinates; Based on the target location and pixel coordinate system on the pixel image map, obtain the pixel coordinates on the pixel image map corresponding to the current coordinates; Based on the pixel coordinates, the pixel index value corresponding to the pixel coordinates is obtained; The target pixel corresponding to the pixel index value is found in the preset pixel index table; wherein, the preset pixel index table is determined based on the pixel image map corresponding to the preset map and the preset path in the preset map; Based on the target pixel, determine the path to which the robot's current position belongs from the preset path.
9. 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 robot path confirmation method of claim 8.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the steps of the robot path confirmation method of claim 8.
Citation Information
Patent Citations
Path finding method and device in map, computer equipment and storage medium
CN110309236A
Robot obstacle avoidance method, robot and computer readable storage medium
CN113997286A