4.1. Comparative Analysis of Optimization Algorithms and Traditional Algorithms
To verify the effectiveness and generalization of the fusion algorithm based on the optimized A-star algorithm and the artificial potential field method proposed in this paper, MATLAB simulations of the traditional A-star algorithm and the optimized A-star algorithm, the traditional potential field method and the optimized potential field method were carried out in simple and complex environments to verify the performance of the optimization algorithm as proposed in this paper.
A simple environment mapping is shown in
Figure 8. A raster map of three different environments was constructed in MATLAB, with a map size of 20 × 20 and black x’s indicating obstacles. The red boxed points are the calculated path points, the green boxed points are the points to be included in the open list to be checked and the connecting lines are the optimal paths found. From
Figure 8, it can be seen that the optimized A-star algorithm can obtain the same path as the traditional A-star algorithm under the same map environment. A comparison of the path-planning times for the 10 groups based on
Figure 8a,b is shown in
Table 1, where the optimized algorithm reduces the path-planning time by 60% compared to the traditional algorithm. In addition, based on
Figure 8b,d,e,f, the optimized A-star algorithm can obtain a feasible path quickly and accurately in the same map environment with different start and end point settings.
As shown in
Figure 9, after the map environment is changed, the optimized algorithm can still meet the path-planning requirements. Compared with the traditional A-star algorithm, the optimized A-star algorithm searches a much smaller range of path points than the traditional algorithm while obtaining the same path in the same map environment. As shown in
Figure 9b,d, the optimized A-star algorithm can complete the path-planning requirements in the new map environment with different start and end points replaced. As shown in
Figure 9a,b and the path-planning time comparison in
Table 2, the path-planning time of the optimized A-star algorithm is reduced by more than 50% compared to the traditional A-star algorithm.
The complex map is shown in
Figure 10, and a 40 × 40 grid map was created in MATLAB. The optimization algorithm is still able to obtain a feasible path when performing path planning in a complex map environment.
Compared with the traditional A-star algorithm, the advantage of less computation of the optimized A-star algorithm is more obvious. A comparison of path-planning times based on
Figure 10a,b, as shown in
Table 3, shows that the optimized A-star algorithm reduces the pathfinding time by nearly 70% compared to the traditional algorithm.
Based on the analysis of the path-planning time and the path accessibility, the optimized A-star algorithm achieves a significant improvement in path accessibility and speed over the traditional algorithm, while ensuring that a complete global path can be obtained. As the complexity of the pathfinding environment increases, the efficiency of the optimized algorithm becomes more pronounced than that of the traditional algorithm. Nevertheless, the optimized A-star algorithm does not solve the problem of insufficient smoothness at path transitions.
To address the problem of the global path-planning transitions not being smooth enough to facilitate smooth robot tracking, an optimized potential field method is proposed for smoothing, as described in the previous section. The simulation diagram is shown in
Figure 11.
Figure 11 also shows that the optimization algorithm is still able to meet the pathfinding requirements when different starting points and different endpoints are set in the same environment. Moreover, from
Figure 11b,d, it can be seen that the optimization algorithm can effectively complete the library path planning when the same start and end points are set in different map environments. It can also be seen from
Figure 11 that the algorithm has good robustness and generalizability. The comparison between
Figure 11 and
Figure 12 shows that the smoothing process reduces a large number of inflection points compared to global path planning, thus improving the path-tracking capability of the robot and increasing the movement speed of the mobile robot. In addition, as the repulsive force of the obstacle in the artificial potential field method acts on the cart, it will cause the cart to move away from the obstacle appropriately, making the path of the cart more reasonable and solving the global path-planning problem of walking along the edge of the obstacle.
As shown in
Figure 11, the path obtained by the artificial potential field method is discontinuous in the global path steering (see
Section 3.2.2 above for the rationale). We, therefore, used the least squares method of path fitting to obtain
Figure 12.
Figure 12 gives the fitted paths planned by the algorithm based on different starting and ending points in the same environment.
In the case of local path planning, the repulsive force from the obstacles is only applied to the moving car within a certain range with the moving car as the center of the circle, and the repulsive force from the obstacles outside the range is 0. In addition, considering that dynamic obstacles are inevitable in the real environment, 20 random dynamic obstacles were included, indicated by the circles in
Figure 13.
From the simulation results in
Figure 13a, it can be seen that during the pathfinding process, when dynamic obstacles appear within the force range of the vehicle, the mobile robot will react quickly to avoid the obstacles. It is guaranteed to move towards the target point while moving towards the safe area as far as possible, as shown in
Figure 13a at points (8, 9) and (12, 8). The vehicle based on global path planning can achieve real-time dynamic obstacle avoidance and reach the target point smoothly and safely. Meanwhile, as shown in
Figure 13c,d, after the map environment is changed, the mobile robot path-planning process can still maintain the ability to quickly avoid dynamic obstacles while traveling towards the target point. As shown in
Figure 13b, the vehicle can achieve real-time dynamic obstacle avoidance based on global path planning and reach the target point smoothly and safely.
4.2. Comparative Analysis of Optimized A-Star Algorithm and Bidirectional A-Star Algorithm
Currently, many scholars have proposed improving the bidirectional A-star algorithm for path planning [
23,
24,
25]. The principle of the bidirectional A-star algorithm is to select a virtual endpoint in the middle of the straight line distance between the starting point and the ending point [
26]. If the virtual endpoint lies in an obstacle area, the nearest obstacle edge is chosen as the virtual endpoint, while the endpoint at the other end is used as the starting point, and then path planning is performed towards the virtual endpoint.
As shown in
Figure 14a,c, (10.9) is defined as the midpoint of the bidirectional A-star, indicated by the red “
” in the diagram. A comparison of the path planning of the optimized A-star algorithm and the bidirectional A-star algorithm proposed in this paper shows that the optimized A-star algorithm has better throughput, that the path-planning efficiency of the optimized A-star algorithm is higher (as shown in
Table 4), and that the path-planning time of the optimized A-star algorithm is 65.2% less than the path-planning time of the bidirectional A-star algorithm. The number of computing nodes is 103 in
Figure 14a and 70 in
Figure 14b. The optimized A-star algorithm reduces the number of computing nodes by approximately 32% compared to the bidirectional A-star algorithm. Meanwhile, as shown in
Figure 14a,c, the bidirectional A-star algorithm is affected by various factors such as obstacle size and map environment complexity when selecting virtual endpoints, which indirectly affects the pathfinding efficiency of the bidirectional A-star algorithm. The pathfinding efficiency of the optimized A-star algorithm is only affected by the complexity of the map environment, and therefore the performance of the optimized A-star algorithm is more stable than that of the bidirectional A-star algorithm.
4.3. Simulation Analysis of the Effect of Different L Values on the Potential Field Method
In this paper, the algorithm rules for path planning in the optimized potential field method are changed, replacing the fixed starting point and fixed endpoint of the traditional potential field method with temporary starting points and temporary endpoints that change as the position of the mobile robot changes. As a result, the number of iterations of the traditional potential field method is no longer suitable for the optimized potential field method. For this reason, an adaptive iteration number setting is proposed in this paper, which has been theoretically derived in
Section 3.2.1. The experimental part was set up with L values of 1, 10 and 100 for comparison, and the results of the comparison are shown below.
From
Figure 15a,b, it can be seen that when the value of L is too small, it leads to too few iterations, and therefore it is difficult for the optimized potential field method to reach the interim endpoint. In addition, as shown in
Figure 16, the path-planning time of the optimized potential field method is only reduced by 30% when the value of L is 1 compared to when the value of L is 10. From
Figure 15b,c, the path-planning results are almost the same for L values of 10 and 100. However, as can be seen in
Figure 16, the optimized potential field method time increases by 288% for the L value of 100 compared to the L value of 10. Therefore, it can be concluded that when the L value is too large, it increases the path-planning time of the optimized potential field method significantly, but there is no significant improvement in the final path-planning result.