Path planning method, electronic device, and computer-readable storage medium
By parsing the set of optional path points in the obstacle map and merging the set of path points that have not crossed obstacles, combined with the shortest path search within a preset range, the problem of low path planning efficiency in the prior art is solved, and efficient full-coverage path planning in complex environments and large maps is achieved.
Patent Information
- Application Number
- CN202211034061.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-08-26
AI Technical Summary
Existing full-coverage path planning methods are inefficient in complex environments, especially in large maps where planning speed is slow, making it difficult to meet the efficiency and coverage requirements of robotic tasks.
By acquiring the target map, analyzing the set of optional path points not occupied by obstacles, merging the set of path points that do not pass through obstacles between adjacent set of points, and combining this with searching for the shortest path within a preset range, the search range is gradually narrowed to determine the target planned path.
It improves the efficiency of path planning, meets the needs of full-coverage path planning, and is suitable for rapid path planning in complex environments and large maps.
Smart Images

Figure CN117664119B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of path planning technology, and more specifically to path planning methods, electronic devices, and computer-readable storage media. Background Technology
[0002] Mobile devices need to move based on path planning within the designated area to avoid collisions with obstacles. A fully covered path is fundamental for a robot's task execution and must be characterized by high efficiency in path planning and high coverage. Taking a cleaning robot as an example, it needs to plan a path that covers the entire cleaning area during cleaning.
[0003] Commonly used obstacle maps are grid maps. Existing full-coverage path planning methods generally filter obstacles grid by grid and then plan the path accordingly. This method is slow when the environment is complex or the map is large, resulting in low efficiency in path planning. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a path planning method, an electronic device, and a computer-readable storage medium to solve the problem of low efficiency in path planning.
[0005] According to a first aspect, embodiments of the present invention provide a path planning method, comprising:
[0006] Obtain the target map of the area to be planned;
[0007] The target map is parsed to determine the set of optional path points that are not occupied by obstacles;
[0008] When the connection between adjacent optional path point sets does not pass through an obstacle, the adjacent optional path point sets are merged to obtain a pre-connected point set;
[0009] When there are at least two pre-connection point sets, starting from the target point of the target pre-connection point set, search for the pre-connection point set corresponding to the shortest path that does not pass through the obstacle within a preset range.
[0010] The target pre-connection point set is merged with the searched pre-connection point set to determine the target planning path within the area to be planned.
[0011] The path planning method provided by the embodiment of the present application, after analyzing the target map to determine the set of optional path points not occupied by obstacles, the set of optional path points not passing through obstacles is filtered from the adjacent set of optional path points, and the set of pre-connected points is obtained by merging, and then the set of pre-connected points that can be connected in the preset range is filtered, the filtering of the set of connectable points is realized, and the search range is gradually reduced from the adjacent set of optional path points to the set of pre-connected points in the preset range, the efficiency of path planning is improved, and the demand of full-coverage path planning can be met.
[0012] According to the second aspect, the embodiment of the present application provides an electronic device, comprising a memory and a processor, which are connected in communication with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the path planning method in the first aspect or any one of the embodiments of the first aspect.
[0013] According to the third aspect, the embodiment of the present application provides a computer readable storage medium, which stores computer instructions for making the computer execute the path planning method in the first aspect or any one of the embodiments of the first aspect.
[0014] It should be noted that the corresponding beneficial effects of the electronic device and the computer readable storage medium provided by the embodiment of the present application are described above in the description of the path planning method, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0016] Figure 1 is a flowchart of the path planning method according to the embodiment of the present application;
[0017] Figure 2 is a flowchart of the path planning method according to the embodiment of the present application;
[0018] Figure 3 is a schematic diagram of the target map and the region to be planned according to the embodiment of the present application;
[0019] Figure 4 is a schematic diagram of the set of pre-connected points according to the embodiment of the present application;
[0020] Figure 5is a flow chart of a path planning method according to an embodiment of the present application;
[0021] Figure 6 is a structural block diagram of a path planning device according to an embodiment of the present application;
[0022] Figure 7 is a hardware structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0023] To make the objectives, technical solutions and advantages of embodiments of the present application clearer, the technical solutions in embodiments of the present application will be described clearly and completely below with reference to the drawings in embodiments of the present application. Obviously, the described embodiments are some but not all of embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0024] The path planning method provided by the embodiments of the present application can be used for a self-moving device, such as a sweeping robot, a cleaning robot, a machine guide device, and the like, and the specific application scenarios thereof are not limited herein. Alternatively, the path planning method provided by the embodiments of the present application can be used for a management platform of a mobile device. The management platform performs the path planning method described in the embodiments of the present application to plan a target planning path for a region to be planned, and then issues the target planning path to the mobile device, so that the mobile device moves based on the target planning path.
[0025] Based on this, the electronic device described in the embodiments of the present application includes but is not limited to a self-moving device, a management platform, and the like, and can be set according to actual needs.
[0026] According to the embodiments of the present application, a path planning method embodiment is provided. It should be noted that the steps shown in the flow chart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although a logical order is shown in the flow chart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0027] In the present embodiment, a path planning method is provided, which can be used for the above-mentioned electronic device, Figure 1 is a flow chart of a path planning method according to an embodiment of the present application, as Figure 1 shown, the flow includes the following steps:
[0028] S11, obtaining a target map of a region to be planned.
[0029] The target map is a constructed obstacle map, and the region to be planned is a region for which the electronic device needs to plan a path, i.e., a moving region of a subsequent mobile device. When the electronic device is a mobile device, the region to be planned is issued by a management platform of the mobile device. When the electronic device is a management platform, the region to be planned is set by the management platform based on actual needs, for example, the management platform provides an interactive interface, and a user sets on the interactive interface, and accordingly, the management platform determines the region to be planned.
[0030] The target map corresponds to the region to be planned, and can be obtained by cutting from a large map. Specifically, when the region to be planned is obtained, the position information of the region to be planned is obtained, and the position information is used to cut from the large map to obtain the target map.
[0031] For example, the large map is an obstacle map of region A, the region to be planned is a part of region A, and the electronic device cuts the map from the obstacle map of region A using the position information of the part to obtain the target map.
[0032] The target map includes information of obstacles, for example, the target map is represented by a grid map, and each grid has a corresponding identifier. If occupied by an obstacle, the identifier is 0; if not occupied by an obstacle, the identifier is 1. Of course, the specific representation form of the identifier is not limited to the above-mentioned numbers 0 or 1, and other forms can also be used for representation, which is not limited herein. The size of the grid of the grid map depends on the resolution of the target map.
[0033] The specific steps will be described in detail below.
[0034] S12, analyzing the target map to determine a set of optional path points not occupied by obstacles.
[0035] The electronic device analyzes the target map obtained in S11 to obtain the position information of the obstacles, and accordingly, determines a set of optional path points not occupied by obstacles in the target map. The set of optional path points indicates that the path points are passable.
[0036] Continuing with the example above, the electronic device analyzes the identifiers of the grids in the target map. When the identifier is 0, it indicates that the grid is occupied by an obstacle; when the identifier is 1, it indicates that the grid is not occupied by an obstacle, and the grid is determined as an optional path point not occupied by an obstacle.
[0037] The electronic device filters out a set of optional path points not occupied by obstacles by analyzing all grids of the target map. Since the set of optional path points is obtained at this time, the set of optional path points can be merged to form a planned path, and therefore, the set of optional path points is merged in the subsequent steps to form a target planned path.
[0038] S13, merging the adjacent optional path point sets to obtain a pre-connection point set when the connection between the adjacent optional path point sets does not pass through the obstacle.
[0039] When the electronic device merges the optional path point sets, it first analyzes the adjacent optional path point sets to determine whether the connection between the adjacent optional path point sets passes through the obstacle. The adjacent optional path point sets are determined according to a preset direction, which can be searching for other optional path point sets within a resolution specified range with the first optional path point in the optional path point set as the starting point. If other optional path point sets are found, it is considered that there are adjacent optional path point sets. The first optional path point in each optional path point set can be defined as the first optional path point added to the optional path point set, which can also be referred to as the starting point of the optional path point set. The last optional path point added to the optional path point set can be referred to as the end point of the optional path point set.
[0040] For example, through two adjacent optional path point sets a and b, wherein,
[0041] The optional path point set a includes optional path points a1, a2, a3, and a4, wherein a1 is the starting point of the optional path point set a and a4 is the end point.
[0042] The optional path point set b includes optional path points b1, b2, b3, and b4, wherein b1 is the starting point of the optional path point set b and b4 is the end point.
[0043] The optional path point set a is adjacent to the optional path point set b. The electronic device can determine whether the connection between the starting point a1 of the optional path point set a and the starting point b1 of the optional path point set b passes through the obstacle. If not, the two point sets are merged. If so, it is determined whether the connection between the starting point a1 and the end point b4 passes through the obstacle. If not, the two point sets are merged. If so, it is determined whether the connection between the end point a4 and the starting point b1 passes through the obstacle. If so, it is determined whether the connection between the end point a4 and the end point b4 passes through the obstacle. If all pass through the obstacle, it is considered that the two point sets cannot be merged temporarily.
[0044] When the electronic device searches for adjacent optional path point sets, it first merges the adjacent path optional path point sets to obtain a pre-connection point set. At this time, the electronic device can obtain at least one pre-connection point set. When there is only one pre-connection point set, the path formed by the pre-connection point set is the target planning path. When there are at least two pre-connection point sets, at least two pre-connection point sets need to be merged again.
[0045] S14, when the pre-connection point set is at least two, taking the target point of the target pre-connection point set as the starting point, searching for the pre-connection point set corresponding to the shortest path not passing through the obstacle within the preset range.
[0046] When the electronic device obtains at least two pre-connection point sets, the electronic device can search for the shortest connectable path according to the positions of the pre-connection point sets in sequence. The shortest connectable path is the shortest path not passing through the obstacle.
[0047] For example, the electronic device sets a path list including the at least two pre-connection point sets obtained in S13, and starts from the first pre-connection point set, takes the pre-connection point set as the target pre-connection point set, and takes the target point of the target pre-connection point set as the starting point to search for the shortest connectable path within the preset range. If one of the target points is not searched, the other target point is switched to search, if searched, the searched shortest connectable path is merged, if not searched, the next pre-connection point set in the path list is taken as the target pre-connection point set to search. After each search is completed, the searched pre-connection point set can be marked. Of course, if the two target points of the pre-connection point set at the rear position in the path list are connected with other pre-connection point sets, the pre-connection point set does not need to be searched again. It should be noted that the target point corresponds to the starting point and the ending point of the optional path point set defined above.
[0048] S15, merging the target pre-connection point set and the searched pre-connection point set to determine the target planning path in the region to be planned.
[0049] As described above, when the electronic device searches for the pre-connection point set corresponding to the target pre-connection point set, the searched pre-connection point set is merged with the target pre-connection point set. Through multiple cycles, the shortest path bypassing the obstacle between the pre-connection point sets can be obtained, and the pre-connection point sets corresponding to the shortest path bypassing the obstacle are merged to determine the target planning path in the region to be planned.
[0050] If multiple unconnected point sets can be obtained after the connection process in S15, the search range can be expanded to continue searching for the shortest path bypassing the obstacle, so as to finally merge the target point set and obtain the target planning path based on the distribution of the optional path points in the target point set.
[0051] The step will be described in detail below.
[0052] The path planning method provided in the embodiment can be used for the electronic device described above,
[0053] In the embodiment, a path planning method is provided, which can be used for the electronic device described above, Figure 2 is a flowchart of the path planning method according to the embodiment of the present application, as shown in the figure, the flowchart comprises the following steps: Figure 2 as shown in the figure, the flowchart comprises the following steps:
[0054] S21, obtaining a target map of a region to be planned.
[0055] For details, please refer to S11 of the embodiment shown in the figure, which will not be repeated here. Figure 1
[0056] S22, analyzing the target map to determine a set of optional path points not occupied by obstacles.
[0057] Specifically, the above S22 comprises:
[0058] S221, analyzing the target map to determine the positions of each obstacle in the target map.
[0059] As described above, the target map is the obstacle map constructed, and the positions of each obstacle are included in the target map, so that the electronic device can obtain the positions of each obstacle when analyzing the target map.
[0060] S222, obtaining a resolution of path planning.
[0061] The resolution of path planning can be consistent with the resolution of the target map, or can be inconsistent, and can be that the resolution of path planning is a first resolution in a first direction and a second resolution in a second direction, etc. The specific size of the resolution is not limited here.
[0062] When the electronic device is a mobile device, the resolution can be issued by a management platform to the mobile device; when the electronic device is a management platform, the resolution can be set by a user in the management platform.
[0063] S223, sampling in the target map along a preset direction based on the resolution to obtain a sampling point.
[0064] The electronic device samples the target map along a preset direction using resolution to obtain sampling points. The preset direction can be customized; to reduce computational overhead, it can be aligned with the direction of the bounding box of the area to be planned. Therefore, in some embodiments, S223 includes:
[0065] (1) Calculate the minimum bounding box of the area to be planned to obtain the bounding box to be planned. The preset direction is the direction of the target side length of the bounding box to be planned.
[0066] (2) Sample along the target side length on the target map to obtain the sampling point.
[0067] The electronic device calculates the minimum bounding box of the area to be planned, for example, such as... Figure 3 As shown, the irregular shape represents the region to be planned, and the outer rectangle is the minimum bounding box, i.e., the bounding box to be planned. Specifically, using each side of the region to be planned as the X-axis and the vertical direction as the Y-axis, we obtain the minimum bounding rectangle parallel to the coordinate axes in this coordinate system. This operation is repeated for each side, and the rectangle with the smallest area is the desired bounding box to be planned.
[0068] After determining the bounding box to be planned, sampling points are obtained by using the length direction of the bounding box as a preset direction in the target map. For example, suppose the resolution of the length direction of the bounding box to be planned is rx, and the resolution of the width direction is ry. Specifically, in the coordinate axis of the region to be planned, starting from the origin, the length direction is determined as the target side length direction, and a point is taken every rx until the length boundary of the bounding box to be planned is reached. Then, the width direction is determined as the target side length direction, and the operation 'a' is repeated every ry until the width boundary of the bounding box to be planned is reached, thus obtaining the sampling points.
[0069] S224, based on the position of each obstacle, remove obstacle points from the sampling points to obtain a set of optional path points.
[0070] Specifically, the electronic device determines whether the sampling points are occupied by the obstacles along the length direction of the bounding box to be planned based on a preset starting point. If the first point is not occupied by the obstacles, the sampling point is added to the selectable path point set 1, and the determination of the next sampling point is performed. If the Nth sampling point is reached, it is determined that the Nth sampling point is occupied by the obstacles, and the sampling point is removed. Here, the selectable path point set 1 includes N-1 sampling points, that is, the selectable path point set 1 includes N-1 selectable path points. The first sampling point is the starting point of the selectable path point set, and the N-1th sampling point is the end point of the selectable path point set 1. The determination of the next sampling point is continued. If the next sampling point is not occupied by the obstacles, the next sampling point is added to the selectable path point set 2, and the next sampling point is taken as the starting point of the selectable path point set 2. The above determination process is continued until a sampling point occupied by the obstacles is encountered.
[0071] It should be noted that if the sampling point determined in the determination process is a point on the boundary of the bounding box to be planned, if the point is not occupied by the obstacles, the point is the end point of the selectable path point set; if the point is occupied by the obstacles, the previous sampling point not occupied by the obstacles is the end point of the selectable path point set.
[0072] The minimum bounding box of the region to be planned is determined as the bounding box to be planned, sampling is performed along the target edge length direction of the bounding box to be planned to obtain sampling points, and the sampling points occupied by the obstacles are removed to determine the selectable path point set. Subsequently, the connection of the selectable path point set can obtain a path similar to a bow-shaped path. The planning path is very regular, has obvious rules to follow, and is convenient for subsequent movement of the mobile device.
[0073] S23, when the connection between adjacent selectable path point sets does not pass through the obstacles, merging the adjacent selectable path point sets to obtain a pre-connection point set.
[0074] Specifically, the above S23 includes:
[0075] S231, searching for a target adjacent selectable path point set in the selectable path point set.
[0076] The target adjacent selectable path point set is an adjacent selectable path point set whose connection does not pass through the obstacles.
[0077] Since the set of optional path points is obtained by searching according to a preset direction, taking the length direction of the minimum bounding box of the area to be planned as an example, the optional path point sets are all distributed along the length direction of the minimum bounding box. Therefore, adjacent optional path point sets can be understood as two optional path point sets that are adjacent in the width direction. The electronic device first searches for adjacent optional path point sets, and then determines whether the connection between the searched adjacent optional path point sets does not pass through obstacles. If it does not pass through obstacles, then the adjacent optional path point set is the target adjacent optional path point set.
[0078] The merging of adjacent optional path point sets is as follows: The electronic device first determines the start and end points of the adjacent optional path point sets. For example, optional path point set 1 has a start point (x11, y11) and an end point (x12, y12); optional path point set 2 has a start point (x21, y21) and an end point (x22, y22). The electronic device first calculates the length of the connecting lines between the start point (x11, y11) and the start point (x21, y21), between the start point (x11, y11) and the end point (x22, y22), between the end point (x12, y12) and the start point (x21, y21), and between the end points (x12, y12) and (x22, y22), respectively. From these lengths, the shortest connecting line is selected, and then it is determined whether the shortest connecting line does not pass through an obstacle. If it does not pass through an obstacle, then adjacent optional path point sets 1 and 2 are determined as the target adjacent optional path point sets.
[0079] S232, merge the sets of adjacent optional path points of the target to obtain the pre-connected point set.
[0080] After determining the set of adjacent optional path points to the target, the electronic device merges them to obtain a pre-connected point set. Specifically, along the direction of the shortest connecting line in S231 above, optional path point set 2 is merged into optional path point set 1. For example, as... Figure 4 As shown, adjacent optional path point sets are merged along the length of the bounding box to be planned to obtain a pre-connected point set. Along the length of the bounding box to be planned, from left to right, the optional path points of optional path point set 1 and optional path point set 2 are arranged sequentially. When merging optional path point set 2 into optional path point set 1, the optional path points of optional path point set 2 are arranged in reverse order, that is, from right to left, and merged into optional path point set 1.
[0081] When searching adjacent optional path point sets for optional path point set 2, if the merging condition is met (i.e., the connecting line of the shortest path does not pass through an obstacle), then optional path point set 2 is merged with its adjacent optional path point sets. After all optional path point sets have been searched and judged, the pre-connected point set is obtained through the above-mentioned merging process of adjacent optional path point sets.
[0082] S24, when the set of pre-connection points is at least two, taking the target point of the set of target pre-connection points as a starting point, searching for a set of pre-connection points corresponding to the shortest path that does not pass through the obstacle within the preset range.
[0083] For details, see Figure 1 S14 of the embodiment shown will not be described here.
[0084] S25, merging the set of target pre-connection points and the searched set of pre-connection points to determine the target planning path in the region to be planned.
[0085] Specifically, the above S25 includes:
[0086] S251, merging the set of target pre-connection points and the searched set of pre-connection points to obtain a first merged point set.
[0087] The electronic device merges the set of target pre-connection points and the searched set of pre-connection points in the same way as merging the adjacent optional path point sets, to obtain the first merged point set. The specific merging method will not be described here.
[0088] S252, taking the target point of the first merged point set or the target point of other pre-connection points as a starting point, searching for a first shortest path that does not pass through the obstacle within the preset range.
[0089] Among them, the other pre-connection points are the pre-connection points that are not merged into the first merged point set.
[0090] After obtaining the first merged point set, continue to search for a first shortest path that does not pass through the obstacle in the first merged point set or other pre-connection points within the preset range, and if the first shortest path exists, continue to merge.
[0091] S253, based on the first shortest path, merging the first merged point set or other pre-connection points to obtain a second merged point set to determine the target planning path in the region to be planned.
[0092] After the electronic device determines the first shortest path, it merges the two point sets corresponding to the first shortest path to obtain a second merged point set. After the merging process of the first merged point set or other pre-connection points based on the preset range, the second merged point set is obtained. If there is only one second merged point set, the target planning path is obtained based on the optional path points in the second merged point set; if there are at least two second merged point sets, the search range needs to be expanded and the merging of the point sets needs to be performed again. In some embodiments, the above S253 includes:
[0093] (1) Based on the first shortest path, merging the first merged point set or other pre-connection points to obtain a second merged point set.
[0094] (2) When the second merging point set is at least two, starting from the target point of each second merging point set, searching for a second shortest path that does not pass through the obstacle in the target map.
[0095] (3) Based on the second shortest path, merging the corresponding second merging point set to obtain a third merging point set.
[0096] (4) When the third merging point set is at least two, determining the third merging point set corresponding to the longest path as the target planning path.
[0097] After obtaining at least two second merging point sets, the search range is expanded to the entire target map, and a second shortest path that does not pass through the obstacle is searched in the entire target map corresponding to each second merging point set. The second shortest path is for two second merging point sets, and the second shortest path is selected from the connectable paths of the two second merging point sets. If the second shortest path exists, the two second merging point sets connected by the second shortest path are merged to obtain a third merging point set. After multiple loop processing, if there are still at least two third merging point sets that cannot be merged in the entire target map, the point set corresponding to the longest path is selected from the third merging point sets that cannot be merged as the point set corresponding to the target planning path.
[0098] This is because when determining the region to be planned, in order to ensure that all regions are planned, the range of the region to be planned is generally set to be larger than the range of the actual planning region. Therefore, at least two third merging point sets that cannot be merged may be finally obtained. Because the optional path points of the third merging point set corresponding to the actual planning region are less, and the optional path points of the third merging point set corresponding to the actual planning region are more, the third merging point set corresponding to the longest path is determined as the target planning path. When there are at least two second merging point sets, the third merging point set is determined in the entire target map, the path planning from the adjacent path point to the preset range to the target map is realized, and the efficiency of the path planning is improved.
[0099] The path planning method provided in the embodiment uses resolution and a preset direction to sample in the target map, so that the obtained optional path point set meets the demand of path planning. The determination of the second merging point set based on the preset range reduces the search range and improves the efficiency of path planning.
[0100] In the embodiment, a path planning method is provided, which can be used in the electronic device described above, Figure 5 is a flowchart of the path planning method according to an embodiment of the present application, as shown in Figure 5 , the flowchart includes the following steps:
[0101] S31, obtaining a target map of a region to be planned.
[0102] Specifically, the S31 includes the following steps.
[0103] S311, acquire an initial map and a region to be planned.
[0104] The initial map is a large map of a region where the region to be planned is located. For example, for a region to be planned a1 in a region A, the initial map is a map of the region A, and a subsequent target map is a map of the region to be planned a1. For the acquisition method of the region to be planned, please refer to the description above, which will not be repeated here.
[0105] S312, intercept a minimum map region including the region to be planned in the initial map along a coordinate system direction of the initial map, and determine a target map.
[0106] The coordinate system direction of the initial map is the map coordinate system. The electronic device determines the minimum map region including the region to be planned in the map coordinate system, and performs map interception in the initial map using the minimum map region to obtain the target map. The intercepted target map is parallel to the x-axis and the y-axis in the initial map coordinate system, respectively.
[0107] In some embodiments, the S312 includes the following steps.
[0108] (1) intercept a minimum map region including the region to be planned in the initial map along a coordinate system direction of the initial map.
[0109] (2) perform inflation processing on obstacles in the minimum map region to determine inflated obstacles.
[0110] (3) acquire a size of a mobile device.
[0111] (4) determine a safety distance from the obstacles based on the size of the mobile device, the mobile device being used to move in the region to be planned.
[0112] (5) determine a cost value of a position point where the inflated obstacles are located based on the safety distance, determine a cost value of each position point of the target map to determine the target map, the cost value representing an impassable probability of the mobile device.
[0113] After the electronic device obtains the minimum map region of the region to be planned by interception, the electronic device performs inflation processing on the obstacles in the minimum map region to determine the inflated obstacles. The inflation processing can be to expand the obstacles by a certain ratio, or to expand the obstacles by a preset distance outward from the region where the obstacles are located to obtain the inflated obstacles.
[0114] Mobile devices are those that subsequently move within the planned area. The size of these mobile devices can be set when the planned area is defined. Different sizes can be set for different mobile devices. Based on this, electronic devices determine their safe distances from obstacles according to their respective sizes. After obtaining the safe distances, the cost value of the location point relative to the expanded obstacle can be set; that is, the probability that the mobile device's location point relative to the expanded obstacle is passable can be set. The farther away from the obstacle, the lower the cost value. For locations where no obstacles exist in the target map, their cost value can be set to 0, thus determining the cost value of all locations in the target map. The cost value can be determined based on the size of the safe distance. For example, if the cost value per unit distance is set to c, then the cost value of each location point within the distance from the obstacle to the safe distance can be determined by combining the distance from the obstacle to the safe distance with the cost value per unit distance.
[0115] Obstacles are inflated, and the cost of each location point in the target map is determined in combination with the size of the mobile device. The purpose of inflating is twofold: firstly, to ensure that the planned path is at a certain distance from the obstacle; and secondly, to reduce the amount of search data for subsequent connectable paths and improve search efficiency.
[0116] S32, parse the target map to determine the set of optional path points not occupied by obstacles.
[0117] The electronic device queries each location point on the target map to obtain the cost value of each location point, and then compares the cost value of each location point on the target map with the cost value threshold to determine the set of optional path points that are not occupied by obstacles.
[0118] For further details, please see Figure 2 S22 of the illustrated embodiment will not be described again here.
[0119] S33, when the connection between adjacent optional path point sets does not pass through an obstacle, the adjacent optional path point sets are merged to obtain a pre-connected point set.
[0120] Please see details Figure 2 S23 of the illustrated embodiment will not be described again here.
[0121] S34, when there are at least two pre-connected point sets, take the target point of the target pre-connected point set as the starting point and search for the pre-connected point set corresponding to the shortest path that does not pass through the obstacle within the preset range.
[0122] Please see details Figure 1 S24 of the illustrated embodiment will not be described again here.
[0123] S35, merging the target pre-connection point set with the searched pre-connection point set to determine a target planning path in the region to be planned.
[0124] For details, please refer to Figure 2 S25 of the embodiment shown will not be described here.
[0125] The path planning method provided in this embodiment reduces the amount of data processing by determining the target map along the coordinate system direction of the initial map, only translation transformation is needed, and rotation transformation is not needed, which reduces the amount of data processing. If the minimum bounding box is intercepted, there will be an interception error of the discrete grid, and rotation transformation will also produce an error, that is, the method also improves the accuracy of obtaining the target map from the initial map.
[0126] As an optional example of this embodiment, the method comprises:
[0127] (1) Obtain the target map: obtain the minimum rectangle parallel to the coordinate system of the initial map in the region to be planned, intercept the rectangle as the target map, and dilate the obstacles in the target map, and determine the generation value of each position point in the target map. The purpose of this step is to reduce the calculation amount of Dijkstra potential field in the subsequent merging process and improve the calculation efficiency.
[0128] (2) Obtain the minimum bounding box of the region to be planned, that is, the planned bounding box.
[0129] Take each edge of the region to be planned as the X axis and the vertical direction as the Y axis, obtain the minimum bounding rectangle parallel to the coordinate axes in this coordinate system. Repeat this operation for each edge, and finally obtain the minimum rectangle as the planned bounding box.
[0130] (3) Obtain the furrow path point, that is, the optional path point: the furrow path point is the path point in the planned bounding box parallel to the coordinate axis and not occupied by the obstacle.
[0131] Suppose the resolution of the furrow path point in the length direction of the planned bounding box is rx, and the resolution in the width direction is ry.
[0132] a. In the coordinate axes of the planned bounding box, take the origin as the starting point, take a point every rx along the length direction, and repeat the operation of a until the planned bounding box is exceeded.
[0133] b. Then, start every ry along the width direction, and repeat the operation of a.
[0134] c. Remove the points occupied by the obstacle in the above operation.
[0135] d. The points left after the processing in step c are stored as a point set respectively, and the optional path point set is obtained, i.e. all the ploughing points are obtained.
[0136] (4) Pre-connection
[0137] The optional path point set obtained in step (3) needs to be merged before it can be combined into a complete path. The pre-connection function is to merge the point sets that can be directly connected, i.e. the point sets whose ends are connected without crossing the obstacles. The process is as follows:
[0138] a. Each point set has a start point and an end point. Suppose that the start point (x11, y11) and the end point (x12, y12) of the adjacent point set 1, and the start point (x21, y21) and the end point (x22, y22) of the adjacent point set 2.
[0139] b. For two adjacent point sets, the length of the connection line between the start points and the end points is compared: first, the lengths of the connection lines between the start point (x11, y11) and the start point (x21, y21), the start point (x11, y11) and the end point (x22, y22), the end point (x12, y12) and the start point (x21, y21), and the end point (x12, y12) and the end point (x22, y22) are calculated respectively, and the shortest one is taken as the shortest path. If no obstacle is crossed, i.e. the pre-merging is successful, the adjacent optional path point sets are merged into a new point set. If the connection fails, the status remains unchanged.
[0140] c. Repeat step b for all adjacent point sets.
[0141] If all the point sets have been merged into one point set after step (4), the full coverage path planning is completed, and the complete path is obtained. If there are still multiple point sets, step (5) is entered.
[0142] (5) Rough connection: The purpose of this step is to obtain the shortest path between the point sets around the obstacles.
[0143] a. Starting from the end point y1 of the point set, the Dijkstra potential field is expanded, and the range of the expanded potential field is R. Within the range of the expanded potential field, the start points and the end points of other point sets are traversed to obtain the point y2 with the minimum distance from the end point y1, and then the Dijkstra connection y1y2 is used to merge the two point sets and the path, and a new point set is obtained. If there is no other point set within the range of the potential field, the status remains unchanged.
[0144] b. Repeat step a for all point sets.
[0145] If all the point sets are merged into one point set after step (5), the full coverage path planning is completed, and a complete path is obtained. If there are still multiple point sets, step (6) is entered.
[0146] (6) Final connection: The purpose of this step is to merge all the point sets that can be merged.
[0147] a. Starting from the end point y1 of the point set, the Dijkstra potential field is expanded, and the range of the expanded potential field is the entire local map. In the range of the expanded potential field, the start point and the end point of other point sets are traversed to obtain a point y2 with the minimum distance from the end point y1, and then y1y2 is connected using Dijkstra, and then the two point sets and the path are merged to obtain a new point set. If there is no other point set in the range of the potential field, the status remains unchanged.
[0148] b. All point sets are traversed, and step a is repeated.
[0149] c. In the remaining point sets, the longest path is selected as the final full coverage path.
[0150] By obtaining the target map, pre-connection, rough connection, final connection, etc., the data processing amount is reduced, the planning efficiency of the full coverage path is greatly improved, and the full coverage path can be planned in real time in a large map.
[0151] As a specific application example of the embodiment, the electronic device is a cleaning robot, and the cleaning robot is controlled by a management platform, which includes but is not limited to a server, a mobile terminal, and the like. The cleaning robot obtains a to-be-planned area and an initial map issued by the corresponding management platform, and determines a target planning path in the to-be-planned area by executing the path planning method in the embodiment of the application. In the cleaning process, the cleaning robot cleans according to the target planning path.
[0152] As another specific application example of the embodiment, the electronic device is a management platform for guiding a robot. After the management platform obtains a to-be-planned area and an initial map, the target planning path corresponding to each size of mobile device is determined by executing the path planning method in the embodiment of the application, and the target planning path is issued to the corresponding mobile device, so that the mobile device walks in the target planning path.
[0153] In the embodiment, a path planning device is also provided, which is used to implement the above embodiments and preferred embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0154] The embodiment provides a path planning device, which comprises: Figure 6 as shown in the figure, comprising:
[0155] An acquisition module 41 is configured to acquire a target map of a region to be planned.
[0156] An analysis module 42 is configured to analyze the target map and determine a set of optional path points which are not occupied by obstacles.
[0157] A first merging module 43 is configured to merge adjacent sets of optional path points to obtain a set of pre-connected points when a connection between the adjacent sets of optional path points does not pass through an obstacle.
[0158] A search module 44 is configured to, when the set of pre-connected points is at least two, search for a set of pre-connected points corresponding to a shortest path which does not pass through an obstacle within a preset range, with a target point of a target set of pre-connected points as a starting point.
[0159] A second merging module 45 is configured to merge the target set of pre-connected points and the searched set of pre-connected points to determine a target planning path in the region to be planned.
[0160] In some embodiments, the analysis module 42 comprises:
[0161] An analysis unit is configured to analyze the target map and determine positions of various obstacles in the target map.
[0162] A first acquisition unit is configured to acquire a resolution of path planning.
[0163] A sampling unit is configured to sample in a preset direction in the target map based on the resolution to obtain a sampling point.
[0164] A removal unit is configured to remove an obstacle point from the sampling point based on the positions of the various obstacles to obtain the set of optional path points.
[0165] In some embodiments, the sampling unit comprises:
[0166] A calculation subunit is configured to calculate a minimum bounding box of the region to be planned to obtain a region-to-be-planned bounding box, and the preset direction is a target edge length direction of the region-to-be-planned bounding box.
[0167] A sampling subunit is configured to sample in the target edge length direction in the set of optional path points to obtain the target path point.
[0168] In some embodiments, the first merging module 43 comprises:
[0169] The first searching unit is configured to search a target adjacent optional path point set from the optional path point set, the target adjacent optional path point set being an adjacent optional path point set not passing through an obstacle.
[0170] The first merging unit is configured to merge the target adjacent optional path point set to obtain the pre-connection point set.
[0171] In some embodiments, the second merging module 45 comprises:
[0172] The second merging unit is configured to merge the target pre-connection point set and the searched pre-connection point set to obtain a first merged point set.
[0173] The second searching unit is configured to search a first shortest path not passing through an obstacle in the preset range, starting from a target point of the first merged point set or a target point of another pre-connection point set, wherein the another pre-connection point set is a pre-connection point set not merged into the first merged point set.
[0174] The third merging unit is configured to merge the first merged point set or another pre-connection point set based on the first shortest path to obtain a second merged point set, so as to determine a target planning path in the region to be planned.
[0175] In some embodiments, the third merging unit comprises:
[0176] The first connecting sub-unit is configured to merge the first merged point set or another pre-connection point set based on the first shortest path to obtain a second merged point set.
[0177] The searching sub-unit is configured to search a second shortest path not passing through an obstacle in the target map, starting from a target point of each second merged point set when the second merged point set is at least two.
[0178] The second connecting sub-unit is configured to merge a corresponding second merged point set based on the second shortest path to obtain a third merged point set.
[0179] The first determining sub-unit is configured to determine the third merged point set corresponding to the longest path as the target planning path when the third merged point set is at least two.
[0180] In some embodiments, the acquisition module 41 comprises:
[0181] The second acquisition unit is configured to acquire an initial map and the region to be planned.
[0182] The intercepting unit is configured to intercept a minimum map region including the region to be planned in the initial map along a coordinate system direction of the initial map to determine the target map.
[0183] In some embodiments, the intercepting unit comprises:
[0184] an intercepting subunit configured to intercept, in the initial map, a minimum map region including the region to be planned along a coordinate system direction of the initial map;
[0185] an expanding subunit configured to perform an expanding process on obstacles in the minimum map region to determine expanded obstacles;
[0186] an obtaining subunit configured to obtain a size of a mobile device;
[0187] a second determining subunit configured to determine a safety distance between the mobile device and the obstacles based on the size of the mobile device, the mobile device being configured to move in the region to be planned;
[0188] a third determining subunit configured to determine a cost value of a position point where the expanded obstacles are located based on the safety distance, and determine a cost value of each position point in the target map to determine the target map, the cost value representing an impassable probability of the mobile device.
[0189] In some embodiments, the analyzing module comprises:
[0190] a comparing module configured to compare the cost value of each position point in the target map with a cost value threshold to determine a set of optional path points not occupied by the obstacles.
[0191] The path planning device in the embodiments is presented in the form of functional units, and the units herein refer to ASIC circuits, processors and memories executing one or more software or fixed programs, and / or other devices capable of providing the above functions.
[0192] Further function descriptions of the above modules are the same as those of the corresponding embodiments, and will not be repeated here.
[0193] The embodiments of the present application also provide an electronic device having the above path planning device. Figure 6 as shown in the path planning device.
[0194] Please refer to Figure 7 , Figure 7 is a structural schematic diagram of an electronic device provided by the optional embodiments of the present application, as shown in Figure 7As shown, the electronic device can include at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, a memory 54, and at least one communication bus 52. The communication bus 52 is used to realize the connection and communication between the components. The communication interface 53 can include a display, a keyboard, and can also include a standard wired interface and a wireless interface. The memory 54 can be a high-speed RAM memory, and can also be a non-volatile memory, such as at least one disk memory. The memory 54 can also be at least one storage device located away from the aforementioned processor 51. The processor 51 can be combined with Figure 6 The described device, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 for executing any of the above method steps.
[0195] The communication bus 52 can be a PCI (peripheral component interconnect) bus or an EISA (extended industry standard architecture) bus, etc. The communication bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0196] The memory 54 can include a volatile memory, such as a RAM (random-access memory); the memory can also include a non-volatile memory, such as a flash memory, a hard disk (HDD) or a solid-state disk (SSD); the memory 54 can also include a combination of the above types of memories.
[0197] The processor 51 can be a CPU, a network processor (NP), or a combination of a CPU and an NP.
[0198] The processor 51 can further include a hardware chip. The hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0199] Optionally, the memory 54 is further configured to store program instructions. The processor 51 can invoke the program instructions to implement the path planning method as shown in any embodiment of the present application.
[0200] The embodiments of the present application further provide a non-transitory computer storage medium, which stores computer executable instructions. The computer executable instructions can execute the path planning method in any method embodiment described above. The storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc. The storage medium can also include a combination of the above-mentioned types of memories.
[0201] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes are intended to fall within the scope of the appended claims.
Claims
1. A path planning method characterized by, The method comprises the following steps: acquiring a target map of a region to be planned; analyzing the target map to determine a set of optional path points not occupied by obstacles; merging adjacent sets of optional path points to obtain a set of pre-connected points when the connection between the adjacent sets of optional path points does not pass through obstacles; when the set of pre-connected points is at least two, taking a target point of a target set of pre-connected points as a starting point to search for a set of pre-connected points corresponding to a shortest path not passing through obstacles within a preset range; merging the target set of pre-connected points and the searched set of pre-connected points to determine a target planning path in the region to be planned.
2. The method of claim 1, wherein, The step of analyzing the target map to determine a set of optional path points not occupied by obstacles comprises the following steps: analyzing the target map to determine the positions of various obstacles in the target map; acquiring a resolution for path planning; sampling in a preset direction in the target map based on the resolution to obtain sampling points; removing obstacle points from the sampling points based on the positions of the various obstacles to obtain the set of optional path points.
3. The method of claim 2, wherein, The step of sampling in a preset direction in the target map based on the resolution to obtain sampling points comprises the following steps: calculating a minimum bounding box of the region to be planned to obtain a planning bounding box, and the preset direction is a target edge length direction of the planning bounding box; sampling in the target edge length direction in the target map to obtain the sampling points.
4. The method of claim 1, wherein, The step of merging adjacent sets of optional path points to obtain a set of pre-connected points when the connection between the adjacent sets of optional path points does not pass through obstacles comprises the following steps: searching for a target adjacent set of optional path points in the set of optional path points, the target adjacent set of optional path points being an adjacent set of optional path points whose connection does not pass through obstacles; merging the target adjacent set of optional path points to obtain the set of pre-connected points.
5. The method of claim 1, wherein, The step of merging the target set of pre-connected points and the searched set of pre-connected points to determine a target planning path in the region to be planned comprises the following steps: merging the target set of pre-connected points and the searched set of pre-connected points to obtain a first merged set of points; taking a target point of the first merged set of points or a target point of another set of pre-connected points as a starting point to search for a first shortest path not passing through obstacles within the preset range, the other set of pre-connected points being a set of pre-connected points not merged into the first merged set of points; based on the first shortest path, merging the first merged set of points or the other set of pre-connected points to obtain a second merged set of points to determine the target planning path in the region to be planned.
6. The method of claim 5, wherein, The step of merging the first merged set of points or the other set of pre-connected points based on the first shortest path to obtain a second merged set of points to determine the target planning path in the region to be planned comprises the following steps: based on the first shortest path, merging the first merged set of points or the other set of pre-connected points to obtain a second merged set of points; when the second merged set of points is at least two, taking a target point of each of the second merged set of points as a starting point to search for a second shortest path not passing through obstacles in the target map; merge the second merging point set corresponding to the second shortest path to obtain a third merging point set; when the third merging point set is at least two, determine the third merging point set corresponding to the longest path as the target planning path.
7. The method of claim 1, wherein, The target map of the region to be planned includes: obtaining an initial map and the region to be planned; along the coordinate system direction of the initial map, intercepting a minimum map region including the region to be planned in the initial map to determine the target map.
8. The method of claim 7, wherein, The target map of the region to be planned includes: along the coordinate system direction of the initial map, intercepting a minimum map region including the region to be planned in the initial map; obtaining the size of the mobile device; determining a safety distance between the mobile device and the obstacle based on the size of the mobile device, the mobile device being used to move in the region to be planned; determining the cost value of the position point of the expanded obstacle based on the safety distance, determining the cost value of each position point of the target map to determine the target map, the cost value representing the impassable probability of the mobile device. including:
9. An electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the path planning method of any one of claims 1-8. The computer readable storage medium stores computer instructions for causing a computer to execute the path planning method of any one of claims 1-8.
10. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Indoor path planning method, terminal and readable storage medium
CN109668561A
Path planning method and system, and terminal device
CN109947100A