Path planning method and device, robot and computer-readable storage medium
By obtaining the path points and attributes in the map and planning the target route in combination with the path distance and attributes, the problem of inefficient robot movement in the prior art is solved, and a path planning method to reach the termination path point in the shortest time is realized.
Patent Information
- Application Number
- CN202210943151.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-08-08
AI Technical Summary
The existing path planning method only considers path distance and fails to complete path planning in the shortest time, resulting in inefficient robot movement.
Optimize the robot movement mode to reduce pose adjustment time by obtaining path points and path attributes in the map, including forward, backward and transverse paths, and plan target routes in combination with path distance and attributes.
It realizes that the robot can adapt to the movement mode of each path while ensuring the shortest movement distance, reduce the attitude adjustment time, so as to reach the termination path point at the fastest speed and improve transportation efficiency.
Smart Images

Figure CN115202364B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of path planning technology, and in particular to a path planning method and device, a robot, and a computer-readable storage medium. Background Art
[0002] Existing Dijkstra-based path planning methods typically select the shortest path based on distance. For example, from point A to point B, there is typically only one shortest path, and the resulting planning result is only one path. However, depending on the actual application scenario, simply planning the shortest path may not guarantee the fastest possible travel time from the starting point to the destination. Summary of the Invention
[0003] In view of this, embodiments of the present application provide a path planning method and apparatus, a robot, and a computer-readable storage medium, so that the robot can move from a starting point to an end point along a planned path in the shortest time.
[0004] The path planning method of the embodiment of the present application includes obtaining a preset map, the map including multiple path points and a path connecting two adjacent path points, the path having corresponding path attributes, the path attributes including at least one of a forward path, a backward path and a lateral path; planning a target route connecting a starting path point to an ending path point based on the distance of the path and the path attributes, the starting path point being any of the path points, and the ending path point being any of the path points other than the starting path point.
[0005] The path planning device of the embodiment of the present application includes an acquisition module and a planning module. The acquisition module is used to acquire a preset map, wherein the map includes multiple path points and paths connecting two adjacent path points, and the paths have corresponding path attributes, wherein the path attributes include at least one of a forward path, a backward path, and a lateral path; the planning module is used to plan a target route connecting a starting path point to an ending path point based on the distance of the path and the path attributes, wherein the starting path point is any of the path points, and the ending path point is any of the path points other than the starting path point.
[0006] A robot according to an embodiment of the present application includes a processor configured to execute a path planning method. The path planning method includes obtaining a preset map, the map including a plurality of path points and a path connecting two adjacent path points, the path having corresponding path attributes, the path attributes including at least one of a forward path, a backward path, and a lateral path; and planning a target route connecting a starting path point to an ending path point based on the distance of the path and the path attributes, the starting path point being any of the path points, and the ending path point being any of the path points other than the starting path point.
[0007] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a path planning method is implemented. The path planning method includes obtaining a preset map, wherein the map includes a plurality of path points and a path connecting two adjacent path points, wherein the path has corresponding path attributes, and the path attributes include at least one of a forward path, a backward path, and a lateral path; and planning a target route connecting a starting path point to an ending path point based on the distance of the path and the path attributes, wherein the starting path point is any of the path points, and the ending path point is any of the path points other than the starting path point.
[0008] The path planning method and device, robot and computer-readable storage medium of the present application obtain path points in a preset map and the path connecting two adjacent path points, and determine the path attributes of each path. When planning the path from the starting path point to the ending path point, not only the distance of the path is considered, but also the path attributes that can determine the movement mode of the robot when moving on the path are considered. Therefore, when the robot moves along the planned target route, it moves in accordance with the movement mode of each path as much as possible, reducing the time required for posture adjustment, so that it can reach the ending path point in the shortest possible time.
[0009] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0011] Figure 1 is a flowchart of a path planning method according to certain embodiments of the present application;
[0012] Figure 2 is a schematic diagram of a scenario of a path planning method in certain embodiments of the present application;
[0013] Figure 3 is a flowchart of a path planning method according to certain embodiments of the present application;
[0014] Figure 4 is a flowchart of a path planning method according to certain embodiments of the present application;
[0015] Figure 5 is a flowchart of a path planning method according to certain embodiments of the present application;
[0016] Figure 6 is a schematic diagram of a module of a path planning device according to certain embodiments of the present application;
[0017] Figure 7 is a schematic plan view of a robot according to certain embodiments of the present application; and
[0018] Figure 8 It is a schematic diagram of the interaction between a computer-readable storage medium and a processor in certain embodiments of the present application. DETAILED DESCRIPTION
[0019] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be understood as limiting the embodiments of the present application.
[0020] First, the nouns appearing in this application are explained below:
[0021] Dijkstra's algorithm is a shortest path algorithm that finds the shortest path from one vertex to all other vertices. It solves the shortest path problem in weighted graphs. The main feature of Dijkstra's algorithm is that it starts from a starting point and uses a greedy algorithm to traverse the adjacent nodes of the nearest unvisited vertex until it reaches the end point.
[0022] An Automated Guided Vehicle (AGV) is a transport vehicle equipped with electromagnetic or optical automatic navigation devices, capable of traveling along a prescribed route and equipped with safety features and various loading and unloading functions. These vehicles, which do not require a driver in industrial applications, are powered by rechargeable batteries. Their path and behavior are typically controlled by a computer or by electromagnetic tracks attached to the floor. The tracks provide information for the AGV's movement and actions.
[0023] See also Figure 1 , the path planning method of the embodiment of the present application includes:
[0024] Step 011: Obtain a preset map, the map including multiple path points and a path connecting two adjacent path points, the path having corresponding path attributes, and the path attributes including at least one of a forward path, a backward path, and a lateral path.
[0025] Specifically, in order to accurately plan the path, it is necessary to first obtain a map of the scene for the path planning scenario. The path points in the map and the paths connecting two adjacent path points can be marked in advance. By establishing a high-precision map of the scene, the accuracy of path planning can be improved.
[0026] It is understandable that for some paths in the map, due to the width limitation of the path or the obstruction of fixed objects around the path, the path may not be able to support all movement modes. For example, when an AGV moves in a warehouse area and transports goods, the movement modes of the AGV may include forward, backward and lateral movement, etc. However, the width of a specific path in the map is too narrow to be able to move horizontally, or the end point of the path is the unloading position, and the AGV needs to move forward along the path to transport the goods to the unloading position and face the unloading position. At this time, the path cannot move horizontally or backward. Therefore, when establishing a map, the path attributes of each path can be set according to the actual scenario and usage requirements to determine the movement modes that each path can support. For example, the path attributes include forward path, backward path and lateral movement path, which correspond to forward, backward and lateral movement in the movement mode respectively. This is conducive to subsequent path planning.
[0027] like Figure 2 As shown, the path points of the map include 1 to 7. For example, the path between path point 1 and path point 2 can move forward and backward, and the path attributes of the path between path point 1 and path point 2 include a forward path and a backward path. To facilitate path planning, although there is only one actual path between path point 1 and path point 2, the path can be a path with different path attributes. For example, the path between path point 1 and path point 2 includes path S11 with a forward path attribute and path S12 with a backward path attribute.
[0028] Step 012: Plan a target route connecting the starting path point to the ending path point based on the path distance and path attributes. The starting path point is any path point, and the ending path point is any path point other than the starting path point.
[0029] Specifically, after acquiring a map, the path points, paths, and path attributes of the paths in the map can be determined. During path planning, the target route is planned based on the distances and path attributes of multiple paths connecting the starting and ending path points. This allows the robot to move along the target route in a movement pattern that adapts to the path attributes of each path while minimizing the travel distance. This reduces the time required for posture adjustment and allows the robot to reach the ending path point in the shortest possible time.
[0030] The path planning method of the present application obtains path points in a preset map and the paths connecting two adjacent path points, and determines the path attributes of each path. When planning the path from the starting path point to the ending path point, it not only considers the distance of the path, but also considers the path attributes that can determine the movement mode of the robot when moving on the path. In this way, when the robot moves along the planned target route, it moves in a movement mode that adapts to the path attributes of each path while ensuring the shortest moving distance as much as possible, reducing the time required for posture adjustment, so that it can reach the ending path point in the shortest possible time.
[0031] See also Figure 3 Optionally, step 012: planning a target route connecting the starting path point to the ending path point based on the path distance and path attributes may include:
[0032] Step 0121: Obtain a saved route connecting the starting path point and any path point other than the starting path point based on the path distance and path attributes;
[0033] Step 0122: Determine the target route based on the robot's current posture information and the loss value of the saved route corresponding to the terminal path point.
[0034] Specifically, when performing path planning (such as the first path planning), all optional routes between any two path points in the map can be planned. The optional paths will not only consider the shortest distance of the path, but also consider the path attributes in the route, and determine the optional routes composed of paths with the same path attributes and the optional routes composed of paths with different path attributes, thereby obtaining multiple optional routes to adapt to different usage scenarios and ensure that the optimal target route can be found from the optional routes in different usage scenarios.
[0035] Then, you can pre-save a saved route connecting any two waypoints, so that the starting and ending points can be any two different waypoints. This allows you to directly obtain the saved route connecting the starting and ending points when planning a target route between any starting and ending points, making it easy to quickly determine the target route. In this way, you can obtain a saved route connecting any two waypoints on the map.
[0036] Alternatively, for a specific scenario, the starting path point is generally fixed. For example, in a warehouse scenario, there is generally only one entrance as the starting path point for warehousing. In this case, you only need to plan an optional route between the starting path point and other path points outside the starting path point, and save it as a saved route connecting the starting path point to other path points outside the starting path point.
[0037] After determining a saved route connecting any two waypoints on the map, you can retrieve multiple saved routes connecting the current starting waypoint and any other waypoint based on the starting waypoint of the current route planning. Then, based on the ending waypoint of the current route planning, determine a saved route connecting the current starting waypoint and the ending waypoint.
[0038] Finally, the robot's current posture information is combined to select the final target route from the saved routes connecting the current starting path point and the ending path point.
[0039] When selecting a route, you can first select one or more saved routes that match the robot's current posture information, allowing the robot to move along the selected saved routes without having to adjust its posture. For example, based on the robot's current posture information, you can select a saved route whose first segment is relative to the front of the robot and whose path attribute is forward; a saved route whose first segment is relative to the back of the robot and whose path attribute is backward; a saved route whose first segment is relative to the left of the robot and whose path attribute is lateral; and a saved route whose first segment is relative to the right of the robot and whose path attribute is lateral. When the robot moves in forward mode, the rear and front sides of the robot are distributed sequentially along the direction of movement, while the left and right sides of the robot are distributed perpendicular to the direction of movement.
[0040] On the premise of ensuring that the robot's posture adjustment takes the shortest time, the loss value of the selected saved route can be calculated. For example, the sum of the distances of all paths contained in the saved route is used as the loss value of the saved route, so that the saved route with the smallest loss value is selected as the final target route. The target route not only ensures that the robot's posture adjustment takes less time, but also the distance of the target route is shorter. It can achieve a balance between the shortest posture adjustment time of the robot and the shortest path of the target route, so that the robot can move from the starting path point to the ending path point at the fastest speed, thereby improving transportation efficiency.
[0041] See also Figure 2 and 4 Step 0121: Obtain a saved route connecting the starting path point and any path point other than the starting path point based on the path distance and path attributes, including:
[0042] Step 01211: Add the starting path point to the preset first list, and the parent node of the starting path point is empty;
[0043] Step 01212: When the current traversal node is the starting path point, the loss value of the starting path point is determined to be 0 and the saved path of the starting path point is empty. The loss value of the path point is determined based on the shortest distance from the path point to the starting path point.
[0044] Step 01213: The path point with the smallest loss value in the first list is taken as the current parent node and added to the preset second list;
[0045] Step 01214: Add the path points that are adjacent to and connectable to the current parent node and are not in the first list or the second list to the first list, and traverse the child nodes of the current parent node as the current traversal nodes in sequence. The child nodes of the current parent node are the path points in the first list that are adjacent to and connectable to the current parent node.
[0046] Step 01215: When the current traversal node is not the starting path point, the loss value of the current traversal node is updated according to the loss value of the current parent node;
[0047] Step 01216: Obtain the route to be saved that connects the starting path point and the current traversal node;
[0048] Step 01217: Determine the saved route connecting the starting path point and the current traversal node according to the route type of the route to be saved. The route type includes a single path type and a mixed path type. The route to be saved of the single path type contains all paths with the same path attributes, while the route to be saved of the mixed path type contains paths with different path attributes.
[0049] Step 01218: If the second list does not contain all the path points, the step of selecting the path point with the smallest loss value in the first list as the current parent node and adding it to the preset second list is entered again;
[0050] Specifically, when obtaining a saved route connecting the starting path point and any path point other than the starting path point, a first list and a second list can be defined first, the first list stores the path points that need to be traversed, and the second list is used to store the path points that have been traversed.
[0051] Then, the starting traversal point will be added to the first list for traversal at the beginning. When the current traversal node is the starting path point, since the route at this time only includes the starting path point, and the loss value of the path point is determined according to the shortest distance from the path point to the starting path point, the loss value of the starting path point is 0, and there is no saved route for the independent starting path point, that is, the saved path of the starting path point is empty.
[0052] After traversal of the starting pathpoint is complete, the starting pathpoint can be added to the second list as the current parent node of subsequent pathpoints to be traversed. Then, pathpoints that are adjacent to the current parent node and are not in the first or second lists and are connected are added to the first list. Generally, the starting pathpoint must have adjacent connectable pathpoints, otherwise path planning is meaningless. It is understood that if the current parent node's adjacent connectable pathpoint is in the first list, it does not need to be added to the first list. If the current parent node's adjacent connectable pathpoint is in the second list, it indicates that traversal has been completed and does not need to be added to the first list.
[0053] Among them, two path points that are adjacent and connected indicate that there is only one path between the two path points, that is, the two path points that are adjacent and connected are the two endpoints of one path.
[0054] At this time, the child nodes of the current parent node are taken as the current traversal nodes and traversed in sequence. The child nodes of the current parent node are the path points in the first list that are adjacent to and connectable to the current parent node.
[0055] When the current traversal node is not the starting path point, the loss value of the current traversal node is updated according to the loss value of the current parent node.
[0056] If the current traversal node is a newly added path point in the first list (i.e. the current traversal node has only one parent node in the second list), it means that the current traversal node has not been traversed and the loss value has not been saved. In this case, the loss value of the current traversal node can be calculated and saved based on the loss value of the current parent node and the distance of the path connecting the current parent node and the current traversal node. Figure 2As shown, the starting path point is 1, the current parent node is 2, and the current traversal node is 4. The loss value of the current traversal node 4 is determined based on the loss value of the current parent node 2 (10 meters) and the distance of the path connecting the current parent node 2 and the current traversal node 4 (10 meters), that is, 10+10=20 meters.
[0057] It is understandable that a path point may have multiple parent nodes at the same time. When each parent node is used as the current parent node, the child nodes of the current parent node need to be traversed, such as Figure 2 The path point 4 shown has parent nodes 2 and 3. For previously traversed child nodes, corresponding loss values already exist. When retraversing the same child node based on the current parent node, a new loss value can be obtained. The loss value of the currently traversed node needs to be updated based on the loss value of the current parent node to ensure that the loss value saved by the child node is always minimized, ensuring that the shortest path can be obtained, and facilitating the accuracy of subsequent selection of the path point with the smallest loss value in the first list.
[0058] Therefore, when the current traversal node is not a newly added path point in the first list (i.e., the current traversal node has multiple parent nodes in the second list), it means that the current traversal node has been traversed and a loss value has been saved. At this time, the loss value to be saved can be calculated based on the loss value of the current parent node and the distance of the path connecting the current parent node and the current traversal node; then, the loss value to be saved and the saved loss value of the current traversal node are compared to save the smaller of the loss value to be saved and the saved loss value of the current traversal node as the loss value of the current traversal node. Figure 2 As shown, the current parent node is 3 and the current traversed node is 4. The loss value to be saved is determined based on the loss value of the current parent node 3 (12 meters) and the distance of the path connecting the current parent node and the current traversed node (10 meters), that is, 12+10=22 meters; the saved loss value of the current traversed node 4 is 20 meters. Therefore, the smaller of the final saved loss value to be saved and the saved loss value of the current traversed node 4 (that is, 20 meters) is used as the loss value of the current traversed node 4.
[0059] When traversing the current traversal node (for example, the current traversal node is any child node of the current parent node), not only the loss value of the current traversal node will be updated, but also the route to be saved connecting the starting path point and the current traversal node will be obtained;
[0060] If the current parent node is the starting pathpoint, and the current traversal node is connected to the starting pathpoint via a path, there is no saved route for the starting pathpoint. In this case, the path connecting the starting pathpoint and the current traversal node is obtained as the route to be saved. Different path attributes can form different routes to be saved. For example, if the path attributes include forward and backward, you can obtain a route to be saved with the forward path attribute and a route to be saved with the backward path attribute.
[0061] In the case that the current parent node is not the starting path point but a traversed path point, the parent node has saved the saved route when the traversal is completed. The route to be saved connecting the starting path point and the current traversed node can be obtained based on the saved route of the current parent node and the path connecting the current traversed node and the current parent node. For example, paths with different path attributes can be connected on the basis of the saved route of the current parent node to generate a route to be saved connecting the starting path point and the current traversed node.
[0062] Similarly, if the current traversal node has multiple parent nodes, the current traversal node will be traversed multiple times, and each traversal will obtain the corresponding to-be-saved route under the current parent node. When obtaining the to-be-saved route, if the current traversal node does not have a corresponding saved route, it means that the current traversal node is traversed for the first time. At this time, the to-be-saved route can be directly determined based on the paths connecting all different path attributes of the current parent node and the current traversal node, and the saved routes corresponding to the current parent node. Figure 2 For example, if the current parent node is 2 and the current traversal node is 4, the route to be saved is determined based on the saved routes S11 and S12 of the current parent node 2, and the paths S31 and S32 with different path attributes connecting the current parent node 2 and the current traversal node 4, that is, there are 4 routes to be saved, namely S11+S31, S11+S32, S12+S31, and S12+S32.
[0063] If the current traversal node has a saved route, it means that the current traversal node is no longer the first traversal. At this time, the route to be saved can be determined based on the path connecting the current parent node and the current traversal node with all different path attributes, the saved route corresponding to the current parent node, and the saved route corresponding to the current traversal node. Figure 2For example, if the current parent node is 3 and the current traversal node is 4, first determine the to-be-saved route corresponding to the current parent node 3 based on the saved routes S21 and S22 of the current parent node 3, and the paths S41 and S42 connecting all different path attributes of the current parent node 3 and the current traversal node 4, i.e., four to-be-saved paths: S21+S41, S21+S42, S22+S41, and S22+S42. Then, based on the to-be-saved route corresponding to the current parent node 3 and the saved routes corresponding to the current traversal node, all the to-be-saved routes for the current traversal node 4 can be obtained, i.e., S11+S31, S11+S32, S12+S31, S12+S32, S21+S41, S21+S42, S22+S41, and S22+S42, a total of eight to-be-saved paths.
[0064] Then, a saved route connecting the starting path point and the currently traversed node is determined according to the route type of the route to be saved, wherein the route type includes a single path type and a mixed path type. A route to be saved of a single path type includes all paths with the same path attributes, while a route to be saved of a mixed path type includes paths with different path attributes.
[0065] For different route types, different filtering rules are used to select the saved routes:
[0066] For example, for a single path type to be saved, since the path attributes of each path are the same, there is basically no need to adjust the robot's posture. In this case, you only need to calculate the loss value of each to be saved route. For example, the sum of the distances of all paths included in the to be saved route is used as the loss value of each to be saved route. Then, among one or more to be saved routes that contain paths with the same path attributes, the to be saved route with the smallest loss value is selected and saved as the saved route connecting the starting path point and the current traversal node. Please refer to Figure 2 , S11+S31, S12+S32, S21+S41, and S22+S42 are all single-path type routes to be saved. Among them, the path attribute of each path of S11+S31 and S21+S41 is a forward path, and the path attribute of each path of S12+S32 and S22+S42 is a backward path. In S11+S31 and S21+S41, the loss value of S11+S31 is 20, the loss value of S21+S41 is 22, and the loss value of S11+S31 is smaller; in S12+S32 and S22+S42, the loss value of S12+S32 is 20, the loss value of S22+S42 is 22, and the loss value of S12+S32 is smaller; therefore, the saved paths of the single-path type connecting the starting path point 1 and the currently traversed node 4 are S11+S31 and S12+S32.
[0067] For mixed path types, different routes to be saved are basically different, and the time consumption for posture adjustment is also basically different. Therefore, the route to be saved can be directly saved as a saved route connecting the starting path point and the current traversal node. Figure 2 As shown, S11+S32, S12+S31, S21+S42 and S22+S41 are all mixed path type routes to be saved, and S11+S32, S12+S31, S21+S42 and S22+S41 are all saved as mixed path type saved routes connecting the starting path point 1 and the currently traversed node 4.
[0068] In this way, all saved routes of different route types connecting the current traversal node and the starting path point can be obtained, providing the robot with the optimal saved route as the target route to adapt to different usage scenarios. For example, if the robot only supports forward movement mode, it can only select a saved route of a single path type with all path attributes of the path being a forward path as the target route (such as S11+S31). For example, when the robot supports forward and backward movement modes, it can select a saved route of a single path type, in which the path attributes of the path are all forward paths (such as S11+S31), a saved route of a single path type, in which the path attributes of the path are all backward paths (such as S12+S32), and a saved route of a mixed path type (such as S11+S32, S12+S31, S21+S42, and S22+S41). Then, from the above selectable routes, the final target route is selected. For example, the robot can select the selectable route with the least time spent on posture adjustment as the target route based on the current posture information of the robot, so that when the robot moves along the target route, it can achieve a balance between the minimum posture adjustment time and the shortest path, so that the robot can move from the starting path point to the ending path point at the fastest speed.
[0069] After determining the saved route corresponding to the current traversal node, the current traversal node is deemed to have been traversed. At this time, the current traversal node is added to the second list as a parent node. If the second list does not contain all path points, the path points that are close to the current traversal node and can be connected but are not in the first list are added to the first list again to continue the traversal.
[0070] When the saved route connecting the starting path point and all child nodes of each current parent node is determined and all path points are not included in the second list, the path point with the smallest loss value in the first list is again used as the current parent node and added to the second list (i.e., entering step 01213 again); that is, after traversing all child nodes of the current parent node, if all path points are not included in the second list (i.e., all path points have not been traversed), it is necessary to loop through steps 01213 to 01217 until all path points are included in the second list (i.e., all path points have been traversed). At this time, there are no more path points in the first list, and all path points in the first list are added to the second list as traversed parent nodes. At this time, it can be determined that a saved route connecting the starting path point and any path point other than the starting path point has been obtained.
[0071] See also Figure 5 In some embodiments, step 0122: determining a target route based on the robot's current posture information and the loss value of the saved route corresponding to the end path point includes:
[0072] Step 01221: Determine the target path attributes based on the current posture information of the robot; and
[0073] Step 01222: Determine the target route as the saved route that connects the starting path point and the ending path point and corresponds to the target path attribute and has the smallest loss value.
[0074] Specifically, after determining the saved route connecting the starting path point and any path point other than the starting path point, one or more saved routes connecting the starting path point and the ending path point can be obtained, and then the target route is determined based on the one or more saved routes and the current posture information of the robot.
[0075] When selecting a target route, the target path attributes can be first determined based on the robot's current posture information. For example, if the path corresponding to the starting path point (such as S11, S12, S21, and S22 in paths S21 and S22) is determined to be opposite the robot's front, the target path attribute can be determined to be a forward path, meaning the robot moves in forward mode along this path without adjusting its posture. If the path corresponding to the starting path point is determined to be opposite the robot's rear, the target path attribute can be determined to be a backward path, meaning the robot moves in backward mode along this path without adjusting its posture. In this way, based on the robot's current posture information and the target path attributes, one or more saved routes can be selected that match the robot's current posture information and connect the starting and ending path points. For example, one or more saved routes containing path S21 can be selected.
[0076] The robot also has preset movement modes, which include at least one of forward, backward, and lateral movement. In other words, the robot may be capable of only forward movement, only backward movement, only lateral movement, only forward and backward movement, only forward and lateral movement, or forward, backward, and lateral movement. Therefore, based on the robot's preset movement modes and current posture information, a target path attribute that matches the current posture and the robot's supported movement modes can be determined. For example, if there are paths facing both the front and rear sides of the robot, but the robot is only capable of forward movement, the robot's target path attribute is a forward path.
[0077] Then, while ensuring that the robot's posture adjustment time is minimized, the loss value of the selected saved route can be calculated. For example, the loss value of the saved route can be calculated by taking the sum of the distances of all paths included in the saved route as the saved route's loss value. This allows the saved route with the smallest loss value to be selected as the final target route. This ensures that the target route not only ensures that the robot's posture adjustment time is minimized but also has a shorter distance. This achieves a balance between minimizing the robot's posture adjustment time and minimizing the target route's path length, allowing the robot to move from the starting path point to the ending path point at the fastest speed, thereby improving transportation efficiency. For example, if the starting path point is 1 and the ending path point is 4, and one or more saved routes connecting the starting and ending paths include path S21, the saved routes include S21 + S41 (single path type) and S21 + S42 (mixed path type), then the target route can be S21 + S41 or S21 + S42.
[0078] Furthermore, since the angles between adjacent paths in the map have been determined, after the robot enters the first segment of the saved route, the posture when it reaches each path point can be calculated. Therefore, when selecting the target route, it is necessary not only to select the first segment of the path to match the current posture information of the robot, but also to match each subsequent segment of the path with the posture of the robot before moving to the path (that is, the robot does not need to adjust its posture to move into the path or the angle of posture adjustment is small (such as the yaw angle is less than 10 degrees)), so as to select one or more saved routes with the shortest time spent on the robot's posture adjustment. Figure 2 As shown, after the robot moves forward to path point 3, the angles between paths S41 and S42 and the robot's moving direction (i.e., path S21) are acute angles. At this time, the robot adjusts its posture so that the robot's backward direction is adjusted to be parallel to path S42, which is less than the adjustment time required for the robot to adjust its posture so that the robot's forward direction is parallel to path S41. Therefore, when the robot moves along path S42 in backward mode, the time for posture adjustment is shorter, and the target route is S21+S42.
[0079] In order to better implement the path planning method of the embodiment of the present application, the embodiment of the present application also provides a path planning device 10. Figure 6 , the path planning device 10 may include:
[0080] An acquisition module 11 acquires a preset map, the map including a plurality of path points and a path connecting two adjacent path points, the path having corresponding path attributes, the path attributes including at least one of a forward path, a backward path, and a lateral path;
[0081] The planning module 12 is used to plan a target route connecting a starting path point to an ending path point according to the path distance and path attributes. The starting path point is any path point, and the ending path point is any path point other than the starting path point.
[0082] The planning module 12 is specifically used to obtain a saved route connecting the starting path point and any path point other than the starting path point based on the distance and path attributes of the path; and determine the target route based on the current posture information of the robot and the loss value of the saved route corresponding to the ending path point.
[0083] The planning module 12 is further configured to add the starting path point to a preset first list, where the parent node of the starting path point is empty; in the case where the current traversal node is the starting path point, determine that the loss value of the starting path point is 0 and the saved path of the starting path point is empty, and the loss value of the path point is determined based on the shortest distance from the path point to the starting path point; use the path point with the smallest loss value in the first list as the current parent node and add it to the preset second list; add the path point that is adjacent to and can be connected to the current parent node and is not in the first list and the second list to the first list, and use the child node of the current parent node as the current traversal node to traverse in sequence, and the child node of the current parent node is the path point in the first list that is adjacent to and can be connected to the current parent node; in the current traversal node If it is not the starting path point, update the loss value of the current traversal node according to the loss value of the current parent node; obtain the route to be saved connecting the starting path point and the current traversal node; determine the saved route connecting the starting path point and the current traversal node according to the route type of the route to be saved. The route type includes a single path type and a mixed path type. The path attributes of all paths included in the route to be saved of the single path type are the same, and the path attributes of the route to be saved of the mixed path type are paths with different path attributes; when the saved route connecting the starting path point and all child nodes of each current parent node is determined and the second list does not contain all path points, the path point with the smallest loss value in the first list is again used as the current parent node and added to the second list.
[0084] The planning module 12 is also specifically used to update the loss value of the current traversal node according to the loss value of the current parent node and the distance of the path connecting the current parent node and the current traversal node when the current traversal node is a path point newly added to the first list; when the current traversal node is not a path point newly added to the first list, calculate the loss value to be saved according to the loss value of the current parent node and the distance of the path connecting the current parent node and the current traversal node; save the smaller of the loss value to be saved and the saved loss value of the current traversal node as the loss value of the current traversal node.
[0085] The planning module 12 is further specifically configured to determine, when the corresponding saved route is not saved for the current traversal node, the route to be saved based on the path connecting the current parent node and the current traversal node with all different path attributes and the saved route corresponding to the current parent node; when the corresponding saved route is saved for the current traversal node, the route to be saved is determined based on the path connecting the current parent node and the current traversal node with all different path attributes, the saved route corresponding to the current parent node, and the saved route corresponding to the current traversal node; when the route type of the route to be saved is a single path type, among the routes to be saved with the same path attributes, the route to be saved with the smallest loss value is the saved route connecting the starting path point and the current traversal node, wherein the loss value of the route to be saved is determined based on the distance of all paths contained in the route to be saved; when the route type of the route to be saved is a mixed path type, the route to be saved is saved as the saved route connecting the starting path point and the current traversal node.
[0086] The planning module 12 is also specifically used to determine the target path attributes based on the current posture information of the robot; and determine that among the saved routes connecting the starting path point and the ending path point, the saved route corresponding to the target path attributes and with the smallest loss value is the target route.
[0087] The planning module 12 is further specifically configured to determine target path attributes based on the current posture information of the robot and a preset movement mode, where the preset movement mode includes at least one of forward, backward, and lateral movement.
[0088] Each module in the path planning device 10 can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor 20 in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor 20 can call and execute the corresponding operations of each module.
[0089] See also Figure 7 The robot 100 of the embodiment of the present application includes a processor 20. The processor 20 is used to execute the path planning method of any of the above embodiments, which will not be described in detail for the sake of brevity.
[0090] The robot 100 may be an AGV, a gripper truck, a tractor truck, a forklift, a reach stacker, a warehouse robot, or other mobile device.
[0091] See also Figure 8 The embodiment of the present application also provides a computer-readable storage medium 300 on which a computer program 310 is stored. When the computer program 310 is executed by the processor 20, the steps of the path planning method of any of the above-mentioned embodiments are implemented. For the sake of brevity, they are not repeated here.
[0092] It is understood that computer program 310 includes computer program code. The computer program code may be in source code form, object code form, an executable file, or some intermediate form. The computer-readable storage medium may be a non-volatile computer-readable storage medium such as any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), or a software distribution medium.
[0093] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and features of different embodiments or examples, unless they are mutually inconsistent.
[0094] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0095] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A path planning method, characterized in that: include: Obtaining a preset map, the map including a plurality of path points and a path connecting two adjacent path points, the path having corresponding path attributes, the path attributes including at least one of a forward path, a backward path, and a lateral path; Planning a target route connecting a starting path point to an ending path point according to the distance of the path and the path attributes, wherein the starting path point is any of the path points, and the ending path point is any of the path points other than the starting path point; The planning of a target route connecting a starting path point to an ending path point according to the path distance and the path attributes includes: Acquire a saved route connecting the starting path point and any path point other than the starting path point according to the distance of the path and the path attribute; Determining the target route based on the current posture information of the robot and the loss value of the saved route corresponding to the terminal path point; The obtaining, based on the distance of the path and the path attributes, of a saved route connecting the starting path point and any path point other than the starting path point comprises: Add the starting path point to a preset first list, where the parent node of the starting path point is empty; When the current traversal node is the starting path point, determining that the loss value of the starting path point is 0 and the saved path of the starting path point is empty, and the loss value of the path point is determined according to the shortest distance from the path point to the starting path point; The path point with the smallest loss value in the first list is used as the current parent node and added to the preset second list; Add the path points that are adjacent to and connectable to the current parent node and are not in the first list or the second list to the first list, and traverse the child nodes of the current parent node as the current traversal nodes in sequence, where the child nodes of the current parent node are the path points in the first list that are adjacent to and connectable to the current parent node; When the current traversal node is not the starting path point, updating the loss value of the current traversal node according to the loss value of the current parent node; Obtaining a route to be saved that connects the starting path point and the currently traversed node; Determining the saved route connecting the starting path point and the current traversal node according to the route type of the route to be saved, wherein the route type includes a single path type and a mixed path type. The path attributes of all the paths included in the route to be saved of the single path type are the same, and the route to be saved of the mixed path type includes the paths with different path attributes; In the case that the second list does not contain all the path points, the step of taking the path point with the smallest loss value in the first list as the current parent node and adding it to the preset second list is entered again.
2. The path planning method according to claim 1, wherein: The updating the loss value of the current traversal node according to the loss value of the current parent node includes: When the current traversal node is the path point newly added to the first list, updating the loss value of the current traversal node according to the loss value of the current parent node and the distance of the path connecting the current parent node and the current traversal node; When the current traversal node is not the path point newly added to the first list, calculating the loss value to be saved according to the loss value of the current parent node and the distance of the path connecting the current parent node and the current traversal node; The smaller of the loss value to be saved and the saved loss value of the currently traversed node is saved as the loss value of the currently traversed node.
3. The path planning method according to claim 1, wherein: The obtaining of a route to be saved connecting the starting path point and the currently traversed node includes: If the currently traversed node does not have the corresponding saved route, determining the route to be saved based on the paths connecting the current parent node and the currently traversed node with all the different path attributes and the saved route corresponding to the current parent node; If the currently traversed node has already saved the corresponding saved route, determining the route to be saved based on the path connecting the current parent node and the currently traversed node with all the different path attributes, the saved route corresponding to the current parent node, and the saved route corresponding to the currently traversed node; The step of determining the saved route connecting the starting path point and the current traversal node according to the route type of the route to be saved includes: When the route type of the to-be-saved route is the single path type, among the to-be-saved routes with the same path attributes, the to-be-saved route with the smallest loss value is the saved route connecting the starting path point and the currently traversed node, wherein the loss value of the to-be-saved route is determined according to the distances of all the paths included in the to-be-saved route; In a case where the route type of the to-be-saved route is the mixed route type, the to-be-saved route is saved as the saved route connecting the starting path point and the currently traversed node.
4. The path planning method according to claim 1, wherein: The determining the target route according to the current posture information of the robot and the loss value of the saved route corresponding to the termination path point includes: Determining target path attributes based on the current posture information of the robot; and Determine, among the saved routes connecting the starting path point and the ending path point, the saved route corresponding to the target path attribute and having the smallest loss value as the target route.
5. The path planning method according to claim 4, characterized in that: Determining target path attributes according to the current posture information of the robot includes: A target path attribute is determined based on the current posture information of the robot and a preset movement mode, wherein the preset movement mode includes at least one of forward, backward, and lateral movement.
6. A path planning device, characterized in that: include: an acquisition module, configured to acquire a preset map, wherein the map includes a plurality of path points and a path connecting two adjacent path points, wherein the path has corresponding path attributes, and the path attributes include at least one of a forward path, a backward path, and a lateral path; a planning module, configured to plan a target route connecting a starting path point to an ending path point according to the distance of the path and the path attributes, wherein the starting path point is any of the path points, and the ending path point is any of the path points other than the starting path point; The planning module is configured to obtain a saved route connecting the starting path point and any path point other than the starting path point based on the distance of the path and the path attributes; and determine the target route based on the current posture information of the robot and the loss value of the saved route corresponding to the ending path point; The planning module is further configured to add the starting path point to a preset first list, with the parent node of the starting path point being empty; in the case where the current traversal node is the starting path point, determine that the loss value of the starting path point is 0 and the saved path of the starting path point is empty, and the loss value of the path point is determined based on the shortest distance from the path point to the starting path point; use the path point with the smallest loss value in the first list as the current parent node and add it to a preset second list; add the path point that is adjacent to and connectable to the current parent node and is not in the first list or the second list to the first list, and use the child nodes of the current parent node as the current traversal nodes for traversal in sequence, with the child nodes of the current parent node being the path points in the first list that are adjacent to and connectable to the current parent node; If the current traversal node is not the starting path point, updating the loss value of the current traversal node according to the loss value of the current parent node; obtaining a route to be saved that connects the starting path point and the current traversal node; Determine the saved route connecting the starting path point and the current traversal node according to the route type of the route to be saved, the route type includes a single path type and a mixed path type, the path attributes of all the paths included in the route to be saved of the single path type are the same, and the route to be saved of the mixed path type includes the paths with different path attributes; if all the path points are not included in the second list, enter the step of taking the path point with the smallest loss value in the first list as the current parent node and adding it to the preset second list again.
7. A robot, characterized in that: The method comprises a processor configured to execute the path planning method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The method comprises a computer program, which, when executed by one or more processors, implements the path planning method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Path planning method and device, processing equipment, mobile equipment and storage medium
CN112923940A