Method, device, robot and storage medium for determining docking position
By obtaining grid map and distance information in the robot and determining the candidate grid set, the problem of inaccurate docking positions in traditional technology is solved, and the effect of accurate material transportation is achieved.
Patent Information
- Application Number
- CN202411289879.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-14
AI Technical Summary
In traditional technology, when a robot is blocked by an obstacle, it is unable to accurately determine the new docking position, resulting in the inability to accurately transport the materials to the destination.
By obtaining the robot's current raster map, current position and initial docking position, determine the candidate raster set based on the distance between the raster and the obstacle, initial docking position and adjacent objects, and eliminate too close, too far or errors to the obstacle, or Direction grid, calculate the target docking position to improve the accuracy of the docking position.
It effectively avoids collisions between robots and obstacles and material transportation errors, ensures that materials reach the target position accurately, and improves the accuracy of determining the docking position.
Smart Images

Figure CN118816894B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, robot and storage medium for determining a docking position. Background Art
[0002] With the development of artificial intelligence technology, robots can deliver materials to the destination by running to the designated docking position. If the designated docking position is blocked by obstacles, the robot needs to determine a new docking position to solve the problem that the materials cannot be delivered to the destination. For example, in the scenario where the food delivery robot delivers food to the docking position corresponding to the target table, if the docking position corresponding to the target table is blocked by tables and chairs, the robot needs to determine a new docking position near the target table.
[0003] In traditional technology, when the designated docking position is blocked by an obstacle, the robot determines a point closest to the designated docking position on a straight line between the designated docking position and the current position of the robot as a new docking position, resulting in low accuracy in docking position determination. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, robot, storage medium and computer program product for determining a docking position that can improve the accuracy of the docking position in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for determining a parking position. The method comprises:
[0006] Obtaining a current grid map, a current position, and an initial docking position corresponding to the robot; the current grid map includes a plurality of grids;
[0007] Determining a first candidate grid set based on a first distance between the grid and the obstacle;
[0008] determining a second candidate grid set based on a second distance between the grid and the initial docking position;
[0009] Determining a third candidate grid set based on a second distance corresponding to the grid and a third distance between the grid and a neighboring object; the neighboring object refers to an object neighboring the target object corresponding to the initial docking position;
[0010] Determining a fourth candidate grid set based on the current position and the initial stop position;
[0011] A target stop position is determined based on the first candidate grid set, the second candidate grid set, the third candidate grid set, and the fourth candidate grid set.
[0012] In a second aspect, the present application also provides a parking position determination device. The device comprises:
[0013] An acquisition module, used to acquire a current grid map, a current position and an initial docking position corresponding to the robot; the current grid map includes a plurality of grids;
[0014] A first determining module, configured to determine a first candidate grid set based on a first distance between the grid and the obstacle;
[0015] A second determination module, configured to determine a second candidate grid set based on a second distance between the grid and the initial stop position;
[0016] A third determination module is used to determine a third candidate grid set based on a second distance corresponding to the grid and a third distance between the grid and a neighboring object; the neighboring object refers to an object that is adjacent to the target object corresponding to the initial docking position;
[0017] A fourth determination module, configured to determine a fourth candidate grid set based on the current position and the initial stop position;
[0018] The docking position determination module is used to determine a target docking position based on the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set.
[0019] In a third aspect, the present application further provides a robot comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0021] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0022] The above-mentioned method, device, robot, storage medium and computer program product for determining the docking position determine a first candidate grid set through a first distance between a grid and an obstacle, that is, excluding grids whose first distance to the obstacle is less than a safe distance, thereby avoiding a collision between the robot and the obstacle; determine a second candidate grid set through a second distance between the grid and an initial docking position, that is, excluding grids far from the initial docking position, thereby avoiding the robot from being unable to accurately deliver materials to a target object; determine a third candidate grid set through a second distance corresponding to the grid and a third distance between the grid and an adjacent object, that is, excluding grids whose distance to the adjacent object is closer than to the target object, thereby avoiding the robot from delivering materials to a target object. Incorrect running to adjacent objects; through the current position and the initial docking position, the fourth candidate grid set is determined, that is, the grids opposite to the current running direction of the robot are excluded, so as to avoid the robot running in the direction opposite to the current running direction and being unable to deliver materials to the target object; based on the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set, the target docking position is determined, that is, the grid that satisfies the conditions that the distance to the obstacle is greater than the safety distance, is close to the initial docking position, is closer to the target object than the adjacent objects, and the direction from the current position to the grid is the same as the current running direction is determined as the target docking position, thereby improving the accuracy of the target docking position. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A diagram of an application environment of a method for determining a docking position in an embodiment;
[0025] Figure 2 A schematic diagram of a process of determining a docking position in one embodiment;
[0026] Figure 3 is a schematic diagram of a current grid map in one embodiment;
[0027] Figure 4 is a schematic diagram of an initial first map in one embodiment;
[0028] Figure 5 is a schematic diagram of an initial second map in one embodiment;
[0029] Figure 6 is a schematic diagram of an initial third map in one embodiment;
[0030] Figure 7 is a schematic diagram of an initial fourth map in one embodiment;
[0031] Figure 8 is a schematic diagram of a fourth target map in one embodiment;
[0032] Fig. 9 is a schematic diagram of an initial grid map in one embodiment;
[0033] Fig.10 is a schematic diagram of an initial grid map in another embodiment;
[0034] Fig.11 A flowchart of a total cost determination step in one embodiment;
[0035] Fig.12 is a flow chart of a method for determining a docking position in another embodiment;
[0036] Fig.13 is a structural block diagram of a parking position determination device in one embodiment;
[0037] Fig.14 1 is a diagram showing the internal structure of a robot in one embodiment. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] The method for determining the parking position provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the robot 104 through the network. The terminal 102 and the robot 104 can be used together to execute the docking position determination method provided in the embodiment of the present application, and the robot 104 can also be used alone to execute the docking position determination method provided in the embodiment of the present application. Among them, the robot 104 can be various self-moving devices, such as: cleaning robots, delivery robots, guide robots, automatic guided vehicles (Automatic Guided Vehicle, AGV) and sweepers. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart TVs and smart car-mounted devices, etc., and the portable wearable devices can be smart watches, etc.
[0040] The robot 104 can also cooperate with the server to implement the docking position determination method provided in the embodiment of the present application, wherein the server can be an independent physical server or a service node in the blockchain system, and each service node in the blockchain system forms a peer-to-peer (P2P, Peer To Peer) network, and the P2P protocol is an application layer protocol running on the transmission control protocol (TCP, Transmission Control Protocol) protocol. In addition, the server can also be a server cluster composed of multiple physical servers, which can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The robot 104 can be connected to the server through Bluetooth, USB (Universal Serial Bus) or network communication connection methods, and this application does not limit this.
[0041] In one embodiment, Figure 2 As shown, a method for determining a docking position is provided. This embodiment is described by taking the method applied to a robot as an example, and includes steps 202 to 212.
[0042] Step 202, obtaining the current grid map, current position and initial docking position corresponding to the robot; the current grid map includes multiple grids.
[0043] Among them, the current grid map refers to the grid map at the current moment. It can be understood that during the operation of the robot, the robot detects the current obstacle data through sensors, updates the existing grid map based on the current obstacle data, and forms the current grid map. The current grid map includes multiple grids, each grid has a corresponding grid position and obstacle identification. The grid position is used to characterize the position of the grid in the current grid map, and the obstacle identification is used to characterize whether there is an obstacle in the grid. The current position refers to the current position of the robot, and the current position can be expressed by coordinates. The initial docking position refers to the designated docking position corresponding to the target object, which can be understood as the docking position set according to the target object.
[0044] Exemplarily, during operation, the robot obtains the current grid map, current position, and initial stop position corresponding to the robot based on a preset time interval. The preset time interval refers to a pre-set time interval, which can be set according to the robot's running speed or running path, etc., and is not limited here.
[0045] Step 204: Determine a first candidate grid set based on a first distance between the grid and the obstacle.
[0046] The first distance refers to the shortest straight-line distance between the grid and the obstacle. The first candidate grid set refers to a set of grids corresponding to the first distance being greater than the first threshold. The first threshold refers to the minimum distance for determining a grid as the first candidate grid. The first threshold can be determined based on the width of the robot, and the first threshold is greater than the width of the robot.
[0047] Exemplarily, for each grid, the robot obtains the grid position of the grid and the obstacle grid position corresponding to the obstacle grid whose obstacle identifier is the first identifier in the current grid map, and determines the first distance between the grid and the obstacle based on the grid position of the grid and the obstacle grid position corresponding to the obstacle grid; determines the grid whose first distance is greater than the first threshold as the first candidate grid; and forms a first candidate grid set with multiple first candidate grids. The first identifier refers to an identifier that indicates the existence of an obstacle in the grid, and the first identifier can be a character, a number, a symbol, etc., which is not limited here.
[0048] In one embodiment, for each grid, the robot obtains the grid position of the grid and the obstacle grid position corresponding to the obstacle grid with the obstacle identifier as the first identifier in the current grid map, calculates the straight-line distance between the grid position of the grid and the obstacle grid position of the obstacle grid, compares the straight-line distances corresponding to the grid and a plurality of obstacle grids, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the first distance between the grid and the obstacle; converts the first distance corresponding to the grid into a first grayscale value to generate an initial first map, and the first grayscale value corresponding to the grid is proportional to the corresponding first distance; deletes the grids in the initial first map whose first distance is less than or equal to the first threshold from the initial first map to obtain a target first map, and the plurality of first candidate grids in the target first map are the first candidate grid set. For example, if the current grid map is such as Figure 3 As shown, the current grid map includes the robot, the initial path, the initial docking position and the grid. The initial path refers to the path from the robot to the initial docking position. The initial docking position refers to the destination of the robot. The black grid is the grid with obstacles. The initial first map determined based on the above method is as follows: Figure 4 As shown, Figure 4 for Figure 3 In the actual calculation process, we can only calculate Figure 4 Displays a local map without calculating Figure 3 The global map shown here can reduce the amount of computation. Figure 4The map shown in the black box 402 is the local map actually processed in the selected local map. The local map that is suitable for the target calculation result (such as the first distance) is selected to reduce the amount of processed data. Different colors represent different first distances between the grid and the obstacle. The darker the color of the grid, the smaller the first distance between the grid and the obstacle. For example, the grid close to the obstacle grid appears black, representing a smaller first distance between the grid and the obstacle, and the grid far from the obstacle grid appears gray, representing a larger first distance between the grid and the obstacle. The grids in the initial first map whose first distance is less than or equal to the first threshold (such as 0.3 meters) are removed from the initial first map, that is, Figure 4 By removing the black grid in the middle, we can get the target first map.
[0049] Step 206 : Determine a second candidate grid set based on a second distance between the grid and the initial stop position.
[0050] The second distance refers to the straight-line distance between the grid and the initial stop position. The second candidate grid set refers to the set of grids corresponding to the second distance being less than the second threshold. The second threshold refers to the maximum distance for determining a grid as the second candidate grid. The second threshold can be determined based on the shortest straight-line distance between the target object and its neighboring objects. For example, the shortest straight-line distance between the target object and its neighboring objects is L, and the second distance threshold can be L / 2, or a value less than L / 2.
[0051] Exemplarily, for each grid, the robot obtains the grid position of the grid, calculates the straight-line distance between the grid position and the initial docking position, and obtains a second distance between the grid and the initial docking position; determines the grid whose second distance is less than a second threshold as a second candidate grid; and groups multiple second candidate grids into a second candidate grid set.
[0052] In one embodiment, for each grid, the robot obtains the grid position of the grid, calculates the straight-line distance between the grid position and the initial docking position, obtains the second distance between the grid and the initial docking position, converts the second distance corresponding to the grid into a second grayscale value, generates an initial second map, and the second grayscale value corresponding to the grid is inversely proportional to the corresponding second distance; deletes the grids in the initial second map whose second distance is greater than or equal to the second threshold from the initial second map, and obtains the target second map, and the multiple second candidate grids in the target second map are the second candidate grid set. For example, Figure 5 The initial second map shown, Figure 5 for Figure 3 Part of Figure 5 The map shown in the black box 502 in FIG. 1 is the local map actually selected and processed. Figure 5The circle in represents the area with the initial stop position as the center and the second threshold as the radius. The grid within the circle represents the grid whose second distance is less than the second threshold, that is, the grid within the circle is the second candidate grid. The closer the second candidate grid is to the initial stop position, the larger the second distance is, and the smaller the grayscale value corresponding to the second candidate grid is. The farther the second candidate grid is from the initial stop position, the smaller the second distance is, and the larger the grayscale value corresponding to the second candidate grid is. The black grid outside the circle represents the grid whose second distance is equal to or greater than the second threshold. The grids outside the circle in the initial second map are removed, and the map composed of the grids within the circle is the target second map.
[0053] Step 208 : determining a third candidate grid set based on the second distance corresponding to the grid and the third distance between the grid and the neighboring object; the neighboring object refers to an object that is adjacent to the target object corresponding to the initial docking position.
[0054] The third distance refers to the shortest straight-line distance between the grid and the neighboring object. The target object refers to the object corresponding to the initial docking position, and the object refers to the object to which the robot delivers materials. For example, if the robot is a food delivery robot, the object is a dining table, or if the robot is a delivery robot, the object is a house. The neighboring object refers to the object that is adjacent to the target object. For example, if the robot is a food delivery robot and the target object is dining table No. 1, then the dining tables within a radius of 2 meters from dining table No. 1 are the neighboring objects.
[0055] Exemplarily, the robot determines the target object corresponding to the initial docking position based on the topological map, determines the neighboring objects corresponding to the target object based on the target object and a preset radius, and obtains the neighboring object positions of the neighboring objects; for each grid, calculates the straight-line distance between the grid position of the grid and the neighboring object position of the neighboring object, compares the straight-line distances corresponding to the grid and multiple neighboring objects respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the third distance corresponding to the grid; compares the second distance corresponding to the grid with the third distance corresponding to the grid, determines the grid whose third distance is greater than the second distance as the third candidate grid, and groups multiple third candidate grids into a third candidate grid set.
[0056] In one embodiment, the robot determines the target object corresponding to the initial docking position based on the topological map, determines the neighboring objects corresponding to the target object based on the target object and a preset radius, and obtains the neighboring object positions of the neighboring objects; for each grid, calculates the straight-line distance between the grid position of the grid and the neighboring object position of the neighboring object, compares the straight-line distances corresponding to the grid and multiple neighboring objects respectively, obtains the minimum straight-line distance, determines the minimum straight-line distance as the third distance corresponding to the grid, converts the third distance corresponding to the grid into a third grayscale value, generates an initial third map, and the third grayscale value corresponding to the grid is proportional to the corresponding third distance; deletes the grids in the initial third map whose third distance is less than or equal to the second distance from the initial third map to obtain a target third map, and the multiple third candidate grids in the target third map are the third candidate grid set. For example, the initial third map is as follows: Figure 6 As shown, Figure 6 for Figure 3 Part of Figure 6 The map shown in the black box 612 in the figure is the local map actually selected and processed. The area where the lower oblique line in the black box 612 is located is the 602 area. The grids outside the 602 area are grids whose third distance is greater than the second distance, that is, the grids outside the 602 area are the third candidate grids. The grids within the 602 area are grids whose third distance is equal to or less than the second distance. The grids whose third distance is equal to or less than the second distance in the initial third map are removed from the initial third map, that is, the grids within the 602 area are removed, and the map composed of the third candidate grids outside the 602 area is the target third map.
[0057] like Figure 6As shown, circle 604 and circle 606 are concentric circles, and the centers of circle 604 and circle 606 are an adjacent object corresponding to the target object. The closer the grid in circle 604 is to the adjacent object, the shorter the third distance to the adjacent object, and the smaller the grayscale value corresponding to the grid. The grayscale value corresponding to the third distance of the grid on circle 604 is 255, that is, the third distance of the grid on circle 604 is the maximum distance L1 that can be expressed by the grayscale value. If it is necessary to determine the grayscale value corresponding to the grid between circle 604 and circle 606, it is necessary to subtract L1 from the third distance of the grid between circle 604 and circle 606, and then determine the grayscale value according to the difference obtained by subtraction. The grayscale value corresponding to the grid, so, the closer the circle 606 is to the circle 604, the shorter the third distance corresponding to the grid is, and the smaller the grayscale value corresponding to the grid is; the closer the third distance is to the circle 606, the longer the third distance corresponding to the grid is, and the larger the grayscale value corresponding to the grid is. It can be understood that the third distance corresponding to the grayscale value of 0 to 255 ranges from 0 to L1. For the third distance between L1 and 2L1, it is necessary to determine the grayscale value corresponding to the grid based on the difference obtained by subtracting L1 from the first distance corresponding to the grid. Similarly, for the third distance between 2L1 and 3L1, it is necessary to determine the grayscale value corresponding to the grid based on the difference obtained by subtracting 2L1 from the first distance corresponding to the grid.
[0058] like Figure 6 As shown, circle 608 and circle 610 are concentric circles, and the centers of circle 608 and circle 610 are the target object. The closer the grid in circle 608 is to the target object, the shorter the second distance to the target object, and the smaller the grayscale value corresponding to the grid. The second distance of the grid on circle 608 is L1. Similarly, the second distance of the grid on circle 610 is 2L1. The closer circle 610 is to circle 608, the shorter the second distance corresponding to the grid, and the smaller the grayscale value corresponding to the grid. The closer the grid is to circle 610, the longer the second distance corresponding to the grid, and the larger the grayscale value corresponding to the grid.
[0059] Step 210: Determine a fourth candidate grid set based on the current position and the initial stop position.
[0060] The fourth candidate grid set refers to a set of grids consisting of a second running direction of the robot running from the current position to the grid and a first running direction of the robot running from the current position to the initial docking position.
[0061] Exemplarily, the robot determines a first running direction of the robot from the current position to the initial docking position based on the current position and the initial docking position; for each grid, based on the grid position and the current position of the grid, the robot determines a second running direction of the robot from the current position to the grid, compares the second running direction with the first running direction, determines the grid corresponding to the second running direction that is the same as the first running direction as the fourth candidate grid, and determines multiple fourth candidate grids as a fourth candidate grid set.
[0062] In one embodiment, for each grid, the robot determines the fourth distance between the grid and the current position based on the grid position and the current position of the grid, converts the fourth distance corresponding to the grid into a fourth grayscale value, and generates an initial fourth map, in which the fourth grayscale value corresponding to the grid is proportional to the corresponding fourth distance; based on the current position and the initial docking position, the robot determines the first running direction from the current position to the initial docking position, and for each grid, based on the grid position and the current position of the grid, the robot determines the second running direction from the current position to the grid, deletes the grid corresponding to the second running direction opposite to the first running direction in the initial fourth map from the initial fourth map, and obtains the target fourth map, and the multiple fourth candidate grids in the target fourth map are the fourth candidate grid set. For example, the initial fourth map is such as Figure 7 As shown, Figure 7 for Figure 3 Part of Figure 7 The map shown in the black box 702 in FIG. 1 is the local map actually selected and processed. Figure 7 The circles in the figure are formed by the current position of the robot as the center. The fourth distances from different grids on the same circle to the current position are the same, which is the radius of the circle. The smaller the fourth distance corresponding to the grid, the smaller the gray value corresponding to the grid. The larger the fourth distance corresponding to the grid, the larger the gray value corresponding to the grid. That is, different gray values represent the fourth distance between the grid and the current position. Figure 8 The initial fourth map shown, in Figure 7 On the basis of this, the first running direction corresponding to the grids in area 802 is opposite to the second running direction, and the first running direction corresponding to the grids outside area 802 is the same as the second running direction. The grids corresponding to the second running direction opposite to the first running direction in the initial fourth map are removed from the initial fourth map, that is, the grids in area 802 are removed, and the map composed of the grids outside area 802 is the target fourth map.
[0063] Step 212: determine a target stop position based on the first candidate grid set, the second candidate grid set, the third candidate grid set, and the fourth candidate grid set.
[0064] The target docking position refers to a new docking position corresponding to the target object.
[0065] Exemplarily, the robot obtains the intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set to obtain an initial grid set, and determines the target docking position based on the initial grid set.
[0066] In one embodiment, step 212 further includes: determining a target path based on the current position and the target docking position; the target path is used to instruct the robot to run from the current position to the target docking position.
[0067] In one embodiment, the target docking position is determined based on the target first map, the target second map, the target third map, and the target fourth map. Specifically, the robot intersects the target first map, the target second map, the target third map, and the target fourth map to obtain an initial grid map, and determines the target docking position based on the initial grid map. For example, the target first map, the target second map, the target third map, and the target fourth map intersect to obtain the following: Fig. 9 In the initial grid map shown, the grid in the white crescent-shaped area 902 in the initial grid map is the initial grid obtained by finding the intersection of the target first map, the target second map, the target third map and the target fourth map.
[0068] In the above-mentioned method for determining the docking position, a first candidate grid set is determined by the first distance between the grid and the obstacle, that is, the grids whose first distance to the obstacle is less than the safety distance are excluded, so as to avoid collision between the robot and the obstacle; a second candidate grid set is determined by the second distance between the grid and the initial docking position, that is, the grids far from the initial docking position are excluded, so as to avoid the robot being unable to accurately deliver materials to the target object; a third candidate grid set is determined by the second distance corresponding to the grid and the third distance between the grid and the adjacent object, that is, the grids that are closer to the adjacent object than to the target object are excluded, so as to avoid the robot mistakenly delivering materials to the adjacent object. ; The fourth candidate grid set is determined through the current position and the initial docking position, that is, the grids that are opposite to the current running direction of the robot are excluded to prevent the robot from running in the direction opposite to the current running direction and failing to deliver materials to the target object; based on the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set, the target docking position is determined, that is, the grid that satisfies the conditions that the distance to the obstacle is greater than the safety distance, is close to the initial docking position, is closer to the target object than the adjacent objects, and the direction from the current position to the grid is the same as the current running direction is determined as the target docking position, thereby improving the accuracy of the target docking position.
[0069] In one embodiment, determining a first candidate grid set based on a first distance between a grid and an obstacle includes:
[0070] Based on the obstacle identification corresponding to the grid in the current grid map, a first distance between the grid and the obstacle is determined; the first distance corresponding to the grid is compared with a first threshold, and when the first distance is greater than the first threshold, the grid is determined as a first candidate grid; based on multiple first candidate grids, a first candidate grid set is obtained.
[0071] The obstacle identifier refers to an identifier that indicates whether there is an obstacle in the grid. The obstacle identifier may be a first identifier and a second identifier. The first identifier indicates that there is an obstacle in the grid, and the second identifier indicates that there is no obstacle in the grid. The first identifier and the second identifier may be characters, numbers, or symbols, etc. The first threshold refers to the minimum distance for determining the grid as the first candidate grid. The first threshold may be determined according to the width of the robot, and the first threshold is greater than the width of the robot.
[0072] Exemplarily, the robot obtains the obstacle grid position corresponding to the obstacle grid with the obstacle identifier as the first identifier from the current grid map, calculates the straight-line distance between the grid position of the grid and the obstacle grid position of the obstacle grid, compares the straight-line distances corresponding to the grid and multiple obstacle grids respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the first distance between the grid and the obstacle; compares the first distance with a first threshold, and if the first distance is greater than the first threshold, determines the grid corresponding to the first distance as the first candidate grid, and combines multiple first candidate grids into a first candidate grid set.
[0073] In this embodiment, by comparing the first distance corresponding to the grid with the first threshold, when the first distance is greater than the first threshold, the grid is determined as the first candidate grid, and based on multiple first candidate grids, a first candidate grid set is obtained, that is, the grids whose first distance to the obstacle is greater than the safety distance form the first candidate grid set. If the target docking position is determined from the first candidate grids in the first candidate grid set, the robot can avoid collision with the obstacle.
[0074] In one embodiment, determining a third candidate grid set based on a second distance corresponding to the grid and a third distance between the grid and a neighboring object includes:
[0075] Acquire a target object corresponding to an initial stop position and a neighboring object corresponding to the target object; determine a straight-line distance between a grid and the neighboring object; compare multiple straight-line distances corresponding to the grid to obtain a minimum straight-line distance; determine the minimum straight-line distance as a third distance corresponding to the grid; compare the third distance corresponding to the grid with the second distance, and when the third distance is greater than the second distance, determine the grid as a third candidate grid; and obtain a third candidate grid set based on multiple third candidate grids.
[0076] Exemplarily, the robot determines, based on the initial docking position, a target object corresponding to the initial docking position from a topological map, determines, based on the target object and a preset radius, a neighboring object corresponding to the target object from the topological map, and obtains the neighboring object position of the neighboring object; for each grid, calculates the straight-line distance between the grid position of the grid and the neighboring object position of the neighboring object, compares the straight-line distances corresponding to the grid and multiple neighboring objects respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the third distance corresponding to the grid; compares the second distance corresponding to the grid with the third distance corresponding to the grid, determines a grid whose third distance is greater than the second distance as a third candidate grid, and groups multiple third candidate grids into a third candidate grid set.
[0077] In this embodiment, by comparing the third distance corresponding to the grid with the second distance, when the third distance is greater than the second distance, the grid is determined as a third candidate grid. Based on multiple third candidate grids, a third candidate grid set is obtained, that is, a grid that is closer to the target object than to the adjacent object is determined as the third candidate grid. If the target docking position is determined from the third candidate grid in the third candidate grid set, the robot can be prevented from delivering materials to the adjacent object, thereby improving the accuracy of the target docking position.
[0078] In one embodiment, based on the current position and the initial stop position, determining a fourth candidate grid set includes:
[0079] Based on the current position and the initial docking position, determine the first running direction of the robot to the initial docking position; based on the current position and the grid position corresponding to the grid, determine the second running direction of the robot to the grid; compare the second running direction with the first running direction, and when the second running direction is the same as the first running direction, determine the grid as a fourth candidate grid; based on multiple fourth candidate grids, obtain a fourth candidate grid set.
[0080] The first running direction refers to the direction in which the robot runs from the current position to the initial stop position, and the first running direction can be represented by a vector. The second running direction refers to the direction in which the robot runs from the current position to the grid, and the second running direction can be represented by a vector.
[0081] Exemplarily, the robot subtracts the initial docking position from the current position to obtain a first vector, and based on the first vector, determines a first running direction of the robot to the initial docking position; for each grid, the robot subtracts the grid position of the grid from the current position to obtain a second vector, and based on the second vector, determines a second running direction of the robot to the grid, and compares the second running direction with the first running direction; if the second running direction is the same as the first running direction, the grid is determined as a fourth candidate grid, and multiple fourth candidate grids are combined into a fourth candidate grid set.
[0082] In this embodiment, by comparing the second running direction with the first running direction, when the second running direction is the same as the first running direction, the grid is determined as the fourth candidate grid, and based on multiple fourth candidate grids, a fourth candidate grid set is obtained, that is, the grid that is the same as the current running direction of the robot is determined as the fourth candidate grid. If the target docking position is determined from the fourth candidate grids in the fourth candidate grid set, it can prevent the robot from running in the direction opposite to the current running direction and being unable to deliver materials to the target object, thereby improving the accuracy of the target docking position.
[0083] In one embodiment, determining a target stop position based on the first candidate grid set, the second candidate grid set, the third candidate grid set, and the fourth candidate grid set includes:
[0084] The intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set is obtained to obtain an initial grid set; based on the connected initial grids in the initial grid set, a target grid set is obtained; based on the target grid set, a target stop position is determined.
[0085] The connected initial grid refers to an initial grid with connected initial grids. It can be understood that if an initial grid is connected to another initial grid, then the initial grid is a connected initial grid. That is, if the grid connected to the initial grid in at least one of the four directions above, below, left, and right of the initial grid is an initial grid, then the initial grid is a connected initial grid. For example, Fig. 9In the initial grid map shown, the grid in the white crescent-shaped area 902 is the initial grid, and the grids connected to the top, bottom, left and right sides of the initial grid 904 in the white crescent-shaped area 902 are not the initial grids, so the initial grid 904 is a non-connected initial grid. Similarly, the grids connected to the top, bottom, left and right sides of the initial grid 906 in the white crescent-shaped area 902 are not the initial grids, so the initial grid 906 is a non-connected initial grid. Except for the initial grid 904 and the initial grid 906, the other initial grids in the white crescent-shaped area 902 are all connected initial grids. The connected initial grid is the initial grid that the robot can run to, and the non-connected grid is the initial grid that the robot cannot run to. It can be understood that the initial grids in the initial grid set are grids that the robot can run to. If the initial grid corresponding to the target docking position is a non-connected grid, the robot cannot pass through multiple initial grids to reach the target docking position. If the initial grid corresponding to the target docking position is a connected grid, the robot can pass through multiple initial grids to reach the target docking position. Therefore, the target docking position is determined from the connected initial grids, and the robot can definitely run to the target docking position.
[0086] Exemplarily, the robot finds the intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set to obtain an initial grid set, determines the connected initial grids in the initial grid set as target grids, combines multiple target grids into a target grid set, and determines the target docking position by the grid position of any target grid in the target grid set.
[0087] In this embodiment, an initial grid set is obtained by finding the intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set, that is, the initial grid in the initial grid set satisfies that the distance to the obstacle is greater than the safety distance, is close to the initial docking position, is closer to the target object than the adjacent object, and the direction of running from the current position to the grid is the same as the current running direction; then, based on the connected initial grids in the initial grid set, a target grid set is obtained, and the target docking position is determined based on the target grid set, that is, the connected initial grids are determined as the target grids, the initial grids that the robot may not be able to reach are removed, and the target docking position is determined based on the target grid set, which ensures that the robot can definitely reach the re-determined target docking position, thereby improving the accuracy of the target docking position determination.
[0088] In one embodiment, obtaining a target grid set based on connected initial grids in the initial grid set includes:
[0089] For each initial grid in the initial grid set, the distance between the initial grid and the current position is determined; the initial grid corresponding to the minimum distance is determined as the starting grid; if there is an initial grid connected to the starting grid, the starting grid is determined as the target grid; the initial grid connected to the starting grid is determined as the new starting grid, and the step of determining the starting grid as the target grid if there is an initial grid connected to the starting grid is repeated; until there is no initial grid connected to the starting grid, the target grid set is determined based on multiple target grids.
[0090] The distance between the initial grid and the current position is the straight-line distance.
[0091] Exemplarily, for each initial grid in the initial grid set, the robot obtains the grid position of the initial grid, calculates the straight-line distance between the grid position of the initial grid and the current position, obtains the distance between the initial grid and the current position, compares the distances corresponding to multiple initial grids, obtains the minimum distance, and determines the initial grid corresponding to the minimum distance as the starting grid; based on the grid position of the initial grid, determines the adjacent grids of the initial grid, and for each adjacent grid, determines whether the adjacent grid is located in the initial grid set, if there is an adjacent grid located in the initial grid set, it is determined that there is an initial grid connected to the starting grid, the starting grid is determined as the target grid, and the initial grid connected to the starting grid is determined as the new starting grid, and the above steps are repeated until there is no initial grid connected to the starting grid, and the multiple target grids are combined into a target grid set. For example, in another embodiment, the initial grid map is as follows: Fig.10 As shown, the circle is the robot, the black straight line where the circle is located is the initial path, the grids in 1002 and 1004 are both initial grids, and the distance between the initial grid in 1002 and the current position is smaller than the distance between the initial grid in 1004 and the current position. Therefore, starting from the initial grid closest to the robot (the first starting grid), the first starting grid is located in 1002, and the target grid is determined starting from the first starting grid. The initial grids in 1002 are all target grids, and the set composed of the initial grids in 1002 is the target grid set. If the target docking position is determined from the target grid set, the robot can run from the current position to the target docking position; the initial grids in 1004 are all non-target grids, and the set composed of the initial grids in 1004 is the non-target grid set. If the target docking position is determined from the non-target grid set, the robot cannot run from the current position to the target docking position.
[0092] In this embodiment, by judging whether there is an initial grid connected to the starting grid, the starting grid with the connected initial grid is determined as the target grid, that is, the target docking position is determined from the target grids in the target grid set. The robot can definitely run to the target docking position from other target grids, ensuring that the robot can definitely reach the re-determined target docking position, thereby improving the accuracy of the target docking position determination.
[0093] In one embodiment, determining a target docking position based on a target grid set includes:
[0094] For each target grid in the target grid set, determine the fourth distance between the target grid and the current position; obtain the initial path corresponding to the robot, and determine the fifth distance between the target grid and the initial path; based on the first distance, the second distance, the fourth distance and the fifth distance corresponding to the target grid, determine the total cost corresponding to the target grid; determine the grid position of the target grid corresponding to the minimum total cost as the target docking position.
[0095] Among them, the initial path refers to the path that the robot runs to the initial docking position, which can be understood as the robot running path determined according to the initial docking position. The fifth distance refers to the shortest straight-line distance between the target grid and the initial path. The total cost refers to the value representing the cost of the robot running to the target grid. The larger the total cost, the higher the cost of the robot running to the target grid, and the smaller the total cost, the lower the cost of the robot running to the target grid.
[0096] Exemplarily, for each target grid in the target grid set, the robot determines the fourth distance between the target grid and the current position, obtains the initial path corresponding to the robot, calculates the shortest straight-line distance between the target grid and the initial path, and determines the shortest straight-line distance as the fifth distance between the target grid and the initial path. Then, based on the first distance, second distance, fourth distance and fifth distance corresponding to the target grid, the total cost corresponding to the target grid is determined, the total costs corresponding to multiple target grids are compared to obtain the minimum total cost, and the grid position of the target grid corresponding to the minimum total cost is determined as the target docking position.
[0097] In this embodiment, the total cost corresponding to the target grid is determined by the first distance, the second distance, the fourth distance and the fifth distance corresponding to the target grid, and the grid position of the target grid corresponding to the minimum total cost is determined as the target docking position, that is, the optimal target grid is determined from the target grid set, and the grid position of the optimal target grid is determined as the target docking position, thereby further improving the accuracy of the target docking position.
[0098] In one embodiment, Fig.11As shown, based on the first distance, the second distance, the fourth distance and the fifth distance corresponding to the target grid, the total cost corresponding to the target grid is determined, including:
[0099] Step 1102: determine a first cost corresponding to the target grid based on a first distance corresponding to the target grid; the first cost is proportional to the first distance.
[0100] Among them, the first cost refers to the cost value corresponding to the first distance. The first cost can be determined according to the first corresponding relationship and the first distance. The first corresponding relationship can be obtained according to the first distances corresponding to all target grids. In the first corresponding relationship, the first cost is proportional to the first distance.
[0101] Exemplarily, the robot compares the first distances corresponding to all target grids to obtain the minimum first distance and the maximum first distance, and determines the first corresponding relationship based on the minimum first distance and the maximum first distance; substitutes the first distance corresponding to the target grid into the first corresponding relationship to obtain the first cost corresponding to the target grid.
[0102] In one embodiment, the first correspondence is as follows:
[0103] D 1 (S 1 ) = (S 1 -S 1min ) / (S 1max -S 1min ) Formula (1)
[0104] Among them, D 1 (S 1 ) is the first distance S 1 The first cost corresponding to the target grid; S 1 is the first distance corresponding to the target grid; S 1min is the minimum first distance; S 1max is the maximum first distance.
[0105] Step 1104: determine a second cost corresponding to the target grid based on a second distance corresponding to the target grid; the second cost is proportional to the second distance.
[0106] Among them, the second cost refers to the cost value corresponding to the second distance. The second cost can be determined according to the second corresponding relationship and the second distance. The second corresponding relationship can be obtained according to the second distances corresponding to all target grids. In the second corresponding relationship, the second cost is proportional to the second distance.
[0107] Exemplarily, the robot compares the second distances corresponding to all target grids to obtain the minimum second distance and the maximum second distance, and determines the second corresponding relationship based on the minimum second distance and the maximum second distance; substitutes the second distance corresponding to the target grid into the second corresponding relationship to obtain the second cost corresponding to the target grid.
[0108] In one embodiment, the second corresponding relationship is as follows:
[0109] D 2 (S 2 ) = (S 2 -S 2min ) / (S 2max -S 2min ) Formula (2)
[0110] Among them, D 2 (S 2 ) is the second distance S 2 The second cost corresponding to the target grid; S 2 is the second distance corresponding to the target grid; S 2min is the minimum second distance; S 2max is the maximum second distance.
[0111] Step 1106: determine a third cost corresponding to the target grid based on the fourth distance corresponding to the target grid; the third cost is proportional to the fourth distance.
[0112] Among them, the third cost refers to the cost value corresponding to the fourth distance. The third cost can be determined according to the third corresponding relationship and the fourth distance. The third corresponding relationship can be determined according to the fourth distances corresponding to all target grids. In the third corresponding relationship, the third cost is proportional to the fourth distance.
[0113] Exemplarily, the robot compares the fourth distances corresponding to all target grids to obtain the minimum fourth distance and the maximum fourth distance, and determines the second corresponding relationship based on the minimum fourth distance and the maximum fourth distance; substitutes the fourth distance corresponding to the target grid into the third corresponding relationship to obtain the third cost corresponding to the target grid.
[0114] In one embodiment, the third corresponding relationship is as follows:
[0115] D 3 (S 4 ) = (S 4 -S 4min ) / (S 4max -S 4min ) Formula (3)
[0116] Among them, D 3 (S 4) is the fourth distance S 4 The third cost corresponding to the target grid; S 4 is the fourth distance corresponding to the target grid; S 4min is the minimum fourth distance; S 4max is the maximum fourth distance.
[0117] Step 1108: Determine a fourth cost corresponding to the target grid based on the fifth distance corresponding to the target grid; the fourth cost is in inverse proportion to the fifth distance.
[0118] Among them, the fourth cost refers to the cost value corresponding to the fifth distance. The fourth cost can be determined according to the fourth corresponding relationship and the fifth distance. The fourth corresponding relationship can be determined according to the fourth distances corresponding to all target grids. In the fourth corresponding relationship, the fourth cost is inversely proportional to the fifth distance.
[0119] Exemplarily, the robot compares the fifth distances corresponding to all target grids to obtain the minimum fifth distance and the maximum fifth distance, and determines the fourth corresponding relationship based on the minimum fifth distance and the maximum fifth distance; substitutes the fifth distance corresponding to the target grid into the fourth corresponding relationship to obtain the fourth cost corresponding to the target grid.
[0120] In one embodiment, the fourth corresponding relationship is as follows:
[0121] D 4 (S 5 )=1-(S 5 -S 5min ) / (S 5max -S 5min ) Formula (4)
[0122] Among them, D 4 (S 5 ) is the fifth distance S 5 The fourth cost corresponding to the target grid; S 5 is the fifth distance corresponding to the target grid; S 5min is the smallest fifth distance; S 5max The fifth maximum distance.
[0123] Step 1110 , determining a total cost corresponding to the target grid based on the first cost, the second cost, the third cost, and the fourth cost.
[0124] Exemplarily, for each target grid, the robot multiplies the first cost of the target grid by the first weight coefficient to obtain the first target cost of the target grid, multiplies the second cost of the target grid by the second weight coefficient to obtain the second target cost of the target grid, multiplies the third cost of the target grid by the third weight coefficient to obtain the third target cost of the target grid, multiplies the fourth cost of the target grid by the fourth weight coefficient to obtain the fourth target cost of the target grid, and sums the first target cost, the second target cost, the third target cost and the fourth target cost of the target grid to obtain the total cost corresponding to the target grid. Among them, the first weight coefficient represents the importance of the first distance of the target grid in determining the total cost, the second weight coefficient represents the importance of the second distance of the target grid in determining the total cost, the third weight coefficient represents the importance of the fourth distance of the target grid in determining the total cost, and the fourth weight coefficient represents the importance of the fifth distance of the target grid in determining the total cost. The fourth weight coefficient is greater than the second weight coefficient, the second weight coefficient is greater than the first weight coefficient, the first weight coefficient is greater than the third weight coefficient, and the first weight coefficient, the second weight coefficient, the third weight coefficient and the fourth weight coefficient may be in a multiple relationship, indicating that in the process of determining the target docking position, the fifth distance between the target grid and the initial path needs to be considered first, the second distance between the target grid and the initial docking position needs to be considered secondly, the first distance between the target grid and the obstacle needs to be considered thirdly, and finally the fourth distance between the target grid and the current position needs to be considered, that is, in the process of determining the target docking position, the fifth distance between the target grid and the initial path is of first importance, the second distance between the target grid and the initial docking position is of second importance, the first distance between the target grid and the obstacle is of third importance, and the first distance between the target grid and the obstacle is of fourth importance.
[0125] In one embodiment, the total cost corresponding to the target grid is as follows:
[0126] D(i,j)=D 1 (i,j)×Q 1 +D 2 (i,j)×Q 2 +D 3 (i,j)×Q 3 +D 4 (i,j)×Q 4 Formula (5)
[0127] Where D(i,j) is the total cost corresponding to the target grid (i,j); D 1 (i, j) is the first cost corresponding to the target grid (i, j); Q 1 is the first weight coefficient; D 2 (i, j) is the second cost corresponding to the target grid (i, j); Q2 is the second weight coefficient; D 3 (i, j) is the third cost corresponding to the target grid (i, j); Q 3 is the third weight coefficient; D 4 (i, j) is the fourth cost corresponding to the target grid (i, j); Q 4 is the first weight coefficient.
[0128] In this embodiment, a first cost corresponding to the target grid is determined based on a first distance corresponding to the target grid, and the first cost is proportional to the first distance, that is, the closer the target grid is to the obstacle, the better. It can be understood that if the grid position of the target grid is determined as the target docking position, the target docking position is close to the obstacle, and the robot stops near the obstacle, occupying a relatively small area of the running road, then the first cost is smaller; a second cost corresponding to the target grid is determined based on a second distance corresponding to the target grid, and the second cost is proportional to the second distance, that is, the closer the target grid is to the initial docking position, the better, and the closer to the initial docking position, the smaller the second cost; a third cost corresponding to the target grid is determined based on a fourth distance corresponding to the target grid, and the third cost is proportional to the fourth distance, that is, the closer the target grid is to the current position, the better. If the target grid is The grid position of the target grid is determined as the target docking position, then the shorter the distance the robot runs to the target docking position, the smaller the third cost; the fourth cost corresponding to the target grid is determined based on the fifth distance corresponding to the target grid, and the fourth cost is inversely proportional to the fifth distance, that is, the larger the shortest straight-line distance between the target grid and the initial path, the better, and the farther the target grid is from the initial path, it means that the target grid deviates from the running road. It can be understood that if the grid position of the target grid is determined as the target docking position, the target docking position deviates from the running road, and the robot stops at the target docking position deviating from the running road, occupying a relatively small area of the running road, then the fourth cost is smaller, and the total cost corresponding to the target grid is determined by the first cost, the second cost, the third cost and the fourth cost, which provides accurate basic data for the candidate to determine the target docking position from the target grid set.
[0129] In one embodiment, after obtaining the current grid map, current position and initial docking position corresponding to the robot, the following steps are included:
[0130] Based on the current position and the initial docking position, determine the initial distance to be run of the robot; compare the initial distance to be run with the initial distance threshold; when the initial distance to be run is less than the initial distance threshold, obtain the initial detection grid from the current grid map based on the initial docking position; when the obstacle identifier of the initial detection grid is the first identifier, perform the step of determining the first candidate grid set based on the first distance between the grid and the obstacle; the first identifier indicates that there is an obstacle in the grid.
[0131] Among them, the distance to be run is the straight-line distance between the current position and the initial docking position. The initial distance threshold refers to a pre-set distance threshold, which can be set according to the sensor measurement distance of the robot. For example, if the sensor measurement distance is 2.5 meters, the initial distance threshold can be set to 2 meters. The initial detection grid refers to the grid located around the initial docking position, which can be understood as the grid occupied by the robot when it is docked at the initial docking position. The initial detection grid can be determined based on the initial docking position and the width of the robot. For example, if the robot is a circular robot and the radius of the robot is 0.27 meters, the initial detection grid is a grid within a circle with the initial docking position as the center and a radius of 0.3 meters.
[0132] Exemplarily, after obtaining the current grid map, current position and initial docking position corresponding to the robot, the robot calculates the straight-line distance between the current position and the initial docking position to obtain the initial distance to be run of the robot, and compares the initial distance to be run with the initial distance threshold. If the initial distance to be run is greater than or equal to the initial distance threshold, the robot continues to run based on the initial path; if the initial distance to be run is less than the initial distance threshold, the robot obtains an initial detection grid located within a circle with the initial docking position as the center and the preset coverage distance as the radius from the current grid map based on the initial docking position and the preset coverage distance, and obtains the obstacle identifier corresponding to the initial detection grid. If the obstacle identifiers of all the initial detection grids are the second identifier, the robot continues to run based on the initial path and runs to the initial docking position; if the obstacle identifier of the initial detection grid is the first identifier, it is determined that there is an obstacle near the initial docking position, and the robot cannot run to the initial docking position, and steps 204 to 212 are executed. The preset coverage distance refers to the radius of the initial detection grid. The preset coverage distance can be determined according to the width or radius of the robot. If the robot is a square robot, the pre-coverage distance is greater than half the width of the robot. If the robot is a circular robot, the pre-coverage distance is greater than the radius of the robot.
[0133] In one embodiment, after obtaining the current grid map, current position and initial docking position corresponding to the robot, the robot calculates the straight-line distance between the current position and the initial docking position to obtain the initial distance to be run of the robot, and compares the initial distance to be run with an initial distance threshold. If the initial distance to be run is greater than or equal to the initial distance threshold, the robot continues to run based on the initial path. In the process of running based on the initial path, based on a preset time interval, the robot obtains the updated grid map and updated position corresponding to the robot, uses the updated grid map as the current grid map, uses the updated position as the current position, and repeats the steps of determining the initial distance to be run of the robot based on the current position and the initial docking position; and comparing the initial distance to be run with the initial distance threshold until the initial distance to be run is less than the initial distance threshold.
[0134] In this embodiment, by comparing the initial distance to be run with the initial distance threshold, when the initial distance to be run is less than the initial distance threshold, the initial detection grid is obtained from the current grid map based on the initial docking position, that is, when the distance to be run from the robot to the initial docking position is less than the initial distance threshold, the obstacle data measured by the robot's sensor is more accurate, and the obstacle identification of the initial detection grid can be used to determine whether there is an obstacle near the initial docking position and whether the robot can run to the initial docking position. If there is an obstacle near the initial docking position, the robot cannot run to the initial docking position, and the target docking position is re-determined. When the initial distance to be run is equal to or greater than the initial distance threshold, the robot continues to run along the initial path until the initial distance to be run is less than the initial distance threshold, and then it is determined whether repositioning is required, thereby saving computing resources.
[0135] In one embodiment, after determining the target stop position based on the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set, the method further includes:
[0136] Based on a preset time interval, the target running position of the robot is obtained; based on the target running position and the target docking position, the target to-be-running distance of the robot is determined; the target to-be-running distance is compared with a target distance threshold, and when the target to-be-running distance is greater than the target distance threshold, an updated grid map is obtained; based on the target docking position, a target detection grid is obtained from the updated grid map; when the obstacle identifier of the target detection grid is a second identifier, the target docking position is determined as the updated target docking position; the second identifier indicates that there is no obstacle in the grid.
[0137] Among them, the preset time interval refers to a preset time interval, which can be determined according to the length of the initial path and the running speed of the robot. The target running position refers to the current running position of the robot. The target waiting distance refers to the straight-line distance between the target running position and the target docking position. The target distance threshold refers to a preset distance threshold, which can be determined according to the running speed of the robot. The faster the running speed of the robot, the larger the target distance threshold. For example, the target distance threshold is set to 0.37 meters or 0.5 meters. The target detection grid refers to the grid located around the target docking position, which can be understood as the grid occupied by the robot docked at the target docking position. The target detection grid can be determined according to the target docking position and the preset coverage distance. The preset coverage distance can be determined according to the width of the robot. The target distance threshold is greater than the width of the robot to avoid the robot from scratching and getting stuck with obstacles when it runs to the target docking position. For example, the robot is a circular robot with a radius of 0.27 meters. The target detection grid is a grid within a circle with a radius of 0.3 meters and a target docking position as the center.
[0138] Exemplarily, after determining the target docking position, the robot generates a target path based on the current position and the target docking position. In the process of the robot running along the target path, the robot obtains the target running position of the robot based on a preset time interval, calculates the straight-line distance between the target running position and the target docking position, obtains the target distance to be run of the robot, compares the target distance to be run with the target distance threshold, and obtains an updated grid map when the target distance to be run is greater than the target distance threshold. Based on the target docking position and the preset coverage distance, the robot obtains a target detection grid located within a circle with the target docking position as the center and the preset coverage distance as the radius from the updated grid map, and obtains an obstacle identifier corresponding to the target detection grid. If the obstacle identifiers of all the target detection grids are the second identifier, it is determined that there is no obstacle near the target docking position, and the robot can run to the target docking position, and the target docking position is determined as the updated target docking position. When the target distance to be run is equal to or less than the target distance threshold, the robot runs to the target running position based on the target path.
[0139] In one embodiment, if the obstacle mark of the target detection grid is the first mark, it is determined that there is an obstacle near the target docking position and the robot cannot run to the target docking position, then steps 202 to 212 are executed to obtain an updated target docking position.
[0140] In this embodiment, while the robot is running towards the target docking position, it determines whether there are obstacles near the target docking position and whether the robot has run to the target docking position at preset time intervals. If it is determined that there are no obstacles near the target docking position, the robot can run to the target docking position and the target docking position is determined as the updated target docking position, that is, there is no need to redetermine the target docking position; if it is determined that there are obstacles near the target docking position and the robot cannot run to the target docking position, it is necessary to redetermine the target docking position, thereby ensuring that the robot can definitely run to the target docking position, further improving the accuracy of the target docking position.
[0141] In an exemplary embodiment, the robot is a food delivery robot, which needs to deliver food to a target table, and the docking position determination process, such as Fig.12 As shown, including:
[0142] The robot obtains an initial path. In the process of running along the initial path, based on a preset time interval, the robot obtains the current grid map, current position and initial docking position corresponding to the robot, calculates the straight-line distance between the current position and the initial docking position, obtains the robot's initial distance to be run, and compares the initial distance to be run with the initial distance threshold. If the initial distance to be run is greater than or equal to the initial distance threshold, the robot continues to run to the initial docking position based on the initial path. When the robot runs to the initial docking position, the run ends.
[0143] If the initial distance to be run is less than the initial distance threshold, the robot obtains the initial detection grid located in the circle range with the initial stop position as the center and the preset coverage distance as the radius from the current grid map based on the initial stop position and the preset coverage distance, and obtains the obstacle identification corresponding to the initial detection grid. If the obstacle identification of all the initial detection grids is the second identification, the robot continues to run to the initial stop position based on the initial path, and ends the operation when the robot runs to the initial stop position. The second identification indicates that there is no obstacle in the grid.
[0144] If the obstacle mark of the initial detection grid is the first mark, it is determined that there is an obstacle near the initial docking position, and the robot cannot run to the initial docking position, wherein the first mark indicates that there is an obstacle in the grid; then it is further determined whether the target docking position has been generated, that is, whether the target docking position has been generated before the robot runs this time. If the target docking position has been generated, it is determined whether the straight-line distance (target waiting distance) between the current running position (target running position) of the robot and the target docking position is less than the target distance threshold. If it is less than the target distance threshold, the robot docks at the target docking position and ends the run. If the target waiting distance is greater than the target distance threshold, it is determined whether there are obstacles in the grid (target detection grid) around the target docking position; if there are no obstacles, the robot runs to the target docking position and ends the run.
[0145] If the target docking position has not been generated before the robot runs this time, or there are obstacles in the grids (target detection grids) around the target docking position, the robot obtains the obstacle grid position corresponding to the obstacle grid with the obstacle identifier as the first identifier from the current grid map, calculates the straight-line distance between the grid position of the grid and the obstacle grid position of the obstacle grid, compares the straight-line distances corresponding to the grid and multiple obstacle grids respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the first distance between the grid and the obstacle; compares the first distance with the first threshold, and if the first distance is greater than the first threshold, determines the grid corresponding to the first distance as the first candidate grid, and combines multiple first candidate grids into a first candidate grid set.
[0146] For each grid, the robot obtains the grid position of the grid, calculates the straight-line distance between the grid position and the initial docking position, obtains the second distance between the grid and the initial docking position, determines the grid whose second distance is less than the second threshold as the second candidate grid, and forms a second candidate grid set with multiple second candidate grids.
[0147] The robot determines a target dining table corresponding to the initial docking position from a topological map based on an initial docking position, determines a neighboring dining table corresponding to the target dining table from a topological map based on the target dining table and a preset radius, and obtains the neighboring dining table position of the neighboring dining table; for each grid, calculates the straight-line distance between the grid position of the grid and the neighboring dining table position of the neighboring dining table, compares the straight-line distances corresponding to the grid and a plurality of neighboring dining tables respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the third distance corresponding to the grid; compares the second distance corresponding to the grid with the third distance corresponding to the grid, determines a grid having a third distance greater than the second distance as a third candidate grid, and groups the plurality of third candidate grids into a third candidate grid set.
[0148] The robot subtracts the initial docking position from the current position to obtain a first vector, and based on the first vector, determines a first running direction of the robot to the initial docking position; for each grid, the robot subtracts the grid position of the grid from the current position to obtain a second vector, and based on the second vector, determines a second running direction of the robot to the grid, and compares the second running direction with the first running direction. If the second running direction is the same as the first running direction, the grid is determined as a fourth candidate grid, and multiple fourth candidate grids are combined into a fourth candidate grid set.
[0149] The robot obtains the intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set to obtain an initial grid set. For each initial grid in the initial grid set, the robot obtains the grid position of the initial grid, calculates the straight-line distance between the grid position of the initial grid and the current position, obtains the distance between the initial grid and the current position, compares the distances corresponding to multiple initial grids, obtains the minimum distance, and determines the initial grid corresponding to the minimum distance as the starting grid; based on the grid position of the initial grid, the adjacent grids of the initial grid are determined, and for each adjacent grid, it is determined whether the adjacent grid is located in the initial grid set. If there is an adjacent grid located in the initial grid set, it is determined that there is an initial grid connected to the starting grid, the starting grid is determined as the target grid, and the initial grid connected to the starting grid is determined as the new starting grid. The above steps are repeated until there is no initial grid connected to the starting grid, and the multiple target grids are combined into a target grid set.
[0150] The robot compares the first distances corresponding to all target grids to obtain the minimum first distance and the maximum first distance, and substitutes the minimum first distance and the maximum first distance into formula (1) to obtain a first corresponding relationship; compares the second distances corresponding to all target grids to obtain the minimum second distance and the maximum second distance, and substitutes the minimum second distance and the maximum second distance into formula (2) to obtain a second corresponding relationship; compares the fourth distances corresponding to all target grids to obtain the minimum fourth distance and the maximum fourth distance, and substitutes the minimum fourth distance and the maximum fourth distance into formula (3) to obtain a third corresponding relationship; compares the fifth distances corresponding to all target grids to obtain the minimum fifth distance and the maximum fifth distance, and substitutes the minimum fifth distance and the maximum fifth distance into formula (4) to obtain a fourth corresponding relationship.
[0151] For each target grid in the target grid set, the first distance corresponding to the target grid is substituted into the first corresponding relationship to obtain the first cost corresponding to the target grid, the second distance corresponding to the target grid is substituted into the second corresponding relationship to obtain the second cost corresponding to the target grid, the fourth distance corresponding to the target grid is substituted into the third corresponding relationship to obtain the third cost corresponding to the target grid, the fifth distance corresponding to the target grid is substituted into the fourth corresponding relationship to obtain the fourth cost corresponding to the target grid, and the first cost, second cost, third cost and fourth cost corresponding to the target grid are substituted into formula (5) to obtain the total cost corresponding to the target grid.
[0152] The total costs corresponding to all target grids are compared to obtain the minimum total cost, and the grid position of the target grid corresponding to the minimum total cost is determined as the target docking position.
[0153] After the target docking position is determined, a target path is generated based on the current position and the target docking position. The robot runs to the target docking position based on the target path and ends the operation.
[0154] In an exemplary embodiment, the robot is a food delivery robot, which needs to deliver food to a target table. The docking position determination process includes:
[0155] The robot obtains an initial path, and in the process of running along the initial path, based on a preset time interval, obtains the current grid map, current position and initial docking position corresponding to the robot, calculates the straight-line distance between the current position and the initial docking position, obtains the initial distance to be run of the robot, and compares the initial distance to be run with an initial distance threshold. If the initial distance to be run is greater than or equal to the initial distance threshold, the robot continues to run to the initial docking position based on the initial path. In the process of running based on the initial path, based on a preset time interval, obtains the updated grid map and updated position corresponding to the robot, uses the updated grid map as the current grid map, uses the updated position as the current position, and repeatedly executes the steps of determining the initial distance to be run of the robot based on the current position and the initial docking position, and comparing the initial distance to be run with the initial distance threshold until the initial distance to be run is less than the initial distance threshold.
[0156] If the initial distance to be run is less than the initial distance threshold, the robot obtains the initial detection grid located in the circle range with the initial docking position as the center and the preset coverage distance as the radius from the current grid map based on the initial docking position and the preset coverage distance, and obtains the obstacle identification corresponding to the initial detection grid. If the obstacle identification of all the initial detection grids is the second identification, the robot continues to run to the initial docking position based on the initial path. In the process of running based on the initial path, the robot repeats the execution based on the preset time interval, obtains the initial detection grid located in the circle range with the initial docking position as the center and the preset coverage distance as the radius from the current grid map, and obtains the obstacle identification corresponding to the initial detection grid, until the robot runs to the initial docking position, or the obstacle identification of the initial detection grid is the first identification.
[0157] If the obstacle mark of the initial detection grid is the first mark, it is determined that there is an obstacle near the initial stop position and the robot cannot run to the initial stop position. The first mark indicates that there is an obstacle in the grid, and the second mark indicates that there is no obstacle in the grid.
[0158] The robot obtains the obstacle grid position corresponding to the obstacle grid with the obstacle identifier as the first identifier from the current grid map, calculates the straight-line distance between the grid position of the grid and the obstacle grid position of the obstacle grid, compares the straight-line distances corresponding to the grid and multiple obstacle grids respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the first distance between the grid and the obstacle; compares the first distance with a first threshold, and if the first distance is greater than the first threshold, determines the grid corresponding to the first distance as a first candidate grid, and combines multiple first candidate grids into a first candidate grid set.
[0159] For each grid, the robot obtains the grid position of the grid, calculates the straight-line distance between the grid position and the initial docking position, obtains the second distance between the grid and the initial docking position, determines the grid whose second distance is less than the second threshold as the second candidate grid, and forms a second candidate grid set with multiple second candidate grids.
[0160] The robot determines a target dining table corresponding to the initial docking position from a topological map based on an initial docking position, determines a neighboring dining table corresponding to the target dining table from a topological map based on the target dining table and a preset radius, and obtains the neighboring dining table position of the neighboring dining table; for each grid, calculates the straight-line distance between the grid position of the grid and the neighboring dining table position of the neighboring dining table, compares the straight-line distances corresponding to the grid and a plurality of neighboring dining tables respectively, obtains the minimum straight-line distance, and determines the minimum straight-line distance as the third distance corresponding to the grid; compares the second distance corresponding to the grid with the third distance corresponding to the grid, determines a grid having a third distance greater than the second distance as a third candidate grid, and groups the plurality of third candidate grids into a third candidate grid set.
[0161] The robot subtracts the initial docking position from the current position to obtain a first vector, and based on the first vector, determines a first running direction of the robot to the initial docking position; for each grid, the robot subtracts the grid position of the grid from the current position to obtain a second vector, and based on the second vector, determines a second running direction of the robot to the grid, and compares the second running direction with the first running direction. If the second running direction is the same as the first running direction, the grid is determined as a fourth candidate grid, and multiple fourth candidate grids are combined into a fourth candidate grid set.
[0162] The robot obtains the intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set to obtain an initial grid set. For each initial grid in the initial grid set, the robot obtains the grid position of the initial grid, calculates the straight-line distance between the grid position of the initial grid and the current position, obtains the distance between the initial grid and the current position, compares the distances corresponding to multiple initial grids, obtains the minimum distance, and determines the initial grid corresponding to the minimum distance as the starting grid; based on the grid position of the initial grid, the adjacent grids of the initial grid are determined, and for each adjacent grid, it is determined whether the adjacent grid is located in the initial grid set. If there is an adjacent grid located in the initial grid set, it is determined that there is an initial grid connected to the starting grid, the starting grid is determined as the target grid, and the initial grid connected to the starting grid is determined as the new starting grid. The above steps are repeated until there is no initial grid connected to the starting grid, and the multiple target grids are combined into a target grid set.
[0163] The robot compares the first distances corresponding to all target grids to obtain the minimum first distance and the maximum first distance, and substitutes the minimum first distance and the maximum first distance into formula (1) to obtain a first corresponding relationship; compares the second distances corresponding to all target grids to obtain the minimum second distance and the maximum second distance, and substitutes the minimum second distance and the maximum second distance into formula (2) to obtain a second corresponding relationship; compares the fourth distances corresponding to all target grids to obtain the minimum fourth distance and the maximum fourth distance, and substitutes the minimum fourth distance and the maximum fourth distance into formula (3) to obtain a third corresponding relationship; compares the fifth distances corresponding to all target grids to obtain the minimum fifth distance and the maximum fifth distance, and substitutes the minimum fifth distance and the maximum fifth distance into formula (4) to obtain a fourth corresponding relationship.
[0164] For each target grid in the target grid set, the first distance corresponding to the target grid is substituted into the first corresponding relationship to obtain the first cost corresponding to the target grid, the second distance corresponding to the target grid is substituted into the second corresponding relationship to obtain the second cost corresponding to the target grid, the fourth distance corresponding to the target grid is substituted into the third corresponding relationship to obtain the third cost corresponding to the target grid, the fifth distance corresponding to the target grid is substituted into the fourth corresponding relationship to obtain the fourth cost corresponding to the target grid, and the first cost, second cost, third cost and fourth cost corresponding to the target grid are substituted into formula (5) to obtain the total cost corresponding to the target grid.
[0165] The total costs corresponding to all target grids are compared to obtain the minimum total cost, and the grid position of the target grid corresponding to the minimum total cost is determined as the target docking position.
[0166] After determining the target docking position, a target path is generated based on the current position and the target docking position. In the process of the robot running along the target path, the target operating position of the robot is obtained based on a preset time interval, and the straight-line distance between the target operating position and the target docking position is calculated to obtain the target distance to be run of the robot. The target distance to be run is compared with the target distance threshold. When the target distance to be run is equal to or less than the target distance threshold, the robot runs to the target operating position based on the target path. When the target distance to be run is greater than the target distance threshold, an updated grid map is obtained. Based on the target docking position and the preset coverage distance, the robot obtains a target detection grid located within a circle with the target docking position as the center and the preset coverage distance as the radius from the updated grid map, and obtains an obstacle identifier corresponding to the target detection grid. If the obstacle identifiers of all target detection grids are the second identifier, it is determined that there are no obstacles near the target docking position, and the robot can run to the target docking position, and the target docking position is determined as the updated target docking position; if the obstacle identifier of the target detection grid is the first identifier, it is determined that there are obstacles near the target docking position, and the robot cannot run to the target docking position, and the above steps of determining the target docking position are repeated.
[0167] In the above-mentioned method for determining the docking position, a first candidate grid set is determined by the first distance between the grid and the obstacle, that is, grids whose first distance to the obstacle is less than the safety distance are excluded, so as to avoid collision between the robot and the obstacle; a second candidate grid set is determined by the second distance between the grid and the initial docking position, that is, grids far from the initial docking position are excluded, so as to avoid the robot being unable to accurately deliver materials to the target table; a third candidate grid set is determined by the second distance corresponding to the grid and the third distance between the grid and the adjacent table, that is, grids that are closer to the adjacent table than to the target table are excluded, so as to avoid the robot mistakenly delivering materials to the adjacent table. ; The fourth candidate grid set is determined through the current position and the initial docking position, that is, the grids that are opposite to the current running direction of the robot are excluded to prevent the robot from running in the direction opposite to the current running direction and being unable to deliver materials to the target table; based on the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set, the target docking position is determined, that is, the grid that satisfies the conditions that the distance to the obstacle is greater than the safety distance, is close to the initial docking position, is closer to the target table than the adjacent tables, and the direction from the current position to the grid is the same as the current running direction is determined as the target docking position, thereby improving the accuracy of the target docking position.
[0168] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0169] Based on the same inventive concept, the embodiment of the present application also provides a docking position determination device for implementing the docking position determination method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more docking position determination device embodiments provided below can refer to the limitations of the docking position determination method above, and will not be repeated here.
[0170] In one embodiment, Fig.13 As shown, a parking position determination device is provided, including: an acquisition module 1302, a first determination module 1304, a second determination module 1306, a third determination module 1308, a fourth determination module 1310 and a parking position determination module 1312, wherein:
[0171] An acquisition module 1302 is used to acquire a current grid map, a current position, and an initial docking position corresponding to the robot; the current grid map includes a plurality of grids;
[0172] A first determination module 1304 is used to determine a first candidate grid set based on a first distance between the grid and the obstacle;
[0173] A second determination module 1306, configured to determine a second candidate grid set based on a second distance between the grid and the initial stop position;
[0174] A third determination module 1308 is used to determine a third candidate grid set based on a second distance corresponding to the grid and a third distance between the grid and a neighboring object; the neighboring object refers to an object that is adjacent to the target object corresponding to the initial docking position;
[0175] A fourth determining module 1310 is configured to determine a fourth candidate grid set based on the current position and the initial stop position;
[0176] The docking position determination module 1312 is configured to determine a target docking position based on the first candidate grid set, the second candidate grid set, the third candidate grid set, and the fourth candidate grid set.
[0177] In one embodiment, the first determination module 1304 is also used to: determine the first distance between the grid and the obstacle based on the obstacle identification corresponding to the grid in the current grid map; compare the first distance corresponding to the grid with the first threshold, and when the first distance is greater than the first threshold, determine the grid as the first candidate grid; and obtain a first candidate grid set based on multiple first candidate grids.
[0178] In one embodiment, the third determination module 1308 is also used to: obtain the target object corresponding to the initial docking position, and the neighboring objects corresponding to the target object; determine the straight-line distance between the grid and the neighboring objects; compare multiple straight-line distances corresponding to the grid to obtain the minimum straight-line distance; determine the minimum straight-line distance as the third distance corresponding to the grid; compare the third distance corresponding to the grid with the second distance, and when the third distance is greater than the second distance, determine the grid as a third candidate grid; and obtain a third candidate grid set based on multiple third candidate grids.
[0179] In one embodiment, the fourth determination module 1310 is also used to: determine a first running direction of the robot to the initial docking position based on the current position and the initial docking position; determine a second running direction of the robot to the grid based on the current position and the grid position corresponding to the grid; compare the second running direction with the first running direction, and if the second running direction is the same as the first running direction, determine the grid as a fourth candidate grid; and obtain a fourth candidate grid set based on multiple fourth candidate grids.
[0180] In one embodiment, the docking position determination module 1312 is further used to: find the intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set and the fourth candidate grid set to obtain an initial grid set; obtain a target grid set based on the connected initial grids in the initial grid set; and determine the target docking position based on the target grid set.
[0181] In one embodiment, the docking position determination module 1312 is also used to: determine the distance between the initial grid and the current position for each initial grid in the initial grid set; determine the initial grid corresponding to the smallest distance as the starting grid; if there is an initial grid connected to the starting grid, determine the starting grid as the target grid; determine the initial grid connected to the starting grid as the new starting grid, and repeat the step of determining the starting grid as the target grid if there is an initial grid connected to the starting grid; until there is no initial grid connected to the starting grid, and determine the target grid set based on multiple target grids.
[0182] In one embodiment, the docking position determination module 1312 is also used to: determine the fourth distance between the target grid and the current position for each target grid in the target grid set; obtain the initial path corresponding to the robot, and determine the fifth distance between the target grid and the initial path; determine the total cost corresponding to the target grid based on the first distance, second distance, fourth distance and fifth distance corresponding to the target grid; and determine the grid position of the target grid corresponding to the minimum total cost as the target docking position.
[0183] In one embodiment, the docking position determination module 1312 is also used to: determine the first cost corresponding to the target grid based on the first distance corresponding to the target grid; the first cost is proportional to the first distance; determine the second cost corresponding to the target grid based on the second distance corresponding to the target grid; the second cost is proportional to the second distance; determine the third cost corresponding to the target grid based on the fourth distance corresponding to the target grid; the third cost is proportional to the fourth distance; determine the fourth cost corresponding to the target grid based on the fifth distance corresponding to the target grid; the fourth cost is inversely proportional to the fifth distance; determine the total cost corresponding to the target grid based on the first cost, the second cost, the third cost and the fourth cost.
[0184] In one embodiment, the acquisition module 1302 is also used to: determine the initial distance to be run of the robot based on the current position and the initial docking position; compare the initial distance to be run with the initial distance threshold; when the initial distance to be run is less than the initial distance threshold, obtain the initial detection grid from the current grid map based on the initial docking position; when the obstacle identifier of the initial detection grid is the first identifier, execute the step of determining the first candidate grid set based on the first distance between the grid and the obstacle; the first identifier indicates the presence of an obstacle in the grid.
[0185] In one embodiment, the docking position determination module 1312 is also used to: obtain the target operating position of the robot based on a preset time interval; determine the target distance to be run of the robot based on the target operating position and the target docking position; compare the target distance to be run with the target distance threshold, and obtain an updated grid map when the target distance to be run is greater than the target distance threshold; obtain a target detection grid from the updated grid map based on the target docking position; determine the target docking position as the updated target docking position when the obstacle identifier of the target detection grid is the second identifier; the second identifier indicates that there is no obstacle in the grid.
[0186] Each module in the above-mentioned parking position determination device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of the processor in the robot in the form of hardware, or can be stored in the memory in the robot in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0187] In one embodiment, a robot is provided. The robot may be a terminal, and its internal structure diagram may be as follows: Fig.14 As shown. The robot includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the robot is used to provide computing and control capabilities. The memory of the robot includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the robot is used to exchange information between the processor and an external device. The communication interface of the robot is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for determining a docking position is implemented. The display unit of the robot is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the robot can be a touch layer covering the display screen, or a button, trackball or touchpad set on the robot shell, or an external keyboard, touchpad or mouse.
[0188] Those skilled in the art will understand that Fig.14The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the robot to which the scheme of the present application is applied. The specific robot may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0189] In one embodiment, a robot is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0190] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0191] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0192] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0193] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0194] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0195] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining a parking position, characterized in that: The method is used for a robot, comprising: Obtaining a current grid map, a current position, and an initial docking position corresponding to the robot; the current grid map includes a plurality of grids; Determining a first candidate grid set based on a first distance between the grid and the obstacle; determining a second candidate grid set based on a second distance between the grid and the initial docking position; Determining a third candidate grid set based on a second distance corresponding to the grid and a third distance between the grid and a neighboring object; the neighboring object refers to an object neighboring the target object corresponding to the initial docking position; Determining a fourth candidate grid set based on the current position and the initial stop position; Obtaining an initial grid set by finding an intersection of the first candidate grid set, the second candidate grid set, the third candidate grid set, and the fourth candidate grid set; Based on the connected initial grids in the initial grid set, a target grid set is obtained; Based on the target grid set, a target docking position is determined.
2. The method according to claim 1, characterized in that The determining a first candidate grid set based on a first distance between the grid and the obstacle comprises: Determine a first distance between the grid and the obstacle based on an obstacle identifier corresponding to the grid in the current grid map; Compare a first distance corresponding to the grid with a first threshold, and when the first distance is greater than the first threshold, determine the grid as a first candidate grid; Based on the plurality of first candidate grids, a first candidate grid set is obtained.
3. The method according to claim 1, characterized in that The determining of a third candidate grid set based on the second distance corresponding to the grid and the third distance between the grid and the neighboring object comprises: Acquire a target object corresponding to the initial docking position and a neighboring object corresponding to the target object; determining a straight-line distance between the grid and the neighboring object; Comparing multiple straight-line distances corresponding to the grids to obtain the minimum straight-line distance; Determine the minimum straight-line distance as the third distance corresponding to the grid; Compare the third distance corresponding to the grid with the second distance, and determine the grid as a third candidate grid when the third distance is greater than the second distance; Based on the multiple third candidate grids, a third candidate grid set is obtained.
4. The method according to claim 1, characterized in that The step of determining a fourth candidate grid set based on the current position and the initial stop position includes: Based on the current position and the initial docking position, determining a first running direction for the robot to run to the initial docking position; Based on the current position and the grid position corresponding to the grid, determining a second running direction for the robot to run to the grid; comparing the second running direction with the first running direction, and determining the grid as a fourth candidate grid when the second running direction is the same as the first running direction; Based on the multiple fourth candidate grids, a fourth candidate grid set is obtained.
5. The method according to claim 4, characterized in that The step of determining a first running direction of the robot to run to the initial docking position based on the current position and the initial docking position includes: Subtract the initial stop position from the current position to obtain a first vector; Based on the first vector, determining a first running direction of the robot to run to the initial docking position; The step of determining, based on the current position and the grid position corresponding to the grid, a second running direction of the robot to run to the grid comprises: Subtract the grid position corresponding to the grid from the current position to obtain a second vector; Based on the second vector, a second running direction of the robot to the grid is determined.
6. The method according to claim 1, characterized in that The step of obtaining a target grid set based on connected initial grids in the initial grid set includes: For each initial grid in the initial grid set, determining a distance between the initial grid and the current position; Determine the initial grid corresponding to the smallest separation distance as the starting grid; If there is an initial grid connected to the starting grid, determining the starting grid as the target grid; Determine the initial grid connected to the starting grid as a new starting grid, and repeat the step of determining the starting grid as a target grid if there is an initial grid connected to the starting grid; Until there is no initial grid connected to the starting grid, a target grid set is determined based on the plurality of target grids.
7. The method according to claim 1, characterized in that The step of determining a target docking position based on the target grid set includes: For each target grid in the target grid set, determining a fourth distance between the target grid and the current position; Acquire an initial path corresponding to the robot, and determine a fifth distance between the target grid and the initial path; Determine a total cost corresponding to the target grid based on a first distance, a second distance, a fourth distance, and a fifth distance corresponding to the target grid; The grid position of the target grid corresponding to the minimum total cost is determined as the target parking position.
8. The method according to claim 7, characterized in that The determining the total cost corresponding to the target grid based on the first distance, the second distance, the fourth distance, and the fifth distance corresponding to the target grid includes: Determine a first cost corresponding to the target grid based on a first distance corresponding to the target grid; the first cost is proportional to the first distance; Determining a second cost corresponding to the target grid based on a second distance corresponding to the target grid, wherein the second cost is proportional to the second distance; Determining a third cost corresponding to the target grid based on a fourth distance corresponding to the target grid; the third cost is proportional to the fourth distance; Determining a fourth cost corresponding to the target grid based on a fifth distance corresponding to the target grid; the fourth cost is in inverse proportion to the fifth distance; Based on the first cost, the second cost, the third cost and the fourth cost, a total cost corresponding to the target grid is determined.
9. The method according to claim 1, characterized in that: After obtaining the current grid map, current position and initial docking position corresponding to the robot, the method further comprises: Determining an initial distance to be traveled of the robot based on the current position and the initial docking position; Comparing the initial distance to be run with an initial distance threshold; When the initial waiting distance is less than the initial distance threshold, acquiring an initial detection grid from the current grid map based on the initial parking position; In the case where the obstacle identifier of the initial detection grid is a first identifier, the step of determining a first candidate grid set based on a first distance between the grid and the obstacle is performed; the first identifier indicates that an obstacle exists in the grid.
10. The method according to any one of claims 1 to 9, characterized in that After determining the target docking position, the method further includes: Based on a preset time interval, obtaining a target operating position of the robot; Determining a target distance to be traveled by the robot based on the target operating position and the target docking position; Compare the target distance to be run with a target distance threshold, and when the target distance to be run is greater than the target distance threshold, obtain an updated grid map; Based on the target parking position, obtaining a target detection grid from the updated grid map; In the case where the obstacle identifier of the target detection grid is a second identifier, the target docking position is determined as an updated target docking position; the second identifier indicates that there is no obstacle in the grid.
11. A robot comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
