Path planning method and related device, electronic equipment and storage medium
1. A method of path planning, comprising:
generating a grid map based on the environment information; the grid map comprises a plurality of grids, wherein the grids comprise a starting grid, an end grid and a candidate grid, the starting grid represents the grid where a path starting point is located, the end grid represents the grid where a path end point is located, the candidate grid is located in an activity area outside an obstacle, and a first distance from the grid to the obstacle is marked on each grid;
for each candidate grid within a first region surrounding a reference grid, selecting the candidate grid as a selected grid based on a first path cost of each candidate grid; wherein the reference grid is the candidate grid selected as the selected grid in the previous time, and the first path cost is obtained based on a first distance marked by the candidate grid;
and obtaining a motion path from the path starting point to the path end point based on the starting point grid, the end point grid and the selected grids selected in the past.
2. The method of claim 1, wherein the first path cost comprises a first cost that is derived based on a first distance labeled by the candidate grid, and wherein the first distance labeled by the candidate grid is negatively correlated with the first cost of the candidate grid.
3. The method of claim 2, wherein the step of obtaining the first cost comprises:
selecting a preset interval corresponding to a first distance marked by the candidate grid from a plurality of preset intervals as a target interval; the cost coefficients correspond to the preset intervals respectively, and the larger the endpoint value of the preset interval is, the smaller the cost coefficient corresponding to the preset interval is;
and weighting the first distance marked by the candidate grid by using the cost coefficient of the target interval to obtain the first cost of the candidate grid.
4. The method according to claim 3, wherein the motion path is used for providing navigation information for a moving object, the endpoint value of the preset interval is set based on the width of the moving object, and the moving object moves along the length direction of the moving object during the motion.
5. The method according to claim 3, wherein the preset interval with the largest endpoint value corresponds to the cost coefficient of 0.
6. The method of claim 2, wherein the first path cost further comprises a second cost, and wherein the second cost is derived based on a second distance of the candidate grid from the reference grid;
and/or the first path cost further comprises a third cost, wherein the third cost is obtained based on a third distance from the reference grid to the starting grid;
and/or the first path cost further comprises a fourth cost, and the fourth cost is obtained based on a fourth distance from the candidate grid to the end-point grid.
7. The method according to claim 1, wherein the obtaining the motion path from the path starting point to the path ending point based on the starting point grid, the ending point grid and the selected grids selected in the past times comprises:
taking the end point grid as a path grid;
for each selected raster in a second area surrounding the path raster, selecting one selected raster as a new path raster based on a respective second path cost of the selected raster; wherein the second path cost is derived based on the first distance labeled by the selected grid;
in response to the selected path grid not being the starting grid, re-executing the step of selecting one of the selected grids as a new path grid based on respective second path costs of the selected grids for each of the selected grids in a second area surrounding the path grid until the selected path grid is the starting grid;
and obtaining the motion path based on the path grids selected in the past.
8. The method of claim 7, wherein the second path cost is independent of a distance of the selected grid from the destination grid;
and/or selecting one of the selected grids as a new path grid based on respective second path costs of the selected grids, comprising:
and selecting the selected raster corresponding to the minimum second path cost as the new path raster.
9. The method of claim 1, wherein the motion path comprises a number of path points from the path start point to the path end point; after obtaining the motion path from the path starting point to the path ending point based on the starting point grid, the ending point grid and the selected grid selected in the past, the method further comprises:
respectively detecting the shortest distance from each path point to the obstacle;
in response to that the shortest distance corresponding to the path point meets a preset condition, smoothing the motion path at the path point;
and obtaining a smooth path based on the processing result of the motion path at each path point.
10. The method according to claim 9, wherein the preset condition comprises: the shortest distance is greater than a preset threshold value;
the smooth path is used for providing navigation information for a moving object, the preset threshold is set based on the width of the moving object, and the moving object moves along the length direction of the moving object in the moving process.
11. A path planning apparatus, comprising:
the map generation module is used for generating a grid map based on the environment information; the grid map comprises a plurality of grids, wherein the grids comprise a starting grid, an end grid and a candidate grid, the starting grid represents the grid where a path starting point is located, the end grid represents the grid where a path end point is located, the candidate grid is located in an activity area outside an obstacle, and a first distance from the grid to the obstacle is marked on each grid;
a grid selection module, configured to select, for each candidate grid in a first region surrounding a reference grid, the candidate grid as a selected grid based on a first path cost of each candidate grid; wherein the reference grid is the candidate grid selected as the selected grid in the previous time, and the first path cost is obtained based on a first distance marked by the candidate grid;
and the path generating module is used for obtaining a motion path from the path starting point to the path end point based on the starting point grid, the end point grid and the selected grids selected in the past.
12. An electronic device comprising a memory and a processor coupled to each other, the memory having stored therein program instructions, the processor being configured to execute the program instructions to implement the path planning method according to any one of claims 1 to 10.
13. A computer-readable storage medium, in which program instructions executable by a processor are stored, the program instructions being for implementing the path planning method of any one of claims 1 to 10.
Background
With the development of information technology, path planning is widely applied in various fields such as path navigation and unmanned driving, so that path planning is always a research hotspot, and the planning quality of the path planning is generally evaluated by adopting a series of standards. Through research and test, the existing path planning algorithm such as Dijkstra has a better effect on the path planning length, and can better meet the requirement of planning the shortest path from a starting point to a terminal point.
However, the inventor of the present application has found that the existing path planning algorithm generally regards a moving object such as a person or a vehicle as a particle, so that the planned path may pass through a gap between obstacles, and when the gap is particularly small, the moving object may not actually pass through the gap when moving along the path. Therefore, the existing path planning still has potential safety hazards. In view of this, how to improve the safety of path planning becomes an urgent problem to be solved.
Disclosure of Invention
The technical problem mainly solved by the present application is to provide a path planning method, a related device, an electronic device, and a storage medium, which can improve the safety of path planning.
In order to solve the above technical problem, a first aspect of the present application provides a path planning method, including: generating a grid map based on the environment information; the grid map comprises a plurality of grids, the grids comprise a starting point grid, an end point grid and candidate grids, the starting point grid represents a grid where a path starting point is located, the end point grid represents a grid where a path end point is located, the candidate grids are located in an activity area outside an obstacle, and a first distance from each grid to the obstacle is marked; for each candidate grid in a first region surrounding a reference grid, selecting the candidate grid as a selected grid based on a first path cost of each candidate grid; the reference grid is a candidate grid which is selected as a selected grid in the previous time, and the first path cost is obtained based on a first distance marked by the candidate grid; and obtaining a motion path from the path starting point to the path end point based on the starting point grid, the end point grid and the selected grids selected in the past.
In order to solve the above technical problem, a second aspect of the present application provides a path planning apparatus, including: the map generation module is used for generating a grid map based on the environment information; the grid map comprises a plurality of grids, the grids comprise a starting point grid, an end point grid and candidate grids, the starting point grid represents a grid where a path starting point is located, the end point grid represents a grid where a path end point is located, the candidate grids are located in an activity area outside an obstacle, and a first distance from each grid to the obstacle is marked; a grid selection module, configured to select, for each candidate grid in a first region surrounding a reference grid, the candidate grid as a selected grid based on a first path cost of each candidate grid; the reference grid is a candidate grid which is selected as a selected grid in the previous time, and the first path cost is obtained based on a first distance marked by the candidate grid; and the path generation module is used for obtaining a motion path from the path starting point to the path end point based on the starting point grid, the end point grid and the selected grid selected in the past.
In order to solve the above technical problem, a third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, where the memory stores program instructions, and the processor is configured to execute the program instructions to implement the path planning method in the first aspect.
In order to solve the above technical problem, a fourth aspect of the present application provides a computer-readable storage medium storing program instructions executable by a processor, the program instructions being configured to implement the path planning method in the first aspect.
In the above scheme, a grid map is generated based on the environment information, the grid map includes a plurality of grids including a start grid representing a grid where a route start point is located, an end grid representing a grid where a route end point is located, and candidate grids located in an active region outside the obstacle, each of the grids being labeled with a first distance from the grid to the obstacle, and for each of the candidate grids in a first region surrounding a reference grid, the candidate grid is selected as a selected grid based on a first route cost of each of the candidate grids, the reference grid being a candidate grid selected as the selected grid at a previous time, the first route cost being obtained based on the first distance labeled by the candidate grid, so that a motion route from the route start point to the route end point is obtained based on the start grid, the end grid, and the selected grid selected at a previous time, because each grid is marked with the first distance from the grid to the obstacle, the first path cost of the candidate grid is considered in the process of selecting the candidate grid as the selected grid, and the first path cost is obtained based on the first distance marked by the candidate grid, the first distance from the candidate grid to the obstacle can restrict the selection of the candidate grid in the path planning process, the possibility that the motion path passes through the actual gap which cannot pass through is favorably reduced as much as possible, and the safety of the path planning can be improved.
Drawings
Fig. 1 is a schematic flowchart of an embodiment of a path planning method according to the present application;
FIG. 2 is a schematic diagram of an embodiment of a grid map;
FIG. 3 is a schematic diagram of another embodiment of a grid map;
FIG. 4 is a schematic diagram of an embodiment of a distance map;
FIG. 5 is a schematic view of one embodiment of an AGV;
FIG. 6 is a schematic flow chart diagram illustrating another embodiment of a path planning method according to the present application;
FIG. 7 is a schematic diagram of one embodiment of a motion path and a smoothing path;
FIG. 8 is a block diagram of an embodiment of a path planning apparatus according to the present application;
FIG. 9 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 10 is a block diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The following describes in detail the embodiments of the present application with reference to the drawings attached hereto.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, the term "plurality" herein means two or more than two.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a path planning method according to an embodiment of the present application. Specifically, the method may include the steps of:
step S11: based on the environment information, a grid map is generated.
In the embodiment of the present disclosure, the grid map includes several grids. Specifically, each grid may include a plurality of pixels, such as one pixel, or may include four pixels, or may include nine pixels, which is not limited herein. Referring to fig. 2, fig. 2 is a schematic diagram of an embodiment of a grid map. As shown in fig. 2, each rectangular grid represents a grid, and each grid includes two rows and two columns of four pixels (as indicated by the dotted-line boxes filled with dot-shaped hatching). It should be noted that, the side length of each grid may be expressed as that the grid corresponds to the length in the real scene, for example, the side length of each grid may correspond to 10 centimeters, 20 centimeters, 30 centimeters, and so on in the real scene, and is not limited herein. In addition, fig. 2 is only one possible arrangement manner of the grids in the real scene, and the specific pixel points included in the grids are not limited, for example, each grid may also include nine pixel points, which are three rows and three columns, or may include sixteen pixel points, which are four rows and four columns, and this is not illustrated here.
In the embodiment of the present disclosure, the grids include a starting point grid, an end point grid and a candidate grid, the starting point grid represents a grid where a path starting point is located, the end point grid represents a grid where a path end point is located, and the candidate grid is located in an active region outside the obstacle. With continued reference to fig. 2, the circles hatched with horizontal lines in fig. 2 represent the start points of the paths, the rectangular squares where the circles are located represent the start point grids, and the circles hatched with vertical lines in fig. 2 represent the end points of the paths, and the rectangular squares where the circles are located represent the end point grids. In addition, the rectangular squares not filled with shading represent candidate grids. Further, in order to distinguish the active area from the inactive area, an obstacle grid for representing an obstacle is further included in the plurality of grids. As shown in fig. 2, the rectangular squares filled with grid shading in fig. 2 represent the barrier grids. It should be noted that the positions of the path starting point, the path ending point, and the obstacle grid shown in fig. 2 are only one possible setting manner in a real scene, and the actual positions of the three are not limited accordingly.
In the embodiment of the present disclosure, each grid is marked with a first distance from the grid to the obstacle. The first distance may specifically be the closest distance of the grid to the obstacle. Specifically, the closest distance from the preset position of the grid to the obstacle grid may be obtained as the first distance marked by the grid. Referring to fig. 2, taking the eight candidate grids in the neighborhood centered by the starting grid in fig. 2 as an example, in order to distinguish the eight candidate grids, different letters are respectively used for numbering, the candidate grid at the upper left corner is numbered a, the candidate grid at the upper right corner is numbered B, the candidate grid at the upper right corner is numbered C, the candidate grid at the left side is numbered D, the candidate grid at the right side is numbered E, the candidate grid at the lower left corner is numbered F, the candidate grid at the lower right corner is numbered G, and the candidate grid at the lower right corner is numbered H, for convenience of description, the following steps are respectively referred to as: candidate grid a, candidate grid B, candidate grid C, candidate grid D, candidate grid E, candidate grid F, candidate grid G, candidate grid H. Taking an example that the preset position is a center of the candidate grid and a side length of the grid corresponds to 10 centimeters in a real scene, please refer to table 1 in combination, where table 1 is an illustration table of an embodiment of a first distance marked by the grid, as shown in table 1, the first distance marked by the candidate grid a is 25 centimeters, the shortest distance from the center position of the candidate grid a to an obstacle in the real scene is 25 centimeters, and so on, the first distance marked by the candidate grid B is 15 centimeters, the shortest distance from the center position of the candidate grid B to the obstacle in the real scene is 15 centimeters, the first distance marked by the candidate grid C is 5 centimeters, the shortest distance from the center position of the candidate grid C to the obstacle in the real scene is 5 centimeters, and so on for the rest of the candidate grids, which are not exemplified one by one.
TABLE 1 schematic table of an embodiment of first distances marked by grids
Grid (C)
First distance (centimeter)
Grid (C)
First distance (centimeter)
Candidate grid A
25
Candidate grid B
15
Candidate grid C
5
Candidate grid D
25
Candidate grid E
5
Candidate grid F
25
Candidate grid G
15
Candidate grid H
5
In one implementation scenario, in order to improve the convenience of obtaining the first distance in the path planning process, a distance map with the same resolution as the grid map may be generated, and the distance map also includes a plurality of grids, and a pixel value of each grid is the first distance from the grid to the obstacle, that is, the grid with the lighter color in the distance map indicates the farther the first distance from the obstacle, whereas the grid with the darker color indicates the closer the first distance from the obstacle. Therefore, the first distance from each grid to the obstacle is accessed at any time in the path planning process by storing the distance map.
In an implementation scenario, as described above, in order to improve the convenience of obtaining the first distance in the path planning process, a distance map with the same resolution as the grid map may be generated, where a pixel value of each pixel point in the distance map represents the first distance from the pixel point to the obstacle, that is, a pixel point with a brighter color in the distance map represents a farther first distance from the obstacle, and conversely, a pixel point with a darker color represents a closer first distance from the obstacle. Referring to fig. 3 and 4 in combination, fig. 3 is a schematic diagram of another embodiment of a grid map, fig. 4 is a schematic diagram of an embodiment of a distance map, and fig. 4 is a schematic diagram of a distance map generated from the grid map shown in fig. 3, in order to clearly express a first distance from each pixel point to an obstacle, only an obstacle grid is schematically shown in the diagram, and other grids such as a candidate grid, a start grid, and an end grid are not shown. As shown, the brighter the color pixel is farther from the obstacle, and the darker the color pixel is closer to the obstacle. Therefore, the first distance can be accessed at any time in the path planning by storing the distance map, and the first distance from each pixel point to the obstacle can be reflected by the pixel value of each pixel point in the distance map, so that the refinement degree of the distance map can be improved.
It should be noted that, in order to improve the accuracy of path planning, before each path planning, the environment information may be requested to be acquired to generate a new grid map, so that the environmental change can be captured in time, and the probability of situations such as inconsistency between the planned path and the actual environment is reduced as much as possible. For example, in the environment, an obstacle may be added/removed, and if the path is planned according to the old raster map, a situation may occur in which the planned path passes through the new obstacle and cannot move according to the planned path, or a situation may occur in which the planned path bypasses the removed obstacle and makes the planned path detour, so that before each path planning, the accuracy and stability of the path planning can be improved by requesting to acquire the environment information and generating a new raster map based on the environment information again.
In one implementation scenario, the environmental information may be automatically captured by a camera, radar, or other collection device. Taking an AGV (automated Guided vehicle) car as an example, the AGV car may be loaded with collection devices such as the camera and the radar, and before the path planning, the AGV car may move in the activity field (or move randomly in the activity field) according to a certain motion trajectory, and in the moving process, the collection devices collect the environment information. For example, where the capture device includes a camera, the environmental information may include an image of an environment captured within the venue, or where the capture device includes a radar, the environmental information may include point cloud data captured at the venue, without limitation. In addition, the environment information may be processed based on algorithms such as SLAM (simultaneous localization and mapping) to generate a grid map. For a specific generation process, reference may be made to technical details of algorithms such as SLAM, and details are not described herein. It should be noted that, in order to avoid an additional burden caused by capturing environment information before path planning each time, before path planning, a request confirmation message may be sent to the user equipment, where the request confirmation message is used to request the user to confirm whether environment information needs to be captured again, and after receiving a capture approval message of the user equipment, environment information acquisition may be started, whereas after receiving a capture cancellation message of the user equipment, path planning may be directly started.
In one implementation scenario, the environmental information may also be manually entered by the user. Specifically, the user may input new environment information based on a change in the current environment. Still taking the AGV as an example, when the current environment changes, the user may redraw the plane map of the current environment, and send the plane map to the AGV, and the AGV generates the grid map based on the received plane map. Other cases may be analogized, and no one example is given here.
Step S12: for each candidate grid within a first region surrounding the reference grid, a candidate grid is selected as the selected grid based on a first path cost of the respective candidate grid.
In the embodiment of the disclosure, the reference grid is a candidate grid selected as the selected grid for the previous time, and the first path cost is obtained based on the first distance marked by the candidate grid. In the case of first selecting a candidate grid, since the grid selection operation has not occurred before, the starting grid may be directly used as the reference grid, that is, when the grid is first selected, the candidate grid may be selected as the selected grid for each candidate grid in the first region surrounding the starting grid based on the first path cost of the candidate grid; by analogy, in the case of second selecting a candidate grid, the candidate grid selected as the selected grid for the first time may be used as the reference grid, and for each candidate grid in the first region surrounding the reference grid, the candidate grid may be selected as the selected grid based on the first path cost of each candidate grid; in this way, in the case of selecting the candidate grid at the ith time, the candidate grid selected as the selected grid at the (i-1) th time may be used as the reference grid, and for each candidate grid in the first area surrounding the reference grid, the candidate grid is selected as the selected grid based on the first path cost of each candidate grid, and so on, which is not illustrated here.
In an implementation scenario, after each time a selected grid is selected, whether the selected grid is an end-point grid may be detected, if so, the selection process of the candidate grid may be ended, otherwise, the selected grid may be used as a reference grid in a next candidate grid selection process, and the step of selecting the candidate grid as the selected grid based on the first path cost of each candidate grid for each candidate grid in the first region surrounding the reference grid is performed again until the selected grid is the end-point grid.
In one implementation scenario, the first region surrounding the reference grid may be a square region centered on the reference grid and having a side length that is a preset multiple of the side length of the grid. For example, the predetermined multiple may be 3 times, and the first region is an eight-neighborhood region of the reference grid. Other cases may be analogized to the same, where there is no longer a distance.
In one implementation scenario, to facilitate selection of candidate grids, unselected candidate grids may be stored in a first list after each selection, and at each selection, the unselected candidate grids within a neighborhood centered on the reference grid may be stored together in the first list, and after each selection, the selected candidate grid may be removed from the first list. Note that, in this case, each candidate grid in the first region of the reference list includes: candidate grids remaining in the first list after the previous selection and each unselected candidate grid in the neighborhood range centered on the reference grid during the current selection.
In an implementation scenario, in order to facilitate planning a path based on a selected grid in the following, the selected grid may be stored in the second list, and after the process of selecting a candidate grid is finished, a motion path may be directly constructed according to the selected grid in the second list.
In one implementation scenario, the first path cost may include a first cost that is derived based on a first distance labeled by the candidate grid, and the first distance labeled by the candidate grid is negatively correlated with the first cost of the candidate grid. That is, the larger the first distance noted by the candidate grid, the smaller the first price of the candidate grid, whereas the smaller the first distance noted by the candidate grid, the larger the first price of the candidate grid. In the mode, the first path cost comprises the first cost, the first cost is obtained based on the first distance marked by the candidate grid, and the first distance marked by the candidate grid is in negative correlation with the first cost of the candidate grid, so that a certain distance can be kept between the first path cost and the edge of the obstacle as far as possible in the path planning process through the first cost constraint, and the safety of the path planning is improved.
In a specific implementation scenario, in order to simplify the calculation step of the first cost, a plurality of preset intervals may be set before path planning, and the plurality of preset intervals respectively correspond to cost coefficients, and the larger the endpoint value of the preset interval is, the smaller the cost coefficient corresponding to the preset interval is. It should be noted that the endpoint value represents an upper limit value or a lower limit value, that is, the larger the upper limit value of the preset interval is, the smaller the cost coefficient corresponding to the preset interval is, or the larger the lower limit value of the preset interval is, the smaller the cost coefficient corresponding to the preset interval is. On this basis, a preset interval corresponding to the first distance marked by the candidate grid can be selected from the plurality of preset intervals as a target interval, and the first distance marked by the candidate grid is weighted by using a cost coefficient of the target interval to obtain the first cost of the candidate grid. In the above manner, the preset interval corresponding to the first distance marked by the candidate grid is selected from the plurality of preset intervals as the target interval, and the larger the endpoint value of the preset interval is, the smaller the cost coefficient corresponding to the preset interval is, so that the first cost of the candidate grid can be obtained by weighting the first distance marked by the candidate grid by using the cost coefficient of the target interval, and therefore, the first cost can be obtained by using weighting calculation only by selecting the preset interval, which is beneficial to greatly simplifying the calculation process of the first cost and reducing the calculation load.
In a specific implementation scenario, it should be noted that the finally planned motion path is used to provide navigation information for a moving object (e.g., the AGV, or a pedestrian, or other moving carrier), the endpoint values of the preset intervals are set based on the width of the moving object, and the moving object moves along the length direction of the moving object during the motion process. Referring to fig. 5, fig. 5 is a schematic diagram of an embodiment of a mobile object. Specifically, FIG. 5 is a schematic diagram of an embodiment of an AGV, and as shown in FIG. 5, the direction of movement of the AGV is its length, which may be designated as L for convenience of description, and its width may be designated as W. In the above manner, the endpoint value of the preset interval is set based on the width of the moving object, and the moving object moves along the length direction of the moving object in the moving process, so that the possibility that the moving object touches an obstacle in the moving process according to the planned moving path can be further reduced, and the safety of the planned path can be improved.
In a specific implementation scenario, the number of the preset intervals may also be set according to actual needs, for example, the number may be set to 2, 3, 4, 5, and the like, which is not limited herein. In order to improve the accuracy of the first price as much as possible, 6 preset intervals may be set, and the six preset intervals may be named as: an absolute safety interval, a safer interval, a more dangerous interval, a dangerous interval and a very dangerous interval, wherein the absolute safety interval represents absolute safety of movement (namely, the obstacle can not be touched absolutely), the safety interval represents that the movement is safe (namely, the obstacle can not be touched under the normal condition), the safer interval represents that the movement is safer (namely, proper redundancy is reserved for the movement to overcome the influence of deviation between positioning and a map on navigation), the more dangerous interval represents that the movement has certain risk (namely, the obstacle can be touched with a certain probability in the movement process, but the obstacle can not be touched), the dangerous interval represents that the movement has larger risk (namely, the obstacle can be touched in the movement process), and the very dangerous interval represents that the movement has great risk (namely, the obstacle can be touched in the movement process), and cannot pass through the gap). Theoretically, when the distance between the planned path and the obstacle is less than half the width (i.e., W/2), there is a risk that the moving object moves along the path. So the endpoint values of the respective preset intervals can be set based on the width. Referring to table 2, table 2 is a schematic diagram of an embodiment of the predetermined interval. As shown in table 1, the range of the absolute safety zone is equal to or greater than 3 times the width W, and if the absolute safety zone moves in the range, the absolute safety is considered to be provided; the range of the safety zone is more than or equal to 1.56 times of width W and less than 3 times of width W, and if the safety zone moves in the zone, the safety zone is considered to be safe under the normal condition; the range of the safer interval is more than or equal to 0.78 times width W and less than 1.56 times width W, if the safer interval moves, a little more than half of the width can still be ensured, so that proper redundancy can still be left for the movement to overcome the influence of deviation between positioning and a map on navigation; the range of the dangerous interval is more than or equal to 0.39 times of width W and less than 0.78 times of width W, namely, the dangerous interval can be less than half of width W and can also be more than half of width W, so that certain risk exists in movement; the range of the dangerous interval is more than or equal to 0.195 times width W and less than 0.39 times width W, if the dangerous interval moves, the dangerous interval is less than half of the width inevitably, so that the dangerous interval exists; the range of the extremely dangerous region is greater than or equal to 0 and less than 0.195 times of width W, and if the extremely dangerous region moves, the extremely dangerous region has a great risk that an obstacle is touched in the moving process and cannot pass through a gap.
TABLE 2 schematic diagram of an embodiment of a preset interval
Preset interval
Range of interval
Preset interval
Range of interval
Absolute safety interval
[3W,+∞)
Safety zone
[1.56W,3W)
Relatively safe interval
[0.78W,1.56W)
More dangerous zone
[0.39W,0.78W)
Dangerous area
[0.195W,0.39W)
Very dangerous interval
[0,0.195W)
In a specific implementation scenario, please refer to fig. 2 in combination, and still take eight candidate grids in the neighborhood with the starting grid as the center as an example, in the case that the width W is 20 cm, please refer to table 3 in combination, where table 3 is an exemplary table of another embodiment of the preset intervals, and in the case that the 6 preset intervals are set, the interval range of each preset interval is as shown in table 3. Referring further to Table 1, for candidate grid A, its first distance falls within a safer interval, for candidate grid B, its first distance falls within a more dangerous interval, for candidate grid C, its first distance falls within a dangerous interval, for candidate grid D, its first distance falls within a safer interval, for candidate grid E, its first distance falls within a dangerous interval, for candidate grid F, its first distance falls within a safer interval, for candidate grid G, its first distance falls within a more dangerous interval, and for candidate grid H, its first distance falls within a dangerous interval. Other cases may be analogized, and no one example is given here.
TABLE 3 schematic table of another embodiment of the preset intervals
Preset interval
Interval range (centimeter)
Preset interval
Interval range (centimeter)
Absolute safety interval
[60,+∞)
Safety zone
[32.2,60)
Relatively safe interval
[15.6,31.2)
More dangerous zone
[7.8,15.6)
Dangerous area
[3.9,7.8)
Very dangerous interval
[0,3.9)
In a specific implementation scenario, taking the above six preset intervals as an example, the cost coefficient corresponding to the absolute safety interval may be recorded as δ1The corresponding cost coefficient of the safety interval can be recorded as delta2The cost coefficient corresponding to the safer interval can be recorded as delta3The cost coefficient corresponding to the more dangerous interval can be recorded as delta4And the corresponding cost coefficient of the dangerous interval is recorded as delta5And the cost coefficient corresponding to the very dangerous interval is recorded as delta6. On this basis, for the nth candidate grid, the first price d (n) thereof can be expressed as:
……(1)
in the above formula (1), d represents the first distance marked by the nth candidate grid.
In a specific implementation scenario, the cost coefficient corresponding to a preset interval having the largest endpoint value (maximum value or minimum value) among a plurality of preset intervals may be set to 0. Taking the six preset intervals as an example, the cost coefficient corresponding to the absolute safety interval may be set to 0. In the above manner, the cost coefficient corresponding to the preset interval with the largest endpoint value is set to be 0, so that the distance cost of the candidate grid in the absolute safety interval can be ignored, and the accuracy of the first path cost is improved.
In a specific implementation scenario, the six preset intervals are still taken as an example, and the cost coefficient δ is determined according to the six preset intervals1、δ2、δ3、δ4、δ5、δ5With the values set to 0, 1, 2, 3, 12, and 20, respectively, for eight candidate grids in the starting grid neighborhood in fig. 2, since the first distance of candidate grid a falls within the safer interval, the first cost of candidate grid a may be calculated to be 2 × 25=50 (as shown by the upper right-hand digit of candidate grid a in fig. 2), similarly, the first cost of candidate grid B may be calculated to be 45 (as shown by the upper right-hand digit of candidate grid B in fig. 2), the first cost of candidate grid C may be 60 (as shown by the upper right-hand digit of candidate grid B in fig. 2), the first cost of candidate grid D may be 50 (as shown by the upper right-hand digit of candidate grid B in fig. 2), the first cost of candidate grid E may be 60 (as shown by the upper right-hand digit of candidate grid B in fig. 2), the first cost of candidate grid F may be 50 (as shown by the upper right-hand digit of candidate grid B in fig. 2), candidate grid G has a first low price of 45 (as indicated by the top right hand digit of candidate grid B in fig. 2) and candidate grid H has a first price of 60 (as indicated by the top right hand digit of candidate grid B in fig. 2). Other cases may be analogized, and no one example is given here.
In one implementation scenario, to further improve the accuracy of the first path cost, the first path cost may further include a second cost, and the second cost is obtained based on a second distance from the candidate grid to the reference grid. For convenience of description, the second price of the nth candidate grid in the first region surrounding the reference grid may be denoted as m (n, neighbor), and taking the candidate grid located in the eight neighborhoods of the reference grid as an example, please refer to fig. 2, in case that the side length of the grid corresponds to 10 cm in the real scene, the second distance from the candidate grid located above the reference grid (e.g., candidate grid B in fig. 2) to the reference grid (e.g., start grid in fig. 2) is 10, the second price thereof may be denoted as 10 (e.g., shown by the lower left corner number of candidate grid B in fig. 2), the second distance from the candidate grid located below the reference grid (e.g., candidate grid G in fig. 2) to the reference grid (e.g., start grid in fig. 2) is 10, the second price thereof may be denoted as 10 (e.g., shown by the lower left corner number of candidate grid G in fig. 2), and the second distance from the candidate grid located at the left side of the reference grid (e.g., candidate grid D) to the reference grid (e.g., start grid in fig. 2) is 10 10, then its second cost may be denoted as 10 (as indicated by the lower left-hand digit of candidate grid D in fig. 2), and the second distance from the candidate grid (as candidate grid E in fig. 2) to the reference grid (as the starting grid in fig. 2) to the right of the reference grid is 10, then its second cost may be denoted as 10 (as indicated by the lower left-hand digit of candidate grid E in fig. 2); similarly, the second distance from the candidate grid located at the upper left corner of the reference grid (e.g., candidate grid a in fig. 2) to the reference grid (e.g., start grid in fig. 2) is 14 (specifically, it may be calculated according to the pythagorean theorem, and will not be described herein), then the second cost thereof may be denoted as 14 (as shown by the lower left corner number of candidate grid G in fig. 2), the second distance from the candidate grid located at the upper right corner of the reference grid (e.g., candidate grid C in fig. 2) to the reference grid (e.g., start grid in fig. 2) is 14 (specifically, it may be calculated according to the pythagorean theorem, and will not be described herein), then the second cost thereof may be denoted as 14 (as shown by the lower left corner number of candidate grid C in fig. 2), the second distance from the candidate grid located at the lower left corner of the reference grid (e.g., candidate grid F in fig. 2) to the reference grid (e.g, not repeated here), the second price may be denoted as 14 (as shown by the number of the lower left corner of the candidate grid F in fig. 2), the second distance from the candidate grid located at the lower right corner of the reference grid (as the candidate grid H in fig. 2) to the reference grid (as the starting grid in fig. 2) is 14 (specifically, the second distance may be calculated according to the pythagorean theorem, which is not repeated here), and the second price may be denoted as 14 (as shown by the number of the lower left corner of the candidate grid H in fig. 2). Other cases may be analogized, and no one example is given here.
In an implementation scenario, in order to further improve the accuracy of the first path cost, the first path cost further includes a third cost, and the third cost is obtained based on a third distance from the reference grid to the starting grid. For ease of description, the third valence may be denoted as g (c). Referring to fig. 2, in the case of first selecting a candidate grid, the reference grid is the starting grid, so the third prices of the candidate grids are all 0 (as shown by the numbers at the bottom right corner of the candidate grids in fig. 2).
In an implementation scenario, in order to further improve the accuracy of the first path cost, the first path cost further includes a fourth cost, and the fourth cost is obtained based on a fourth distance from the candidate grid to the end-point grid. For convenience of description, a fourth cost of the nth candidate grid in the first region surrounding the reference grid may be denoted as h (n, neighbor), taking the candidate grid located in the eight neighborhoods of the reference grid as an example, please refer to fig. 2, where when the side length of the grid corresponds to 10 cm in the real scene, a fourth distance from the candidate grid located above the reference grid (e.g., candidate grid B in fig. 2) to the end point grid is 50 (specifically, the fourth cost may be calculated according to the manhattan distance formula, which is not described herein again), the fourth cost may be denoted as 50 (as shown in an upper left corner of candidate grid B in fig. 2), a fourth distance from the candidate grid located below the reference grid (e.g., candidate grid G in fig. 2) to the end point grid is 70 (specifically, the fourth cost may be calculated according to the manhattan distance formula, which is not described herein again), and the fourth cost may be denoted as 70 (as shown in an upper left corner of candidate grid G in fig. 2), a fourth distance from the candidate grid (e.g., candidate grid D in fig. 2) located at the left side of the reference grid to the end-point grid is 70 (specifically, the fourth distance may be calculated according to a manhattan distance formula, and is not described herein again), a fourth cost of the fourth distance may be 70 (as shown by a left upper-corner numeral of candidate grid D in fig. 2), a fourth distance from the candidate grid (e.g., candidate grid E in fig. 2) located at the right side of the reference grid to the end-point grid is 50 (specifically, the fourth distance may be calculated according to a manhattan distance formula, and is not described herein again), and a fourth cost of the fourth distance may be 50 (as shown by a left upper-corner numeral of candidate grid E in fig. 2); similarly, the fourth distance from the candidate grid located at the upper left corner of the reference grid (for example, the candidate grid a in fig. 2) to the end-point grid is 60 (specifically, the fourth distance may be calculated according to the manhattan distance formula, and is not described herein again), the fourth cost may be 60 (as shown by the upper left corner of the candidate grid G in fig. 2), the fourth distance from the candidate grid located at the upper right corner of the reference grid (for example, the candidate grid C in fig. 2) to the end-point grid is 40 (specifically, the fourth distance may be calculated according to the manhattan distance formula, and is not described herein again), the fourth cost may be 40 (as shown by the upper left corner of the candidate grid C in fig. 2), the fourth distance from the candidate grid located at the lower left corner of the reference grid (for example, the candidate grid F in fig. 2) to the end-point grid is 80 (specifically, which is calculated according to the manhattan distance formula, and is not described herein again), the fourth cost may be 80 (as shown by the upper left corner of the candidate grid F in fig. 2), a fourth distance from the candidate grid (e.g., candidate grid H in fig. 2) located at the lower right corner of the reference grid to the end-point grid is 60 (which may be calculated according to the manhattan distance formula, and is not described herein again), and a fourth cost thereof may be 60 (as shown by the upper left corner of the candidate grid H in fig. 2). Other cases may be analogized, and no one example is given here.
In an implementation scenario, taking the first path cost including the first cost, the second cost, the third cost, and the fourth cost as an example, for each candidate grid in the first region surrounding the reference grid, the candidate grid corresponding to the smallest first path cost may be selected as the selected grid. Referring to fig. 2, the first path cost of candidate grid a may be obtained by a sum of the first cost, the second cost, the third cost and the fourth cost, that is, the first path cost of candidate grid a is 124, and so on, the first path cost of candidate grid B is 105, the first path cost of candidate grid C is 114, the first path cost of candidate grid D is 130, the first path cost of candidate grid E is 120, the first path cost of candidate grid F is 144, the first path cost of candidate grid G is 125, and the first path cost of candidate grid H is 134, so that candidate grid B may be selected as the selected grid. Therefore, although the overall path cost of the candidate grid C is smaller, since the width of the AGV is 20 cm and the side length of the grid corresponds to 10 cm in a real scene, that is, if the candidate grid C is selected as the selected grid, the AGV inevitably touches the obstacle in the real scene, the path cost represented by the second cost, the second cost and the fourth cost and the distance cost represented by the first cost are combined to jointly constrain path planning, and the length of the planned path can be shortened as much as possible on the premise of improving the safety of the path planning.
Step S13: and obtaining a motion path from the path starting point to the path end point based on the starting point grid, the end point grid and the selected grids selected in the past.
Specifically, the end point grid may be used as a path grid, and one selected grid may be selected as a new path grid for each selected grid in the second area surrounding the path grid based on the second path cost of each selected grid, where the second path cost is obtained based on the first distance marked by the selected grid, and on this basis, the above step of selecting one selected grid as a new path grid for each selected grid in the second area surrounding the path grid may be executed again in response to the selected path grid not being the start point grid until the selected path grid is the start point grid, and finally the motion path may be obtained based on the path grids selected in the past times. In the above manner, the path grids are selected one by one from the end point grid based on the second path cost, and the second path cost is obtained based on the first distance marked by the selected grid, and on this basis, the motion path is obtained based on the path grids selected from the past time, that is, the grids are selected with reference to the first distance both in the forward planning process from the start point grid to the end point grid and in the backward planning process from the end point grid to the start point grid, so that the possibility that the motion path passes through the actual gap which cannot pass through can be further reduced as much as possible, and the safety of path planning can be improved.
In one implementation scenario, as described above, to facilitate subsequent planning of the path based on the selected grid, the selected grid may be stored in the second list, and after the process of selecting the candidate grid is completed, whether each of the grids in the second area surrounding the path grid is the selected grid may be detected based on the second list.
In one implementation scenario, the second region may be a square region centered on the path grid and having a preset multiple of the grid side length as a side length, similar to the first region. For example, the preset multiple may be 3, and the second region may be eight neighborhoods of the path grid. Unlike the first region, each selected grid in the second region may include a selected grid in a neighborhood centered on the path grid.
In one implementation scenario, unlike the first path cost described above, the second path cost is independent of the distance of the selected grid to the destination grid. Specifically, the second path cost may include a fifth cost, a sixth cost, and a seventh cost. The fifth cost is obtained based on the first distance marked by the selected grid, and the first distance marked by the selected grid is negatively related to the fifth cost of the selected grid, that is, the fifth cost of the selected grid is equal to the first cost d of the selected grid as the candidate grid; furthermore, the sixth cost is derived based on the second distance of the selected grid from the path grid, that is, the sixth cost of the selected grid is equal to the second cost m of the selected grid as the candidate grid; in addition, the seventh cost is obtained based on the third distance from the path raster to the starting raster, that is, the seventh cost of the selected raster is equal to the third cost g when the path raster corresponding to the selected raster is used as the reference raster. In a real scene, in the forward planning process from the starting point grid to the end point grid, for each selected grid, the second path cost of the selected grid can be obtained based on the first cost, the second cost and the third cost when the selected grid is used as a candidate grid, so that the second path cost of the selected grid can be directly obtained in the backward planning process from the end point grid to the starting point grid, recalculation in the backward planning process can be avoided, and the path planning speed can be improved.
In an implementation scenario, the selected raster corresponding to the minimum second path cost may be specifically selected as a new path raster. In the above manner, by selecting the selected raster corresponding to the minimum second path cost as a new path raster, the possibility that the motion path passes through a gap which cannot pass through actually can be reduced as much as possible, and the safety of path planning can be improved.
In one implementation scenario, the path grids selected each time may be connected in sequence to obtain the motion path. Specifically, pixel points (e.g., a center, an upper right vertex, etc.) at preset positions of the path grid may be connected to obtain a motion path. In addition, the pixel points at the preset positions of the path grids can be used as path points.
In the above scheme, a grid map is generated based on the environment information, the grid map includes a plurality of grids including a start grid representing a grid where a route start point is located, an end grid representing a grid where a route end point is located, and candidate grids located in an active region outside the obstacle, each of the grids being labeled with a first distance from the grid to the obstacle, and for each of the candidate grids in a first region surrounding a reference grid, the candidate grid is selected as a selected grid based on a first route cost of each of the candidate grids, the reference grid being a candidate grid selected as the selected grid at a previous time, the first route cost being obtained based on the first distance labeled by the candidate grid, so that a motion route from the route start point to the route end point is obtained based on the start grid, the end grid, and the selected grid selected at a previous time, because each grid is marked with the first distance from the grid to the obstacle, the first path cost of the candidate grid is considered in the process of selecting the candidate grid as the selected grid, and the first path cost is obtained based on the first distance marked by the candidate grid, the first distance from the candidate grid to the obstacle can restrict the selection of the candidate grid in the path planning process, the possibility that the motion path passes through the actual gap which cannot pass through is favorably reduced as much as possible, and the safety of the path planning can be improved.
Referring to fig. 6, fig. 6 is a schematic flow chart of another embodiment of the path planning method of the present application. In the embodiment of the present disclosure, the motion path includes a plurality of path points from the start point to the end point of the path, and for specific meanings of the path points, reference may be made to the related description in the foregoing embodiment, which is not described herein again. The embodiment of the present disclosure may specifically include the following steps:
step S61: based on the environment information, a grid map is generated.
In the embodiment of the disclosure, the grid map includes a plurality of grids, where the plurality of grids include a start grid, an end grid, and a candidate grid, the start grid represents a grid where a route start point is located, the end grid represents a grid where a route end point is located, the candidate grid is located in an active area outside an obstacle, and each grid is marked with a first distance from the grid to the obstacle. Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S62: for each candidate grid within a first region surrounding the reference grid, a candidate grid is selected as the selected grid based on a first path cost of the respective candidate grid.
In the embodiment of the disclosure, the reference grid is a candidate grid selected as the selected grid for the previous time, and the first path cost is obtained based on the first distance marked by the candidate grid. Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S63: and obtaining a motion path from the path starting point to the path end point based on the starting point grid, the end point grid and the selected grids selected in the past.
Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S64: and respectively detecting the shortest distance from each path point to the obstacle.
Specifically, the vertical distance from a waypoint to each nearby obstacle may be acquired, and the smallest vertical distance may be taken as the shortest distance from the waypoint to the obstacle.
Step S65: and detecting whether the shortest distance corresponding to the path point meets a preset condition, if so, executing the step S66, and otherwise, executing the step S67.
Specifically, the preset conditions may include: the shortest distance is greater than a preset threshold, the smooth path is used for providing navigation information for the moving object, the preset threshold is set based on the width of the moving object, and the moving object moves along the length direction of the moving object in the moving process. For the meaning of the moving object, the length, the width, and the like thereof, reference may be made to the related description in the foregoing disclosed embodiments, and details are not repeated here.
In an implementation scenario, the preset threshold may also be set in combination with a reference position of the moving object during the moving process and a width of the moving object, where it should be noted that the reference position is an intersection position of a plane where the moving path is perpendicular to the ground and the moving object, that is, the moving object moves along the moving path with reference to the reference position. Taking the reference position as the center position of the moving object as an example, the preset threshold may be set to be N times of half the width, and N is a numerical value (e.g., 2, 3, 4, etc.) greater than 1, if the shortest distance is greater than the preset threshold, it may be considered that the moving object may not touch the obstacle even if the moving object moves along the smooth path at the path point, otherwise, if the shortest distance is less than the preset threshold, it may be considered that the moving object is close to the obstacle at the path point when the moving object moves along the moving path, and if the moving object moves along the smooth path at the path point again, it may touch the obstacle.
Step S66: and smoothing the motion path at the path point.
In particular, the path point and the corresponding optimization point can be based on, and are located at a position next to the optimization point in the smooth pathAnd (4) constructing an optimization function of the optimization points corresponding to the path points. The optimization function comprises two optimization sub-functions, wherein one of the optimization sub-functions is used for constraining the distance deviation between the path point and the corresponding optimization point, and the other optimization sub-function is used for constraining the distance deviation between the optimization point and the next optimization point. For convenience of description, the path point may be denoted as PiAnd connecting the path point PiThe corresponding optimization point is marked as SiOptimization point SiThe next optimization point is denoted as Si+1Then the optimization function can be expressed as:
norm(Pi-Si)+norm(Si-Si+1)→min……(2)
in the above formula (2), norm represents a calculation function of the distance deviation, and for example, the calculation function may represent the sum of the square of the difference between the coordinates of two points in the x-axis direction and the square of the difference between the coordinates in the y-axis direction, and further may be set to the root.
In an implementation scenario, the optimization function may be optimized by a gradient descent method, and an optimization point S is obtained by solvingiIn the specific process of the gradient descent method, reference may be made to the relevant technical details thereof, which are not described herein again.
In one implementation scenario, different weights may be employed on different optimization sub-functions, enabling the optimization functions to generate optimization points. Specifically, for the first term optimization subfunction, the weight thereof can be marked as α, and the following formula can be iterated to optimize to the optimization point Si:
Si=Si+α(Pi-Si)……(3)
Obtaining an optimized point S after optimizationiThereafter, the optimization point S can be basediAnd the second optimization sub-function is continuously optimized to obtain a final optimization point Si. Specifically, for the second term optimization subfunction, the weight thereof may be denoted as β, and the following formula may be iterated to obtain the final optimization point Si:
Si=Si+β(Pi-1+Si+1-2Si)……(4)
In the above formula (4), Pi-1Indicating a path point P in the path of motioniThe waypoint at the last location.
Step S67: the motion path is not smoothed at the path points.
As described above, if the shortest distance does not satisfy the preset condition, it is considered that the moving object is already close to the obstacle at the path point when moving along the moving path, and if smoothing is performed again at the path point, there is a possibility that the moving object may touch the obstacle when moving along the smooth path, so that the moving path may not be smoothed at the path point.
Step S68: and obtaining a smooth path based on the processing result of the motion path at each path point.
Specifically, if the smoothing processing is performed at the path point, the processing result of the path point includes the optimized point corresponding to the path point, and if the smoothing processing is not performed at the path point, the processing result of the path point includes the path point, and finally, the points may be sequentially connected to obtain the smooth path. Referring to fig. 7, fig. 7 is a schematic diagram of an embodiment of a motion path and a smoothing path. As shown in fig. 7, the smooth path is smoother than the motion path, especially at the turning point of the path, so as to conform to the normal moving track.
According to the scheme, after the motion path is obtained, whether the preset condition is met or not is detected by each path point on the motion path, and the motion path is subjected to smoothing processing at the path point under the condition that the preset condition is met, so that the path naturalness can be improved on the premise of ensuring the path safety.
Referring to fig. 8, fig. 8 is a schematic diagram of a path planning apparatus 80 according to an embodiment of the present application. The path planning device 80 includes: the map generation module 81, the grid selection module 82 and the path generation module 83, wherein the map generation module 81 is used for generating a grid map based on the environment information; the grid map comprises a plurality of grids, the grids comprise a starting point grid, an end point grid and candidate grids, the starting point grid represents a grid where a path starting point is located, the end point grid represents a grid where a path end point is located, the candidate grids are located in an activity area outside an obstacle, and a first distance from each grid to the obstacle is marked; a grid selection module 82, configured to select, for each candidate grid in a first region surrounding a reference grid, the candidate grid as a selected grid based on a first path cost of each candidate grid; the reference grid is a candidate grid which is selected as a selected grid in the previous time, and the first path cost is obtained based on a first distance marked by the candidate grid; and the path generating module 83 is configured to obtain a motion path from the start point of the path to the end point of the path based on the start point grid, the end point grid, and the selected grid selected in the past.
According to the scheme, the first distance from the grid to the obstacle is marked on each grid, the first path cost of the candidate grid is considered in the process of selecting the candidate grid as the selected grid, and the first path cost is obtained based on the first distance marked by the candidate grid, so that the first distance from the candidate grid to the obstacle can restrict the selection of the candidate grid in the path planning process, the possibility that a motion path passes through a gap which cannot be passed actually is reduced as much as possible, and the safety of path planning can be improved.
In some disclosed embodiments, the first path cost comprises a first cost that is derived based on a first distance labeled by the candidate grid, and the first distance labeled by the candidate grid is negatively correlated with the first cost of the candidate grid.
Therefore, the first path cost comprises the first cost, the first cost is obtained based on the first distance marked by the candidate grid, and the first distance marked by the candidate grid is in negative correlation with the first cost of the candidate grid, so that a certain distance can be kept between the first path cost and the edge of the obstacle as far as possible in the path planning process through the first cost constraint, and the safety of the planned path is improved.
In some disclosed embodiments, the grid selecting module 82 includes a first price calculating submodule, which includes a target interval selecting unit, configured to select, from a plurality of preset intervals, a preset interval corresponding to a first distance marked by the candidate grid as the target interval; the cost coefficients correspond to the plurality of preset intervals respectively, and the larger the endpoint value of the preset interval is, the smaller the cost coefficient corresponding to the preset interval is; the first price calculating submodule comprises a first price calculating unit, and the first price calculating unit is used for weighting the first distance marked by the candidate grid by using the cost coefficient of the target interval to obtain the first cost of the candidate grid.
Therefore, the preset interval corresponding to the first distance marked by the candidate grid is selected from the preset intervals to serve as the target interval, the end point value of the preset interval is larger, the cost coefficient corresponding to the preset interval is smaller, and therefore the first cost of the candidate grid can be obtained by weighting the first distance marked by the candidate grid through the cost coefficient of the target interval, the first cost can be obtained through weighting calculation only by selecting the preset interval, the calculation process of the first cost is simplified greatly, and the calculation load is reduced.
In some disclosed embodiments, the motion path is used to provide navigation information for the moving object, the endpoint values of the preset interval are set based on the width of the moving object, and the moving object moves along the length direction of the moving object during the motion.
Therefore, the endpoint value of the preset interval is set based on the width of the moving object, and the moving object moves along the length direction of the moving object in the moving process, so that the possibility that the moving object touches an obstacle in the moving process according to the planned moving path can be further reduced, and the safety of the planned path can be improved.
In some disclosed embodiments, the predetermined interval with the largest endpoint value corresponds to a cost factor of 0.
Therefore, the cost coefficient corresponding to the preset interval with the maximum endpoint value is set to be 0, so that the distance cost of the candidate grids in the absolute safety interval can be ignored, and the accuracy of the first path cost is improved.
In some disclosed embodiments, the first path cost further comprises a second cost, and the second cost is derived based on a second distance of the candidate grid from the reference grid; and/or the first path cost further comprises a third cost, and the third cost is obtained based on a third distance from the reference grid to the starting grid; and/or the first path cost further comprises a fourth cost, and the fourth cost is obtained based on a fourth distance from the candidate grid to the end grid.
Therefore, the first path cost is set to further include the second cost, the third cost and the fourth cost, so that the path cost can be favorably measured from different angles, and the accuracy of the first path cost is favorably improved.
In some disclosed embodiments, path generation module 83 includes a path raster acquisition sub-module for taking the end raster as a path raster; the path generating module 83 includes a path-grid selecting sub-module, configured to select, for each selected grid in the second area surrounding the path grid, one selected grid as a new path grid based on respective second path costs of the selected grid; wherein the second path cost is derived based on the first distance labeled by the selected grid; the path generating module 83 includes a selection loop executing sub-module, configured to, in response to that the selected path grid is not the start grid, combine with the path grid selecting sub-module to re-execute the step of selecting, for each selected grid in the second area surrounding the path grid, one selected grid as a new path grid based on the respective second path cost of the selected grids until the selected path grid is the start grid; the path generating module 83 includes a motion path obtaining sub-module, configured to obtain a motion path based on the path grids selected in the past.
Therefore, the path grids are selected one by one from the end point grid based on the second path cost, the second path cost is obtained based on the first distance marked by the selected grid, and on the basis, the motion path is obtained based on the path grids selected from the past time, namely, the grids are selected by referring to the first distance in the forward planning process from the starting point grid to the end point grid and in the backward planning process from the end point grid to the starting point grid, so that the possibility that the motion path passes through the gap which cannot pass through actually can be further reduced as much as possible, and the safety of path planning can be improved.
In some disclosed embodiments, the second path cost is independent of the distance of the selected grid to the destination grid.
Therefore, by setting the second path cost to be independent of the distance from the selected grid to the end point grid, the distance from the selected grid to the end point grid can be ignored after the selected grid is selected, which is beneficial to improving the accuracy of determining the motion path by backtracking from the end point grid to the start point grid.
In some disclosed embodiments, the path-raster selection sub-module is specifically configured to select the selected raster corresponding to the smallest second path cost as the new path raster.
Therefore, by selecting the selected grid corresponding to the minimum second path cost as a new path grid, the possibility that the motion path passes through the gap which cannot pass through actually can be reduced as much as possible, and the safety of path planning can be improved.
In some disclosed embodiments, the motion path includes a number of path points from a path start point to a path end point; the path planning device 80 further includes a distance detection module, configured to detect the shortest distance from each path point to the obstacle; the path planning device 80 further includes a smoothing module, configured to perform smoothing on the motion path at the path point in response to that the shortest distance corresponding to the path point meets a preset condition; the path planning apparatus 80 further includes a path obtaining module, configured to obtain a smooth path based on the processing result of the motion path at each path point.
Therefore, after the motion path is acquired, whether the preset condition is met or not is detected by each path point on the motion path, and the motion path is subjected to smoothing processing at the path point under the condition that the preset condition is met, so that the path naturalness can be improved on the premise of ensuring the path safety.
In some disclosed embodiments, the smoothing module is further configured to not smooth the motion path at the path point in response to the shortest distance corresponding to the path point not satisfying a preset condition.
Therefore, under the condition that the shortest distance corresponding to the path point does not meet the preset condition, the motion path is not subjected to smoothing processing at the path point, the possibility that the path point touches an obstacle after smoothing can be favorably prevented, and the path safety is favorably improved.
In some disclosed embodiments, the preset conditions include: the shortest distance is greater than a preset threshold value; the smooth path is used for providing navigation information for the moving object, the preset threshold value is set based on the width of the moving object, and the moving object moves along the length direction of the moving object in the moving process.
Therefore, the preset condition is set to be that the shortest distance is greater than the preset threshold, the smooth path is used for providing navigation information for the moving object, the preset threshold is set based on the width of the moving object, and the moving object moves along the length direction of the moving object in the moving process, so that the preset threshold can be set based on the width in the moving process, the possibility that the moving object touches an obstacle can be reduced, and the safety of the path is improved.
Referring to fig. 9, fig. 9 is a schematic block diagram of an embodiment of an electronic device 90 according to the present application. The electronic device 90 comprises a memory 91 and a processor 92 coupled to each other, the memory 91 stores program instructions, and the processor 92 is configured to execute the program instructions to implement the steps in any of the above-described embodiments of the path planning method. Specifically, the electronic device 90 may further include a drive motor coupled to the processor 92 and the drive wheel, and the drive motor is configured to rotate the drive wheel; the electronic device 90 may also include information collection means coupled to the processor 92, which may include, but is not limited to: the system comprises a camera, a radar and the like, wherein an information acquisition device is used for acquiring environmental information; the electronic device 90 may also include communication circuitry coupled to the processor 92, which may include, but is not limited to: a WiFi (Wireless Fidelity) circuit, etc., and a communication circuit is used to transmit information.
In particular, the processor 92 is configured to control itself and the memory 91 to implement the steps in any of the above-described embodiments of the path planning method. The processor 92 may also be referred to as a CPU (Central Processing Unit). The processor 92 may be an integrated circuit chip having signal processing capabilities. The Processor 92 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 92 may be collectively implemented by an integrated circuit chip.
According to the scheme, the first distance from the grid to the obstacle is marked on each grid, the first path cost of the candidate grid is considered in the process of selecting the candidate grid as the selected grid, and the first path cost is obtained based on the first distance marked by the candidate grid, so that the first distance from the candidate grid to the obstacle can restrict the selection of the candidate grid in the path planning process, the possibility that a motion path passes through a gap which cannot be passed actually is reduced as much as possible, and the safety of path planning can be improved.
Referring to fig. 10, fig. 10 is a block diagram illustrating an embodiment of a computer-readable storage medium 100 according to the present application. The computer readable storage medium 100 stores program instructions 101 capable of being executed by a processor, the program instructions 101 being for implementing the steps in any of the path planning method embodiments described above.
According to the scheme, the first distance from the grid to the obstacle is marked on each grid, the first path cost of the candidate grid is considered in the process of selecting the candidate grid as the selected grid, and the first path cost is obtained based on the first distance marked by the candidate grid, so that the first distance from the candidate grid to the obstacle can restrict the selection of the candidate grid in the path planning process, the possibility that a motion path passes through a gap which cannot be passed actually is reduced as much as possible, and the safety of path planning can be improved.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, and for brevity, will not be described again herein.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:自动驾驶地图的构建方法及相关装置