Obstacle-avoiding path planning method, nonvolatile readable storage medium and robot
By expanding the obstacle area and planning a bypass path, the robot moves along the expanded edge, solving the problem of missed areas during cleaning and improving the cleaning effect.
Patent Information
- Application Number
- CN202310520101.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-05-09
AI Technical Summary
When the robot encounters obstacles during the cleaning process, the distance of the obstacle avoidance path is not fixed, which can easily lead to missed cleaning and reduce the cleaning effect.
By expanding the obstacle area, the expansion edge is determined, and a bypass path is planned along the expansion edge. The relatively fixed distance between the expansion edge and the obstacle is used to avoid missed scans.
It improves cleaning coverage and cleaning effect, ensuring that the robot can effectively avoid obstacles without missing any areas.
Smart Images

Figure CN119002468B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of robots, in particular to a path planning method for avoiding obstacles, a non-volatile readable storage medium and a robot. BACKGROUND
[0002] When a robot encounters an obstacle during cleaning, a local path for avoiding the obstacle can be planned according to a path planning algorithm. When the robot walks according to the local path, the robot will not collide with the obstacle. However, the distance between the robot and the obstacle is large during the process of avoiding the obstacle, and the edge shape of the obstacle is irregular, so the distance between the robot and the obstacle is not fixed, which can cause the robot to easily miss scanning during the process of avoiding the obstacle, thereby reducing the cleaning effect. SUMMARY
[0003] An object of embodiments of the present application is to provide a path planning method for avoiding obstacles, a non-volatile readable storage medium and a robot, and to solve the problem of low cleaning effect in the prior art.
[0004] In a first aspect, embodiments of the present application provide a path planning method for avoiding obstacles, comprising:
[0005] obtaining a map, the map comprising an obstacle region;
[0006] performing an inflation operation on the obstacle region to obtain an obstacle inflation region;
[0007] determining an inflation edge of the obstacle inflation region;
[0008] planning a path for avoiding obstacles along the inflation edge.
[0009] Optionally, the planning of the path for avoiding obstacles along the inflation edge comprises:
[0010] performing an inflation operation on a target region to obtain an inflated target region, the target region being a region centered on the inflation edge, wherein the target region comprises a plurality of target position points, and a target generation value of the target position points monotonically changes with a relative distance between the target position points and the inflation edge;
[0011] planning a path for avoiding obstacles based on the inflated target region.
[0012] Optionally, the performing of the inflation operation on the target region to obtain the inflated target region comprises performing a Gaussian inflation operation on the target region with the inflation edge as the center to obtain the inflated target region.
[0013] Optionally, the target generation value and the relative distance have a monotonically increasing relationship.
[0014] Optionally, the map includes a starting point and a target point, and planning an obstacle avoidance path based on the expanded target area includes:
[0015] A node expansion operation is performed between the starting point and the target point to obtain an expanded potential field. Each node expansion operation generates a central node and an expansion node adjacent to the central node. The total target cost of the expansion nodes is constrained by the node distance, which is the distance from the expansion node to the expansion edge.
[0016] Plan the obstacle bypass path based on the expanded potential field.
[0017] Optionally, the step of performing a node expansion operation between the starting point and the target point to obtain the expanded potential field includes:
[0018] According to the preset path planning algorithm, node expansion operations are performed sequentially between the starting point and the target point, starting from the starting point.
[0019] Determine the total target cost of the extended nodes;
[0020] The extended potential field is generated based on the total target cost of each of the extended nodes.
[0021] Optionally, determining the total target cost of the extended node includes:
[0022] Determine the total candidate generation value of the expanded node and the total search generation value from the starting point to the expanded node;
[0023] Determine the distance cost from the extended node to the expansion edge, wherein the distance cost has a monotonic relationship with the node distance;
[0024] Calculate the constraint value based on the distance value and the total candidate value;
[0025] The total target cost is determined based on the total search cost and the constraint cost.
[0026] Optionally, determining the total target cost based on the total search cost and the constraint cost includes:
[0027] Determine whether the total search cost is greater than the constraint cost;
[0028] If it is greater than the target value, then the constraint cost is determined to be the total target cost.
[0029] If it is not greater than, then the total search cost is determined to be the total target cost value.
[0030] Optionally, the node distance and the distance cost form a monotonically increasing relationship.
[0031] In a second aspect, embodiments of the present invention provide a non-volatile readable storage medium storing computer-executable instructions for causing a robot to execute the aforementioned obstacle avoidance path planning method.
[0032] In a third aspect, embodiments of the present invention provide a robot, comprising:
[0033] At least one processor; and,
[0034] A memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the obstacle avoidance path planning method described above.
[0036] In the obstacle avoidance path planning method provided in this embodiment of the invention, firstly, a map is acquired, wherein the map includes obstacle regions. Secondly, the obstacle regions are expanded to obtain expanded obstacle regions. Thirdly, the expanded edges of the expanded obstacle regions are determined. Finally, the obstacle avoidance path is planned along the expanded edges. Since the distance between the expanded edges and the obstacles is relatively fixed, the robot is less likely to miss areas when avoiding obstacles along the obstacle avoidance path, which helps to improve cleaning coverage and cleaning effect. Attached Figure Description
[0037] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0038] Figure 1 A flowchart illustrating an obstacle avoidance path planning method provided in an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram illustrating the relationship between the distance between the grid and the obstacle area and the original cost value, provided for an embodiment of the present invention, wherein the distance and the original cost value are negatively correlated.
[0040] Figure 3 This is a schematic diagram illustrating the relationship between the distance between the grid and the obstacle area and the original cost value, provided for an embodiment of the present invention, wherein the distance and the original cost value are positively correlated.
[0041] Figure 4A schematic diagram illustrating a scenario of a robot performing a cleaning operation, provided in an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram illustrating the obstacle expansion and cost adjustment operations based on the collision area of the expanded obstacle, as provided in an embodiment of the present invention.
[0043] Figure 6 The obstacle avoidance path is planned using the Dijkstra algorithm provided by the relevant technology;
[0044] Figure 7 The obstacle avoidance path is planned using the obstacle avoidance path planning method provided in the embodiments of the present invention;
[0045] Figure 8 This is a schematic diagram of the winding path planning device provided in an embodiment of the present invention;
[0046] Figure 9 This is a schematic diagram of the circuit structure of a robot provided in an embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.
[0048] It should be noted that, unless otherwise specified, the various features in the embodiments of this invention can be combined with each other, all of which are within the protection scope of this invention. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this invention do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0049] This invention provides a method for obstacle avoidance path planning. Please refer to [link / reference]. Figure 1 The obstacle avoidance path planning method includes the following steps:
[0050] S11: Get the map, which includes obstacle areas.
[0051] In this step, the map includes walkable areas, obstacle areas, and unknown areas. Walkable areas are areas where the robot can traverse, obstacle areas are areas occupied by obstacles that prevent the robot from moving, and unknown areas are areas not detected by the robot. It is understood that the obstacle areas provided in this embodiment include physical obstacle areas and / or virtual obstacle areas. Physical obstacle areas are areas occupied by obstacles that objectively exist in the environment, while virtual obstacles are areas that the user sets on the map that the robot cannot traverse. For example, the user defines area AR on the map as the area corresponding to a virtual obstacle; another example is that the user draws a line at the entrance of a toilet on the map, and this line is a virtual obstacle, with the area occupied by this line on the map being the virtual obstacle area.
[0052] In order to represent passable areas, obstacle areas, and unknown areas on the map, this embodiment can configure different original cost values for areas with different attributes on the map according to the attributes of the areas. For example, areas with an original cost value of any value from 0 to 253 are passable areas, areas with an original cost value of "254" are obstacle areas, and areas with an original cost value of "255" are unknown areas.
[0053] It is understandable that passable areas, obstacle areas, and unknown areas can also be marked in other ways, without being limited to the above-mentioned ways of expressing cost values.
[0054] Understandably, the map can be a raster map or other graphical map.
[0055] It is understood that a map includes multiple location points. When the map is a raster map, the position of a raster on the map is a location point. This embodiment can configure different original cost values for each raster. The original cost value can be used not only to represent raster attributes but also to represent the distance between the raster and obstacle areas. Raster attributes include traversable rasters, obstacle rasters, and unknown rasters. Traversable rasters are those corresponding to traversable areas, obstacle rasters are those corresponding to obstacle areas, and unknown rasters are those corresponding to unknown areas.
[0056] In some embodiments, please refer to Figure 2 The closer a grid is to an obstacle region, the higher its original cost. Conversely, the farther a grid is from an obstacle region, the lower its cost. Specifically, when a grid falls on an obstacle region, its original cost is 254.
[0057] In some embodiments, please refer to Figure 3 The closer a grid is to an obstacle area, the lower its original cost. Similarly, the farther a grid is from an obstacle area, the higher its original cost.
[0058] It is understood that those skilled in the art can customize the relationship between the grid values and the distance based on the content disclosed in this embodiment, which will not be elaborated here.
[0059] In some embodiments, the map is configured with a coordinate system, wherein the coordinate system can be positioned anywhere on the map. In some embodiments, the origin of the coordinate system is the lower left corner of the map, the positive X-axis of the coordinate system points from the lower left corner to the lower right corner of the map, and the positive Y-axis of the coordinate system points from the lower left corner to the upper left corner of the map. When the map is a grid map, the position of each grid point on the map can be represented by coordinates in the coordinate system. The coordinates of each grid point are configured with a corresponding index value in the robot's database. For example, the coordinates of grid SG1 are (1,2), and the index value is 25.
[0060] In some embodiments, the robot is equipped with a sensor module, and map acquisition includes: controlling the sensor module to collect environmental data, and generating a map based on a map building algorithm and the environmental data. The sensor module includes a camera and / or LiDAR and / or a motion sensor, where the motion sensor can be an IMU sensor, an accelerometer, etc. The map building algorithm can be a SLAM algorithm, etc.
[0061] In some embodiments, obtaining a map includes: controlling the robot to access a local database to extract a pre-stored map from the local database.
[0062] In some embodiments, obtaining a map includes: controlling a robot to send a map acquisition request to a cloud server, so that the cloud server returns a map based on the map acquisition request.
[0063] S12: Perform an expansion operation on the obstacle region to obtain the expanded obstacle region.
[0064] In this step, the expansion operation is an operation that expands the edge of the obstacle area, and the expanded obstacle area is the obstacle area after the expansion operation.
[0065] In some embodiments, performing an expansion operation on the obstacle region to obtain an expanded obstacle region includes: performing an expansion operation with the obstacle as the center according to an expansion algorithm and a first preset expansion radius to obtain an expanded obstacle region.
[0066] In some embodiments, performing a dilation operation on an obstacle region to obtain an expanded obstacle region includes: determining the obstacle edge of the obstacle region; and, according to a dilation algorithm, performing a dilation operation with the obstacle edge as the center and a first preset dilation radius to obtain the expanded obstacle region. The dilation algorithm includes the Gaussian dilation algorithm, the algorithm corresponding to the distancetransform function in OpenCV, etc.
[0067] In some embodiments, the first preset expansion radius is the robot's expected obstacle avoidance distance, which is the distance at which the robot can clean the edge of the obstacle without colliding with it during obstacle avoidance. For example, if the robot is circular and has a diameter of 1m, then the expected obstacle avoidance distance can be 0.7m.
[0068] In some embodiments, the first preset expansion radius is customized by the user based on engineering experience, such as the first preset expansion radius being 30cm.
[0069] In some embodiments, determining the obstacle edges of an obstacle region includes: extracting the obstacle edges of the obstacle region according to an edge detection algorithm.
[0070] In some embodiments, determining the obstacle edge of an obstacle region includes: finding a first reference grid whose original cost value is a specified cost value, wherein the specified cost value is the original cost value of the obstacle grid, and sequentially combining the first reference grids whose original cost values are specified cost values to obtain the obstacle edge.
[0071] In some embodiments, determining the obstacle edge of an obstacle region includes: determining a first edge grid of the obstacle region, wherein the first edge grid is the first grid located at the boundary between the obstacle region and other attribute regions; using the first edge grid as the search starting point, traversing the obstacle region according to a preset search algorithm to obtain a second edge grid that has the same grid attributes as the first edge grid and is connected to the first edge grid; and sequentially combining the first edge grid and the second edge grid to obtain the obstacle edge. The preset search algorithm includes a depth-first search algorithm or a breadth-first search algorithm, etc.
[0072] S13: Determine the expansion edge of the obstacle expansion region.
[0073] In this step, the expansion edge is the edge of the obstacle expansion region. After determining the expansion edge of the obstacle expansion region in this embodiment, the grid of the expansion edge is modified into the obstacle grid. Modifying the grid of the expansion edge into the obstacle grid includes: modifying the original value of the grid of the expansion edge into the original value of the obstacle grid.
[0074] In some embodiments, determining the expansion edge of the obstacle expansion region includes: determining the expansion edge of the obstacle expansion region based on the distance from the location point to the obstacle edge.
[0075] Determining the expansion edge of the obstacle expansion region based on the distance from the location point to the obstacle edge includes: traversing the map to obtain multiple location points, determining the location point whose distance from the obstacle edge is a first preset expansion radius as a reference location point, and multiple reference location points can form an expansion edge.
[0076] Determining a location point at a distance of the first preset expansion radius from the edge of an obstacle as a reference location point includes: determining the distance from the location point to the edge of the obstacle, determining whether the distance is equal to the first preset expansion radius, and if it is equal, determining that the location point is a reference location point; if it is not equal, determining that the location point is not a reference location point.
[0077] In some embodiments, determining the expansion edge of an obstacle expansion region includes: searching for a second reference grid with an original cost value of a specified cost value within the obstacle expansion region according to the expansion direction, and sequentially combining the second reference grids with original cost values of the specified cost value to obtain the expansion edge.
[0078] S14: Plan a path around the obstacle along the expansion edge.
[0079] In this step, the obstacle avoidance path is the path to bypass obstacles. In this embodiment, the robot is controlled to walk along the obstacle avoidance path, which not only allows it to bypass obstacles without colliding with them, but also enables full-coverage cleaning of the obstacle edges during the obstacle avoidance process. Since the distance between the expanded edge and the obstacle is relatively fixed, the robot is less likely to miss any areas when bypassing obstacles along the obstacle avoidance path, which helps to improve cleaning coverage and cleaning effect.
[0080] To elaborate on the obstacle avoidance path planning method provided in this embodiment of the invention, this embodiment combines... Figure 4 The following is an explanation:
[0081] Please see Figure 4 Robot 40 begins its cleaning operation, entering wall-mounted cleaning mode. When robot 40 encounters TV cabinet 41, it expands the corresponding obstacle area on the map, creating an expanded obstacle area 42. Next, robot 40 determines the expanded edge 43 of the expanded obstacle area 42 and plans an obstacle avoidance path 44 along this edge. Finally, robot 40 bypasses TV cabinet 41 using the obstacle avoidance path 44. Because the distance between the expanded edge 43 and TV cabinet 41 is relatively fixed, robot 40 is less likely to miss areas while bypassing obstacles along the obstacle avoidance path 44, thus improving cleaning coverage and effectiveness.
[0082] In some embodiments, planning a bypass path along the bulge edge includes the following steps:
[0083] S141: Perform an expansion operation on the target region to obtain the expanded target region.
[0084] S142: Plan obstacle bypass paths based on the expanded target area.
[0085] In S141, the target area is the region centered on the expansion edge, and the size of the target area can be customized by the user based on engineering experience. In some embodiments, the target area is the region surrounded by a plurality of target location points at a distance of a second preset expansion radius from the expansion edge, wherein the second preset expansion radius is customized by the user based on engineering experience, for example, the second preset expansion radius is 1m.
[0086] The target region comprises multiple target location points, which are the locations within the target region. When the map is a raster map, the target location points are the location points of the raster cells within the target region. The target cost value is the cost of each target location point in the expanded target region, where the target cost of each target location point monotonically changes with the relative distance between the target location point and the expansion edge.
[0087] In some embodiments, when generating obstacle avoidance paths in a minimum cost manner, the target cost of the target location point is monotonically increasing with the relative distance between the target location point and the expansion edge. That is, the greater the relative distance between the target location point and the expansion edge, the greater the target cost of the target location point; and the smaller the relative distance between the target location point and the expansion edge, the smaller the target cost of the target location point. This helps to ensure that the path planned by the path planning algorithm is as close as possible to the expansion edge.
[0088] In some embodiments, when generating obstacle avoidance paths in a maximum cost manner, the target cost of a target location point is monotonically decreasing with respect to the relative distance between the target location point and the expansion edge. That is, the greater the relative distance between the target location point and the expansion edge, the smaller the target cost of the target location point, and the smaller the relative distance between the target location point and the expansion edge, the greater the target cost of the target location point.
[0089] In some embodiments, the monotonic relationship between the target cost and the relative distance follows a Gaussian distribution. That is, the target cost changes monotonically from the expansion edge to both sides. For example, the target cost of a target location on the expansion edge is 0. For a target location on one side of the expansion edge, the greater the relative distance between the target location and the expansion edge, the greater the target cost; the smaller the relative distance, the smaller the target cost. Similarly, for a target location on the other side of the expansion edge, the greater the relative distance, the greater the target cost; the smaller the relative distance, the smaller the target cost.
[0090] Please see Figure 5In this embodiment, an expansion operation is performed on obstacle 51 to obtain obstacle collision area 52 and expansion edge 53. Next, this embodiment expands the target area 54 centered on expansion edge 53 to obtain an expanded target area. The expanded target area includes multiple target location points, each corresponding to a target cost value. Specifically, after the expansion operation, target location point A, located on expansion edge 53, has a target cost value of 0, but its original cost value remains 254. Target location point B is d1 away from expansion edge 53. After the expansion operation, target location point B has a target cost value of 5, but its original cost value remains unchanged. Target location point C is d2 away from expansion edge 53, where distance d1 is less than distance d2. After the expansion operation, target location point C has a target cost value of 10, but its original cost value remains unchanged. And so on. It is understandable that after the target region 54 is expanded, the original cost of each target location point in the target region 54 remains unchanged, but each target location point can be associated with a corresponding target cost.
[0091] In some embodiments, performing a dilation operation on the target region to obtain the dilated target region includes: performing a Gaussian dilation operation on the target region with the dilation edge as the center to obtain the dilated target region.
[0092] The steps to obtain the expanded target region by performing Gaussian dilation on the target region with the dilation edge as the center include: determining the target region centered on the dilation edge according to the second preset dilation radius, and performing Gaussian dilation on the target region according to the Gaussian dilation function to obtain the expanded target region.
[0093] Since the Gaussian dilation function is a curve function that is monotonically changing on both sides of the dilation edge, after the Gaussian dilation operation, the target cost of all target locations in the target area can be smoothly and gradually changed, thus ensuring that the difference between the target cost values of any two adjacent target locations will not be too large, which is conducive to planning obstacle bypass paths more reliably and accurately along the dilation edge.
[0094] In S142, this embodiment obtains the expanded target area, and an obstacle avoidance path can be planned based on the expanded target area. In some embodiments, the map includes a starting point and a target point, and planning an obstacle avoidance path based on the expanded target area includes the following steps:
[0095] S1421: Perform node expansion operations between the starting point and the target point to obtain the expanded potential field.
[0096] S1422: Plan the obstacle bypass path based on the extended potential field.
[0097] In S1421, the starting point is the first center node, and node expansion operations are performed sequentially starting from the starting point as the first center node. Each node expansion operation generates a center node and adjacent expansion nodes. The node expansion operation includes obtaining eight adjacent nodes of the center node, which are the left node, right node, top node, bottom node, top-left node, top-right node, bottom-left node, and bottom-right node. All eight adjacent nodes are expansion nodes.
[0098] The total target cost of the extended node is constrained by the node distance, which is the distance from the extended node to the expansion edge. In some embodiments, the total target cost is constrained by the node distance as follows: when generating obstacle avoidance paths in a minimum cost manner, the larger the node distance, the larger the total target cost; the smaller the node distance, the smaller the total target cost. This helps to ensure that the obstacle avoidance path is as close as possible to the expansion edge.
[0099] In some embodiments, the total target cost is constrained by the node distance as follows: when generating the obstacle avoidance path in the manner of maximizing the cost, the larger the node distance, the smaller the total target cost, and the smaller the node distance, the larger the total target cost. This is beneficial to ensure that the obstacle avoidance path is as close as possible to the expansion edge.
[0100] In some embodiments, performing a node expansion operation between the starting point and the target point to obtain the expanded potential field includes the following steps:
[0101] S14211: According to the preset path planning algorithm, node expansion operations are performed sequentially between the starting point and the target point, starting from the starting point.
[0102] S14212: Determine the total target cost of the expanded nodes.
[0103] S14213: Generate the expanded potential field based on the total target cost of each expanded node.
[0104] In S14211, the preset path planning algorithms include Dijkstra's algorithm, A* algorithm, or a hybrid A* algorithm.
[0105] Before performing node expansion operations, this embodiment performs initialization operations in the following manner:
[0106] 1) Initialization.
[0107] Set the starting point coordinates as `start` and the target point coordinates as `goal`. The map is a raster map, where the number of grid cells in the x-direction is `nx` and the number of grid cells in the y-direction is `ny`. Set the array `map_cost` to store the cost value of each grid cell in the updated map (cost values range from 0 to 255). Obtain the index value of the target point in the raster map, `goal_i`. Obtain the index value of the starting point in the raster map, `start_i`, and set the node expansion threshold `lethal_cost` to the minimum of `map_cost[start_i]` and `map_cost[goal_i]`.
[0108] 2) Search initialization.
[0109] Initialize the `parent` array to store the parent nodes of each node. Initialize the `costs` array to store the cost of each node during the search process. Initialize the `queue` array, which is an open set in Dijkstra's search process. Each element in the queue contains the index of each node and its cost, `cost`, where `cost` = `costs[i]`, and `costs[i]` is the cost of the i-th node. Initialize the `potential` array, which is a closed set in Dijkstra's search process, to store the cost of each grid cell in the map. During initialization, all elements in the `potential` array are set to positive infinity.
[0110] Get the index value start_i of the starting point in the raster map, set the search cost costs[start_i] of the starting point to 0, combine start_i and costs[start_i] into a data set, and store it in the queue. The queue will automatically sort the data and ensure that the cost of the first element in the queue is minimized.
[0111] After the initialization operation is completed and before the node expansion operation, this embodiment also needs to perform the following operations: if the queue is not empty, or the number of times the following process (1)-(4) is executed is less than the preset number threshold, then the following process is executed in a loop; otherwise, the step of generating an obstacle bypass path based on the parent node is entered.
[0112] (1) Take the first element top from the queue. The element top contains two pieces of information: index and cost. If top.index = goal_index, it means that the node has been expanded to the target point. Then the node expansion operation ends and the step of generating obstacle avoidance path based on the parent node is entered. If potential[top.index] is less than positive infinity, it means that the node has been added to the potential array. Then step (2) is not executed and step (1) of the next cycle is continued. Otherwise, top.cost is stored in the potential array, that is, potential[top.index] = costs[top.index] and step (2) is entered.
[0113] (2) Perform node expansion operation. Iterate through the nodes to the left, right, top, bottom, top left, top right, bottom left, and bottom right of `top.index` in sequence, expanding each node. For the expanded nodes around `top.index`, without loss of generality, assume the expanded node's index is `next_index`. If the coordinates of the expanded node's `next_index` are less than 0 or greater than `nx*ny`, it means the expanded node exceeds the map boundary. If `potential[next_index]` is less than positive infinity, it means the expanded node has been added to a closed set. If `map_costs[next_index]` is greater than the threshold `lethal_cost`, it means the expanded node's cost in the map is too high, or it is too close to an obstacle. Therefore, when the above situations occur, this embodiment ends the node expansion operation for that expanded node and continues with the node expansion operation for another expanded node.
[0114] In S14212, determining the total target cost of the expansion node includes: determining the total candidate cost of the expansion node and the total search cost from the starting point to the expansion node, determining the distance cost from the expansion node to the expansion edge, calculating the constraint cost based on the distance cost and the total candidate cost, and determining the total target cost based on the total search cost and the constraint cost.
[0115] In some embodiments, the expression for the total candidate cost value can be:
[0116] cost_ca[index]=top.cost+map_cost[index].
[0117] Where top.cost is the total search cost from the starting point to the center point, map_cost[index] is the cost of the extended node with index value index on the updated map, and cost_ca[index] is the total candidate cost of the extended node with index value index.
[0118] In some embodiments, the expression for the total candidate cost value may also be:
[0119] cost_ca[index]=top.cost+map_cost[index]+neural_cost.
[0120] Where neural_cost is the cost per step.
[0121] In some embodiments, determining the distance cost from the extended node to the expansion edge includes: determining the nearest edge point from the extended node to the expansion edge, and determining the distance cost based on the node distance between the extended node and the nearest edge point.
[0122] In some embodiments, calculating the constraint cost value based on the distance cost value and the total candidate cost value includes the following steps: calculating the constraint cost value according to the following formula: cost_yue[index]=k*threhood_map[index]+cost_ca[index], where threshold_map[index] is the distance cost value of the extended node with index value index, cost_ca is the total candidate cost value of the extended node with index value index, cost_yue is the constraint cost value of the extended node with index value index, and k is an empirical constant.
[0123] In some embodiments, determining the total target cost value based on the total search cost value and the constraint cost value includes the following steps: determining whether the total search cost value is greater than the constraint cost value; if it is greater, then the constraint cost value is determined to be the total target cost value; if it is not greater, then the total search cost value is determined to be the total target cost value. For example, in this embodiment, it is determined whether costs[index] is greater than cost_yue[index], where costs[index] is the total search cost value from the starting point to the extended node with index value index; if it is greater, then the cost value of the extended node is updated to cost_yue[index]; if it is less, then the cost value of the extended node is updated to costs[index].
[0124] The distance cost and the node distance form a monotonic relationship. In some embodiments, when the obstacle avoidance path is generated in the manner of minimum cost, the node distance and the distance cost form a monotonically increasing relationship. This is beneficial to ensure that the obstacle avoidance path is as close as possible to the edge of the expansion.
[0125] In some embodiments, when generating obstacle avoidance paths in a maximum cost manner, the node distance and the distance cost form a monotonically decreasing relationship, which helps to ensure that the obstacle avoidance path is as close as possible to the expansion edge.
[0126] It is understood that this embodiment incorporates distance cost as a constraint element into the cost function of the preset path planning algorithm, which is beneficial for the planned obstacle avoidance path to be closer to the expansion edge, thereby improving the cleaning coverage and cleaning effect.
[0127] In S1422, in some embodiments, planning the obstacle bypass path based on the extended potential field includes: planning the obstacle bypass path on the extended potential field according to the gradient descent algorithm.
[0128] In some embodiments, planning an obstacle avoidance path based on the extended potential field includes: searching for parent nodes based on the extended potential field, and planning an obstacle avoidance path based on each parent node.
[0129] Searching for parent nodes based on the expanded potential field involves: determining the minimum total target value based on the total target value of each expanded node, selecting the expanded node corresponding to the minimum total target value as a candidate node, and determining the parent node based on the candidate node.
[0130] Determining the parent node based on the candidate node includes: performing a node expansion operation on the candidate node to obtain at least one expanded node; determining whether the expanded node extended from the candidate node exists in an open set; if it exists, determining whether the path from the starting point to the expanded node is optimal; if not, determining the candidate node as the parent node; if it does exist, determining the expanded node as a new candidate node; if it does not exist, determining the candidate node as the parent node, that is, recording the candidate node in the array parent.
[0131] The obstacle avoidance path generation based on each parent node includes: starting from the target point, determining the position of each parent node in reverse order, where the starting point is the first parent node, and generating the obstacle avoidance path based on the position of each parent node.
[0132] As mentioned earlier, initialize `current_index` to `goal_index`, and store the coordinates of the parent node represented by `current_index` at the end of the queue `path`. When `current_index` is not equal to `start_index`, repeat the following steps: place the coordinates of the parent node represented by `parent[current_index]` at the end of `path`, and assign the index of the parent node represented by `parent[current_index]` to `current_index`. Continue this loop until `current_index` equals `start_index`. Reversing the elements in `path` yields a path around the obstacle connecting the starting point and the target point.
[0133] To elaborate on the obstacle avoidance path planning method provided in this embodiment, this embodiment combines... Figure 6 and Figure 7 The following is an explanation:
[0134] Figure 6 This is the obstacle avoidance path planned using Dijkstra's algorithm provided by relevant technologies. Figure 6 It can be seen that the obstacle avoidance path 60 planned by the Dijkstra algorithm provided by the relevant technology does not effectively adhere to the bulging edge 62 of the obstacle 61.
[0135] Figure 7 This refers to the obstacle avoidance path planned using the obstacle avoidance path planning method provided in this embodiment of the invention. Figure 7 It can be seen that the obstacle avoidance path 70 planned in this embodiment can effectively stick to the expansion edge 72 of the obstacle 71, reduce the obstacle avoidance distance of the robot, avoid missed cleaning, and improve the cleaning quality and cleaning coverage of the robot.
[0136] It should be noted that in the above embodiments, there is no necessarily a certain order between the steps. Those skilled in the art can understand from the description of the embodiments of the present invention that the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in turn, etc.
[0137] As another aspect of the embodiments of the present invention, the present invention provides an obstacle avoidance path planning device. The obstacle avoidance path planning device can be a software module, which includes several instructions stored in a memory. A processor can access the memory, call the instructions, and execute them to complete the obstacle avoidance path planning methods described in the above embodiments.
[0138] In some embodiments, the obstacle avoidance path planning device can also be constructed from hardware devices. For example, the obstacle avoidance path planning device can be constructed from one or more chips, and the chips can work together to complete the obstacle avoidance path planning method described in the various embodiments above. As another example, the obstacle avoidance path planning device can also be constructed from various logic devices, such as general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), microcontrollers, ARM (Acorn RISC Machine) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0139] Please see Figure 8 The obstacle avoidance path planning device 800 includes a map acquisition module 81, a region expansion module 82, an edge determination module 83, and a path planning module 84.
[0140] The map acquisition module 81 is used to acquire a map, which includes obstacle areas. The area expansion module 82 is used to expand the obstacle areas to obtain expanded obstacle areas. The edge determination module 83 is used to determine the expanded edges of the expanded obstacle areas. The path planning module 84 is used to plan an obstacle avoidance path along the expanded edges. Since the distance between the expanded edges and the obstacles is relatively fixed, the robot is less likely to miss areas when avoiding obstacles along the obstacle avoidance path, which helps to improve cleaning coverage and cleaning effect.
[0141] In some embodiments, the path planning module 84 is specifically used to: perform an expansion operation on the target area to obtain an expanded target area, wherein the target area is a region centered on the expansion edge, wherein the target area includes multiple target location points, the target value of the target location points changes monotonically with the relative distance between the target location points and the expansion edge, and plan an obstacle avoidance path based on the expanded target area.
[0142] In some embodiments, the path planning module 84 is further specifically used to: perform Gaussian dilation on the target region with the dilation edge as the center to obtain the dilated target region.
[0143] In some embodiments, the target value is monotonically increasing with the relative distance.
[0144] In some embodiments, the map includes a starting point and a target point, and the path planning module 84 is further specifically used to: perform a node expansion operation between the starting point and the target point to obtain an expanded potential field, wherein each node expansion operation can generate a central node and an expansion node adjacent to the central node, the total target cost of the expansion node is constrained by the node distance, the node distance is the distance from the expansion node to the expansion edge, and plan an obstacle bypass path according to the expanded potential field.
[0145] In some embodiments, the path planning module 84 is further specifically used to: perform node expansion operations sequentially between the starting point and the target point according to a preset path planning algorithm, determine the total target value of the expanded nodes, and generate an expanded potential field based on the total target value of each expanded node.
[0146] In some embodiments, the path planning module 84 is further specifically configured to: determine the total candidate generation value of the extended node and the total search generation value from the starting point to the extended node, determine the distance generation value from the extended node to the expansion edge, wherein the distance generation value forms a monotonic relationship with the node distance, calculate the constraint generation value based on the distance generation value and the total candidate generation value, and determine the total target generation value based on the total search generation value and the constraint generation value.
[0147] In some embodiments, the path planning module 84 is further specifically used to: determine whether the total search cost is greater than the constraint cost; if it is greater, then determine that the constraint cost is the total target cost; if it is not greater, then determine that the total search cost is the total target cost.
[0148] In some embodiments, the node distance and the distance cost form a monotonically increasing relationship.
[0149] It should be noted that the obstacle avoidance path planning device described above can execute the obstacle avoidance path planning method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the embodiments of the obstacle avoidance path planning device can be found in the obstacle avoidance path planning method provided in the embodiments of the present invention.
[0150] Please see Figure 9 , Figure 9 This is a schematic diagram of the circuit structure of a robot provided in an embodiment of the present invention. Figure 9 As shown, the robot 900 includes one or more processors 91 and a memory 92. Wherein, Figure 9 Take the 91 processor as an example.
[0151] Processor 91 and memory 92 can be connected via a bus or other means. Figure 9 Taking the example of a connection between China and Israel via a bus.
[0152] The memory 92, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the obstacle avoidance path planning method in the embodiments of the present invention. The processor 91 executes various functional applications and data processing of the obstacle avoidance path planning device by running the non-volatile software programs, instructions, and modules stored in the memory 92, thereby realizing the functions of the obstacle avoidance path planning method provided in the above method embodiments and the various modules or units in the above device embodiments.
[0153] Memory 92 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 92 may optionally include memory remotely located relative to processor 91, which can be connected to processor 91 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0154] The program instructions / modules are stored in the memory 92 and, when executed by one or more processors 91, execute the obstacle avoidance path planning method in any of the above method embodiments.
[0155] This invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 9 One of the processors 91 can enable the one or more processors to execute the obstacle avoidance path planning method in any of the above method embodiments.
[0156] This invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions, which, when executed by a robot, cause the robot to perform the obstacle avoidance path planning method in any of the above method embodiments.
[0157] The device or equipment embodiments described above are merely illustrative. The unit modules described as separate components may or may not be physically separate. The components shown as module units may or may not be physical units; that is, they may be located in one place or distributed across multiple network module units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; under the concept of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the present invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for obstacle avoidance path planning, characterized in that, include: Obtain a map, which includes obstacle areas; An expansion operation is performed on the obstacle region to obtain an expanded obstacle region; Determine the expansion edge of the expansion region of the obstacle; Planning an obstacle avoidance path along the expansion edge includes: performing an expansion operation on the target region to obtain an expanded target region, wherein the target region is a region centered on the expansion edge, and the target region includes multiple target location points, the target value of each target location point monotonically changes with the relative distance between the target location point and the expansion edge; and planning an obstacle avoidance path based on the expanded target region.
2. The method according to claim 1, characterized in that, The process of dilating the target region to obtain the dilated target region includes: performing a Gaussian dilation operation on the target region with the dilation edge as the center to obtain the dilated target region.
3. The method according to claim 1, characterized in that, The target cost value is monotonically increasing with the relative distance.
4. The method according to any one of claims 1 to 3, characterized in that, The map includes a starting point and a target point. Planning an obstacle avoidance path based on the expanded target area includes: A node expansion operation is performed between the starting point and the target point to obtain an expanded potential field. Each node expansion operation generates a central node and an expanded node adjacent to the central node. The total target cost of the expanded nodes is constrained by the node distance, which is the distance from the expanded node to the expansion edge. Plan the obstacle bypass path based on the expanded potential field.
5. The method according to claim 4, characterized in that, The node expansion operation between the starting point and the target point to obtain the expanded potential field includes: According to the preset path planning algorithm, node expansion operations are performed sequentially between the starting point and the target point, starting from the starting point. Determine the total target cost of the extended nodes; The extended potential field is generated based on the total target cost of each of the extended nodes.
6. The method according to claim 5, characterized in that, The determination of the total target cost of the extended node includes: Determine the total candidate generation value of the expanded node and the total search generation value from the starting point to the expanded node; Determine the distance cost from the extended node to the expansion edge, wherein the distance cost has a monotonic relationship with the node distance; Calculate the constraint value based on the distance value and the total candidate value; The total target cost is determined based on the total search cost and the constraint cost.
7. The method according to claim 6, characterized in that, The step of determining the total target cost based on the total search cost and the constraint cost includes: Determine whether the total search cost is greater than the constraint cost; If it is greater than the target value, then the constraint cost is determined to be the total target cost. If it is not greater than, then the total search cost is determined to be the total target cost value.
8. The method according to claim 6, characterized in that, The node distance and the distance cost form a monotonically increasing relationship.
9. A non-volatile readable storage medium, characterized in that, The non-volatile readable storage medium stores computer-executable instructions for causing the robot to perform the obstacle avoidance path planning method as described in any one of claims 1 to 8.
10. A robot, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the obstacle avoidance path planning method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Two-dimensional route planning method for UUV to geometrically bypass circular barriers
CN105843234A