Disclosure of Invention
One or more embodiments of the present disclosure provide a method, an apparatus, and a medium for path planning of a community inspection vehicle, which are used to solve the technical problem set forth in the background art.
One or more embodiments of the present disclosure adopt the following technical solutions:
one or more embodiments of the present disclosure provide a method for planning a path of a community inspection vehicle, where the method includes:
inputting a community map picture into a pre-trained generated countermeasure network model when the patrol vehicle carries out community patrol, and obtaining a path picture with preliminary planning;
Based on the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree;
and obtaining the shortest path from the starting point to the target point based on the first spanning tree and the second spanning tree.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
And the path planning efficiency is improved, namely, the pre-trained generation countermeasure network model is used for preliminary planning, and the picture with the potential path can be quickly generated. This reduces the time and computational resource consumption of searching a large number of invalid paths in the conventional path planning method, and improves the path planning efficiency.
And (3) enhancing the path accuracy, namely combining a designated path planning algorithm to perform path searching in two directions from the starting point and the target point to obtain a first spanning tree and a second spanning tree. Such bi-directional searching may more fully take into account path likelihood, thereby improving the accuracy of finding the shortest path.
The method is suitable for complex community environments, and can cope with various changes and uncertainties in the community environments. The generation of the countermeasure network model can learn the characteristics and modes of communities, thereby providing reasonable preliminary path planning under different conditions. The specified path planning algorithm can be further optimized according to actual conditions, so that the patrol car is ensured to adapt to complex community layout and dynamic environment.
The efficient and accurate path planning is helpful for the patrol vehicle to quickly and safely reach the destination and complete the patrol task. This can improve the security and management efficiency of communities, and discover and deal with potential problems in time.
Time and resources are saved, search and processing of invalid paths are reduced, and time and computing resources are saved. This is particularly important for resource-limited community inspection systems, which can improve the overall performance and sustainability of the system.
Further, before inputting the community map picture into the pre-trained generated countermeasure network model to obtain the path picture with the preliminary planning, the method further comprises:
Randomly generating a plurality of map pictures as data samples;
Executing an algorithm A from a starting point to a target point on each map picture to obtain a map picture marked with the shortest path;
And inputting the map picture marked with the shortest path into a generated countermeasure network model for training, and obtaining the generated countermeasure network model after training.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
The accuracy of path planning is improved, namely, the shortest paths are marked by executing an A-algorithm on a large number of map pictures which are randomly generated, and the map pictures marked with the shortest paths are input into a generated countermeasure network model for training, so that the model can learn the shortest path modes and features under different map layouts. This helps to improve the accuracy of generating the countermeasure network model in initially planning the path, and reduce the generation of invalid paths.
The generalization capability of the model is enhanced, namely training is carried out by using randomly generated map pictures, so that the diversity and complexity of data can be increased, and the model can adapt to various community map layouts. This helps to increase the generalization ability of the model, enabling it to more accurately generate a preliminary planned path in the face of an actual community map.
The efficiency of path planning is improved, namely the trained generation countermeasure network model can quickly generate the path picture with preliminary planning, and the time and the computing resource consumption for searching a large number of invalid paths in the traditional path planning method are reduced. The method is beneficial to improving the efficiency of path planning, so that the inspection vehicle can reach a destination faster and complete the inspection task.
Promote the development of the intelligent community, and the efficient and accurate path planning is an important component of the intelligent community construction. By improving the accuracy and efficiency of path planning, the safety and management efficiency of communities can be improved, and the development of intelligent communities is promoted.
Further, after the map picture of the shortest path is obtained, the method further includes:
and carrying out expansion and thickening processing on the pixel point where the shortest path is located in the map picture marked with the shortest path.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
the visual effect of the path is improved, namely the shortest path can be more obvious and prominent on the map picture by carrying out expansion thickening treatment on the pixel point where the shortest path is located. The method is helpful for patrol personnel or related personnel to more intuitively see the planned path, improves the visual effect of the path and reduces the possibility of misunderstanding or misjudgment.
Enhancing the recognizability of the path, i.e. the shortest path after the thickening is more easily identified and distinguished, especially in complex map environments. This helps to improve the recognizability of the path, enabling the inspection vehicle or other equipment to more accurately follow the planned path, reducing the risk of deviation from the path.
The importance of the shortest path is emphasized, namely the importance of the shortest path can be emphasized by the expansion thickening process, so that the shortest path is more prominent in the map picture. This helps guide the inspection personnel or related personnel to choose the shortest path preferentially, improves inspection efficiency and work effect.
The method is convenient for tracking and monitoring the path, namely the shortest path after the thickening treatment is more clearly visible on the map picture, and is convenient for tracking and monitoring the path. The method has important significance for monitoring the running track of the inspection vehicle in real time, evaluating the path planning effect and carrying out subsequent optimization and adjustment.
Further, the specified path planning algorithm is an RRT algorithm.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
High efficiency RRT algorithm is a path planning algorithm based on random sampling, which can quickly search feasible paths in complex environments. Compared with other traditional algorithms, the RRT algorithm has the advantage of calculation efficiency, and can find a better path in a shorter time.
The RRT algorithm is suitable for various different types of environments, including static and dynamic environments. It is able to cope with the presence and variation of obstructions and with uncertainty factors in the environment. This makes its application in complex environments such as smart communities more reliable.
Optimality RRT algorithm can find a path close to optimal by constantly optimizing the path. According to the method, random sampling and local optimization are introduced in the searching process, so that the situation that a local optimal solution is trapped can be avoided, and the quality of a path is improved.
The RRT algorithm has good expandability and can be applied to large-scale environment and multi-robot systems. It can be used in combination with other algorithms or techniques to further improve the performance of path planning.
Further, the obtaining, based on the first spanning tree and the second spanning tree, the shortest path from the starting point to the target point includes:
Completing a first iteration when the first spanning tree meets the second spanning tree or the distance between the first spanning tree and the second spanning tree is smaller than a set threshold value, and obtaining a first shortest path;
Repeatedly executing the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates based on the preset iteration times, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree;
and obtaining the shortest path from the starting point to the target point based on the first shortest path and the plurality of second shortest paths.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
the accuracy of path planning is improved, namely a plurality of shortest paths can be obtained by executing a specified path planning algorithm through a plurality of iterations. Based on these paths, the optimal paths can be further analyzed and selected, thereby improving the accuracy of path planning.
The reliability of path planning is enhanced, namely, through multiple iterations, the possible local optimal solution in single planning can be avoided. The presence of multiple shortest paths increases the likelihood of finding a globally optimal solution, thereby enhancing the reliability of path planning.
Considering different starting points and target points, the method respectively performs path planning from the starting points and the target points at the same time to obtain two spanning trees. This allows for more options in view of the path possibilities in different directions, helping to find the best shortest path.
Adaptation to complex environments where the path may be affected by a variety of factors, such as obstacles, terrain, etc. By iterating multiple times and generating multiple shortest paths, these complications can be better accommodated, finding a more suitable path.
Efficiency is improved by finding the shortest paths and comparing them, although multiple iterations may add some computation time, saving time in the final path selection. The situation that different paths may need to be tried for multiple times in single planning is avoided, and the overall efficiency is improved.
Flexibility the method can be adjusted according to specific requirements and environments. For example, parameters such as iteration times, threshold values and the like can be set according to actual conditions so as to adapt to different scenes and requirements.
Optimized path selection-based on a plurality of shortest paths, further analysis and optimization can be performed. Other factors, such as smoothness, safety, etc., of the paths may be considered to comprehensively select the most appropriate path.
The method has certain expandability, and can be applied to more complex path planning problems, such as multiple target points, dynamic environments and the like. By proper adjustment and expansion, the requirements of different application scenes can be met.
Further, based on the path map picture with preliminary planning, the coordinates of the starting point and the coordinates of the target point, respectively executing a specified path planning algorithm from the starting point to the target point, and from the target point to the starting point, obtaining a first spanning tree and a second spanning tree, including:
determining preset point coordinates based on the starting point coordinates and the target point coordinates;
Determining whether the preset point coordinates are in an obstacle or not based on the path map picture with the preliminary plan;
And if the preset point coordinates are not in the obstacle, respectively executing a specified path planning algorithm from the starting point coordinates to the preset point coordinates and from the target point coordinates to the preset point coordinates to obtain the first spanning tree and the second spanning tree.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
The accuracy of path planning is improved by determining preset point coordinates and checking whether the preset point coordinates are in an obstacle or not, so that invalid calculation of a path planning algorithm in the obstacle can be avoided. This helps to improve the accuracy of the path planning, ensuring that the generated path does not cross an obstacle.
The amount of calculation is reduced in that if the preset point coordinates are within the obstacle, there is no need to perform a path planning algorithm from the start point or the target point to the point. Thus, unnecessary calculation can be reduced, and the algorithm efficiency can be improved.
The feasibility of the path is increased, namely, the generated path can be ensured to be feasible and not blocked by the obstacle by excluding the coordinates of the preset points in the obstacle. This increases the feasibility and practicality of the path.
The response speed of the system is improved, unnecessary calculation is reduced, the path planning speed can be increased, and the response speed of the system is improved. This is important for application scenarios with high real-time requirements, such as autopilot or robotic navigation.
The stability of the system is enhanced, namely, the possibility of errors or anomalies of an algorithm can be reduced by avoiding path planning in an obstacle, and the stability and reliability of the system are enhanced.
Optimizing the path selection, namely reasonably selecting preset point coordinates, and guiding a path planning algorithm to generate a better path. For example, it may be selected to set preset points in open areas or strategic locations to obtain a shorter, smoother, or more specific path.
The user experience is improved, and accurate and feasible path planning can provide better user experience. The user can obtain a satisfactory path planning result faster, and the working efficiency is improved or better service is enjoyed.
Further, if the preset point coordinates are in the obstacle, the method further includes:
and executing a specified path planning algorithm from the starting point coordinates to the target point coordinates to obtain a corresponding path plan.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
The continuity of path planning is ensured, namely, even if the preset point coordinates are positioned in the obstacle, the corresponding path planning can be obtained by executing the specified path planning algorithm from the starting point coordinates to the target point coordinates. This ensures that the path planning is not interrupted when an obstacle is encountered, but can continue, providing a continuous solution.
Increasing the flexibility of path planning this approach increases the flexibility of path planning. When the preset point is not available, planning can be directly performed from the starting point to the target point, and the situation that a feasible path cannot be found due to limitation of the preset point is avoided. Therefore, the method can be better adapted to different environments and conditions, and the success rate of path planning is improved.
The efficiency of path planning is improved, namely the path planning is directly carried out from the starting point to the target point, and extra calculation and judgment at the preset point can be avoided. This reduces the amount of computation and increases the efficiency of path planning, especially in complex environments or where fast generation of path plans is required.
Further, the preset point coordinates include a middle point coordinate, a third point coordinate and a two-thirds point coordinate.
One or more embodiments of the present disclosure provide a community inspection vehicle path planning apparatus, including:
at least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores instructions executable by the at least one processor, the instructions are executable by the at least one processor to enable the at least one processor to:
inputting a community map picture into a pre-trained generated countermeasure network model when the patrol vehicle carries out community patrol, and obtaining a path picture with preliminary planning;
Based on the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree;
and obtaining the shortest path from the starting point to the target point based on the first spanning tree and the second spanning tree.
One or more embodiments of the present description provide a non-volatile computer storage medium storing computer-executable instructions that, when executed by a computer, enable:
inputting a community map picture into a pre-trained generated countermeasure network model when the patrol vehicle carries out community patrol, and obtaining a path picture with preliminary planning;
Based on the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree;
and obtaining the shortest path from the starting point to the target point based on the first spanning tree and the second spanning tree.
The above-mentioned at least one technical scheme that this description embodiment adopted can reach following beneficial effect:
And the path planning efficiency is improved, namely, the pre-trained generation countermeasure network model is used for preliminary planning, and the picture with the potential path can be quickly generated. This reduces the time and computational resource consumption of searching a large number of invalid paths in the conventional path planning method, and improves the path planning efficiency.
And (3) enhancing the path accuracy, namely combining a designated path planning algorithm to perform path searching in two directions from the starting point and the target point to obtain a first spanning tree and a second spanning tree. Such bi-directional searching may more fully take into account path likelihood, thereby improving the accuracy of finding the shortest path.
The method is suitable for complex community environments, and can cope with various changes and uncertainties in the community environments. The generation of the countermeasure network model can learn the characteristics and modes of communities, thereby providing reasonable preliminary path planning under different conditions. The specified path planning algorithm can be further optimized according to actual conditions, so that the patrol car is ensured to adapt to complex community layout and dynamic environment.
The efficient and accurate path planning is helpful for the patrol vehicle to quickly and safely reach the destination and complete the patrol task. This can improve the security and management efficiency of communities, and discover and deal with potential problems in time.
Time and resources are saved, search and processing of invalid paths are reduced, and time and computing resources are saved. This is particularly important for resource-limited community inspection systems, which can improve the overall performance and sustainability of the system.
Detailed Description
The embodiment of the specification provides a community inspection vehicle path planning method, equipment and medium.
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present disclosure.
Fig. 1 is a schematic flow diagram of a method for planning a path of a community inspection vehicle according to one or more embodiments of the present disclosure, where the flow may be executed by a system for planning a path of a community inspection vehicle. Some input parameters or intermediate results in the flow allow for manual intervention adjustments to help improve accuracy.
The method flow steps of the embodiment of the present specification are as follows:
s102, inputting the community map picture into a pre-trained generated countermeasure network model when the patrol car carries out community patrol, and obtaining a path picture with preliminary planning.
In the embodiment of the present disclosure, a community map image is input into a pre-trained generated countermeasure network model, and before a path image with a preliminary plan is obtained, training is required to obtain the generated countermeasure network model, which is specifically as follows:
The method comprises the steps of randomly generating a plurality of map pictures to serve as data samples, executing an A-type algorithm from a starting point to a target point on each map picture to obtain map pictures marked with shortest paths, inputting the map pictures marked with the shortest paths to generate an countermeasure network model, and training to obtain the generated countermeasure network model after training.
It should be noted that, regarding the training to generate the countermeasure network model, the following specific embodiments may be adopted:
Data preparation-a plurality of map pictures are randomly generated, and a random map generation algorithm or an existing map data set can be used. For each map picture, coordinates of a start point and a target point are determined. And executing an algorithm A from a starting point to a target point on each map picture to obtain the shortest path. The shortest path is marked on the map picture, for example using different colors or line representations.
Generating an countermeasure network model training, namely constructing a generating countermeasure network model, wherein the generating countermeasure network model comprises a generator and a discriminator. And inputting the map picture marked with the shortest path as training data to generate an countermeasure network model. And a training generator for learning and generating map pictures similar to the shortest path of the real mark. The discriminator is trained so that it can distinguish between a true labeled shortest path map picture and a picture generated by the generator. Through continuous iterative training, the performance of the generator and the discriminator is gradually improved.
Model evaluation the trained generated countermeasure network model is evaluated using the test data. The similarity or error between the generated map picture and the true mark shortest path map picture can be calculated. And adjusting and optimizing the model according to the evaluation result.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
The accuracy of path planning is improved, namely, the shortest paths are marked by executing an A-algorithm on a large number of map pictures which are randomly generated, and the map pictures marked with the shortest paths are input into a generated countermeasure network model for training, so that the model can learn the shortest path modes and features under different map layouts. This helps to improve the accuracy of generating the countermeasure network model in initially planning the path, and reduce the generation of invalid paths.
The generalization capability of the model is enhanced, namely training is carried out by using randomly generated map pictures, so that the diversity and complexity of data can be increased, and the model can adapt to various community map layouts. This helps to increase the generalization ability of the model, enabling it to more accurately generate a preliminary planned path in the face of an actual community map.
The efficiency of path planning is improved, namely the trained generation countermeasure network model can quickly generate the path picture with preliminary planning, and the time and the computing resource consumption for searching a large number of invalid paths in the traditional path planning method are reduced. The method is beneficial to improving the efficiency of path planning, so that the inspection vehicle can reach a destination faster and complete the inspection task.
Promote the development of the intelligent community, and the efficient and accurate path planning is an important component of the intelligent community construction. By improving the accuracy and efficiency of path planning, the safety and management efficiency of communities can be improved, and the development of intelligent communities is promoted.
Further, after the map picture of the shortest path is obtained, the pixel point where the shortest path is located in the map picture of the shortest path can be expanded and coarsened.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
the visual effect of the path is improved, namely the shortest path can be more obvious and prominent on the map picture by carrying out expansion thickening treatment on the pixel point where the shortest path is located. The method is helpful for patrol personnel or related personnel to more intuitively see the planned path, improves the visual effect of the path and reduces the possibility of misunderstanding or misjudgment.
Enhancing the recognizability of the path, i.e. the shortest path after the thickening is more easily identified and distinguished, especially in complex map environments. This helps to improve the recognizability of the path, enabling the inspection vehicle or other equipment to more accurately follow the planned path, reducing the risk of deviation from the path.
The importance of the shortest path is emphasized, namely the importance of the shortest path can be emphasized by the expansion thickening process, so that the shortest path is more prominent in the map picture. This helps guide the inspection personnel or related personnel to choose the shortest path preferentially, improves inspection efficiency and work effect.
The method is convenient for tracking and monitoring the path, namely the shortest path after the thickening treatment is more clearly visible on the map picture, and is convenient for tracking and monitoring the path. The method has important significance for monitoring the running track of the inspection vehicle in real time, evaluating the path planning effect and carrying out subsequent optimization and adjustment.
S104, based on the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree.
In the embodiment of the present specification, the designated path planning algorithm is an RRT algorithm. The first spanning tree and the second spanning tree may be planned paths based on RRT algorithm.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
High efficiency RRT algorithm is a path planning algorithm based on random sampling, which can quickly search feasible paths in complex environments. Compared with other traditional algorithms, the RRT algorithm has the advantage of calculation efficiency, and can find a better path in a shorter time.
The RRT algorithm is suitable for various different types of environments, including static and dynamic environments. It is able to cope with the presence and variation of obstructions and with uncertainty factors in the environment. This makes its application in complex environments such as smart communities more reliable.
Optimality RRT algorithm can find a path close to optimal by constantly optimizing the path. According to the method, random sampling and local optimization are introduced in the searching process, so that the situation that a local optimal solution is trapped can be avoided, and the quality of a path is improved.
The RRT algorithm has good expandability and can be applied to large-scale environment and multi-robot systems. It can be used in combination with other algorithms or techniques to further improve the performance of path planning.
S106, obtaining the shortest path from the starting point to the target point based on the first spanning tree and the second spanning tree.
In this embodiment of the present disclosure, a first shortest path may be obtained by performing a first iteration when the first spanning tree meets the second spanning tree, or a distance between the first spanning tree and the second spanning tree is smaller than a set threshold, and a shortest path from the starting point to the target point may be obtained by repeatedly performing the path map picture with preliminary planning, the starting point coordinate, and the target point coordinate based on a preset iteration number, and performing a specified path planning algorithm from the starting point to the target point by the target point, respectively.
It should be noted that, regarding the shortest path from the starting point to the target point, the following specific embodiments may be adopted:
And step 1, obtaining a path map picture with preliminary planning, a starting point coordinate and a target point coordinate. Setting the iteration times.
And 2, executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point respectively based on the starting point coordinates and the target point coordinates to obtain a first spanning tree and a second spanning tree. It is determined whether the first spanning tree and the second spanning tree meet or whether the distance between them is less than a set threshold. And if the condition is met, completing the first iteration to obtain a first shortest path.
And 3, repeatedly executing the step 2 based on the preset iteration times. In each iteration, a new first spanning tree and second spanning tree are obtained and a determination is made as to whether they meet or whether the distance is less than a threshold. If the condition is satisfied, a plurality of second shortest paths are obtained.
And 4, determining the shortest path from the starting point to the target point based on the first shortest path and the plurality of second shortest paths. A comparison algorithm or other method may be used to select the shortest path.
And 5, outputting the shortest path from the starting point to the target point.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
the accuracy of path planning is improved, namely a plurality of shortest paths can be obtained by executing a specified path planning algorithm through a plurality of iterations. Based on these paths, the optimal paths can be further analyzed and selected, thereby improving the accuracy of path planning.
The reliability of path planning is enhanced, namely, through multiple iterations, the possible local optimal solution in single planning can be avoided. The presence of multiple shortest paths increases the likelihood of finding a globally optimal solution, thereby enhancing the reliability of path planning.
Considering different starting points and target points, the method respectively performs path planning from the starting points and the target points at the same time to obtain two spanning trees. This allows for more options in view of the path possibilities in different directions, helping to find the best shortest path.
Adaptation to complex environments where the path may be affected by a variety of factors, such as obstacles, terrain, etc. By iterating multiple times and generating multiple shortest paths, these complications can be better accommodated, finding a more suitable path.
Efficiency is improved by finding the shortest paths and comparing them, although multiple iterations may add some computation time, saving time in the final path selection. The situation that different paths may need to be tried for multiple times in single planning is avoided, and the overall efficiency is improved.
Flexibility the method can be adjusted according to specific requirements and environments. For example, parameters such as iteration times, threshold values and the like can be set according to actual conditions so as to adapt to different scenes and requirements.
Optimized path selection-based on a plurality of shortest paths, further analysis and optimization can be performed. Other factors, such as smoothness, safety, etc., of the paths may be considered to comprehensively select the most appropriate path.
The method has certain expandability, and can be applied to more complex path planning problems, such as multiple target points, dynamic environments and the like. By proper adjustment and expansion, the requirements of different application scenes can be met.
Further, when a specified path planning algorithm is executed from a starting point to a target point based on the path map picture with the preliminary plan, the starting point coordinate and the target point coordinate, and the target point is used for obtaining a first spanning tree and a second spanning tree, a preset point coordinate can be determined based on the starting point coordinate and the target point coordinate, whether the preset point coordinate is in an obstacle is determined based on the path map picture with the preliminary plan, and if the preset point coordinate is not in the obstacle, the specified path planning algorithm is executed from the starting point coordinate to the preset point coordinate and from the target point coordinate to the preset point coordinate, so that the first spanning tree and the second spanning tree are obtained. The preset point coordinates of the embodiment of the present specification may include middle point coordinates, one third point coordinates, and two third point coordinates.
It should be noted that, regarding the above-mentioned obtaining the first spanning tree and the second spanning tree, the following specific embodiments may be adopted:
And determining preset point coordinates, namely calculating middle point coordinates, third point coordinates and two-thirds point coordinates according to the starting point coordinates and the target point coordinates. The intermediate point coordinates may be determined by an average of the start point coordinates and the target point coordinates.
And judging whether the preset point coordinates are in the obstacle or not, and checking the path map picture with the preliminary planning for each preset point coordinate. Image recognition or other methods may be used to determine whether the preset point coordinates overlap with the obstacle.
And executing a specified path planning algorithm from the starting point coordinate to the preset point coordinate and from the target point coordinate to the preset point coordinate respectively if the preset point coordinate is not in the obstacle. The path planning algorithm may be selected according to specific requirements, such as an a-algorithm, a Dijkstra algorithm, and the like. After the path planning algorithm is executed, a first spanning tree and a second spanning tree are obtained.
Subsequent processing, further path optimization, path selection or other related processing may be performed based on the first spanning tree and the second spanning tree.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
The accuracy of path planning is improved by determining preset point coordinates and checking whether the preset point coordinates are in an obstacle or not, so that invalid calculation of a path planning algorithm in the obstacle can be avoided. This helps to improve the accuracy of the path planning, ensuring that the generated path does not cross an obstacle.
The amount of calculation is reduced in that if the preset point coordinates are within the obstacle, there is no need to perform a path planning algorithm from the start point or the target point to the point. Thus, unnecessary calculation can be reduced, and the algorithm efficiency can be improved.
The feasibility of the path is increased, namely, the generated path can be ensured to be feasible and not blocked by the obstacle by excluding the coordinates of the preset points in the obstacle. This increases the feasibility and practicality of the path.
The response speed of the system is improved, unnecessary calculation is reduced, the path planning speed can be increased, and the response speed of the system is improved. This is important for application scenarios with high real-time requirements, such as autopilot or robotic navigation.
The stability of the system is enhanced, namely, the possibility of errors or anomalies of an algorithm can be reduced by avoiding path planning in an obstacle, and the stability and reliability of the system are enhanced.
Optimizing the path selection, namely reasonably selecting preset point coordinates, and guiding a path planning algorithm to generate a better path. For example, it may be selected to set preset points in open areas or strategic locations to obtain a shorter, smoother, or more specific path.
The user experience is improved, and accurate and feasible path planning can provide better user experience. The user can obtain a satisfactory path planning result faster, and the working efficiency is improved or better service is enjoyed.
Further, if the preset point coordinates are in the obstacle, a specified path planning algorithm may be executed from the start point coordinates to the target point coordinates, so as to obtain a corresponding path plan.
It should be noted that, through the above, the embodiment of the present disclosure has the following beneficial effects:
The continuity of path planning is ensured, namely, even if the preset point coordinates are positioned in the obstacle, the corresponding path planning can be obtained by executing the specified path planning algorithm from the starting point coordinates to the target point coordinates. This ensures that the path planning is not interrupted when an obstacle is encountered, but can continue, providing a continuous solution.
Increasing the flexibility of path planning this approach increases the flexibility of path planning. When the preset point is not available, planning can be directly performed from the starting point to the target point, and the situation that a feasible path cannot be found due to limitation of the preset point is avoided. Therefore, the method can be better adapted to different environments and conditions, and the success rate of path planning is improved.
The efficiency of path planning is improved, namely the path planning is directly carried out from the starting point to the target point, and extra calculation and judgment at the preset point can be avoided. This reduces the amount of computation and increases the efficiency of path planning, especially in complex environments or where fast generation of path plans is required.
It should be noted that the intelligent community inspection vehicle is a mobile robot integrated with multiple advanced technologies, and is mainly used for security inspection and management work in communities. The system has the functions of license plate recognition and positioning, data transmission and processing, AI recognition and analysis, path navigation and planning and the like. The path planning is one of core technologies of the community inspection vehicle for realizing navigation and finishing inspection tasks. The path planning is to calculate and plan an effective path reaching the destination point from the set starting point under the condition of considering various factors of communities, and meanwhile, the path can meet certain performance indexes.
The generating countermeasure network (GAN, generative Adversarial Networks) is a model of deep learning, and is formed by the generating network and the judging network through countermeasure training. The main goal is to generate new data that is highly similar to real data through an antagonistic learning process between two networks.
The main task of the network generation is to generate new data samples, and the discrimination network is responsible for judging whether the data samples are real or not, namely identifying whether the result generated by the network generation is real data or generated counterfeits. In the training process, the generating network can continuously try to generate more real data which can deceive the discriminating network, and the discriminating network can try to improve the discriminating capability of the generating network, so that the counterfeits generated by the generating network can be identified. Such an countermeasure process enables two networks to advance together to generate more realistic, diverse data.
The RRT algorithm is an asymptotically optimal path planning based on a fast random search tree (Rapidly-exploring Random Trees, RRT), and the algorithm completes path planning through steps of random sampling, tree growth, path searching and the like. RRT progressively shortens as the number of iterations increases. However, when the map environment scene of the path planning map is large or the map environment is complex, the initial random sampling of the RRT algorithm may result in a decrease in search efficiency.
The embodiment of the specification provides a community inspection vehicle path planning method based on generation of an countermeasure network and improvement of RRT, which is used for solving the problem of low efficiency when a path planning is performed by using an RRT algorithm at present.
The embodiment of the specification is realized by the following technical scheme:
a community inspection vehicle path planning method based on generation of an countermeasure network and improvement of RRT, the implementation method comprising the steps of:
Step 1, feeding the map picture to generate an countermeasure network model, and outputting a path picture with preliminary planning;
Step 2, inputting a path map picture with preliminary planning, a starting point coordinate and a target point coordinate, and executing an RRT algorithm from the starting point to the target point and from the target point to the starting point respectively;
step 3, when two spanning trees meet or the distance is smaller than a set threshold value, ending the first iteration to obtain a path and marking the path as a shortest path;
step 4, continuously executing the step 2 and the step 3, and updating the shortest path if the generated path is smaller than the shortest path;
and 5, outputting the planned path after all iterations are finished.
The utility model provides a community inspection vehicle path planning method based on generating an countermeasure network and improving RRT, wherein the step 1 specifically comprises the following steps:
Step 1.1, randomly generating a large number of map pictures to serve as data samples;
Step 1.2, executing an A-algorithm from a starting point to a target point on each generated map picture to obtain a shortest path, as shown in a schematic diagram of an initial shortest path in fig. 2, and performing expansion and thickening treatment on a pixel point where the shortest path is located;
Step 1.3, randomly generated map pictures are sent into a generated countermeasure network model, pictures with the shortest paths of an A-algorithm are sent into a discrimination network for training, and a generated countermeasure network after training is obtained;
Step 1.4, the planning map picture is sent into the training completion countermeasure network, and a picture with a path is output, such as a schematic diagram of a preliminary planning shortest path shown in fig. 3.
The method for planning the path of the community inspection vehicle based on generating an countermeasure network and improving RRT specifically comprises the following steps:
Step 2.1, inputting a map M, RRT, the iteration number K, a starting point coordinate (xs,ys) and a target point coordinate (xg,yg);
and 2.2, sending the map M into the generated countermeasure network trained in the step 1 to obtain a map M'.
Step 2.3 calculating coordinates of the intermediate pointsPerforming collision detection, judging whether the point (x1,y1) is positioned in the obstacle, and calculating if the point is positioned in the obstacleContinuing collision detection, and calculating if the collision detection is located in the obstacle
Step 2.4, if the intermediate point is obtained in step 2.3, performing two RRT segments from the start point coordinate (xs,ys) to the intermediate point and from the target point coordinate (xg,yg) to the intermediate point, and if the intermediate point is not obtained in step 2.3, performing one-segment path planning from the start point coordinate (xs,ys) to the target point coordinate (xg,yg).
And 2.5, iterating the RRT algorithm K times, and outputting the shortest path.
The embodiment of the specification has the beneficial effects that:
In the embodiment of the specification, map preprocessing is performed based on the generated countermeasure network, the generated countermeasure network is trained by executing an a-algorithm of the shortest path through a large amount of map data as a training set of the generated countermeasure network, and the shortest path is generated by learning the a-algorithm.
The embodiments of the present description address the problem of RRT inefficiency. The method has the advantages that the generation of the countermeasure network is adopted to form the path sampling range preliminarily, the execution speed of the RRT algorithm is accelerated, and meanwhile, the RRT algorithm is executed bidirectionally based on the principle that the straight line between two points is shortest, so that the path planning efficiency is further improved.
In the embodiment of the present disclosure, a plurality of map pictures generated by an a-algorithm are trained and generated based on a countermeasure network to learn a path generated by the a-algorithm, and meanwhile, sampling points of an RRT-algorithm are selected in the generated path to reduce the problem of low initial random sampling efficiency of the RRT-algorithm.
Fig. 4 is a schematic structural diagram of a path planning apparatus for a community inspection vehicle according to one or more embodiments of the present disclosure, including:
at least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores instructions executable by the at least one processor, the instructions are executable by the at least one processor to enable the at least one processor to:
inputting a community map picture into a pre-trained generated countermeasure network model when the patrol vehicle carries out community patrol, and obtaining a path picture with preliminary planning;
Based on the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree;
and obtaining the shortest path from the starting point to the target point based on the first spanning tree and the second spanning tree.
One or more embodiments of the present description provide a non-volatile computer storage medium storing computer-executable instructions that, when executed by a computer, enable:
inputting a community map picture into a pre-trained generated countermeasure network model when the patrol vehicle carries out community patrol, and obtaining a path picture with preliminary planning;
Based on the path map picture with the preliminary planning, the starting point coordinates and the target point coordinates, respectively executing a specified path planning algorithm from the starting point to the target point and from the target point to the starting point to obtain a first spanning tree and a second spanning tree;
and obtaining the shortest path from the starting point to the target point based on the first spanning tree and the second spanning tree.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, non-volatile computer storage medium embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.