## 6 Simulation and Experiment (Python and ROS Simulation)
### Experiments and Analysis in Python  
Experiment 1. A comparison among the algorithms for different numbers of obstacles was carried out to verify that the improved APF and RRT hybrid algorithm maintained a better search effect in the case of multiple obstacles. With a gradually increasing number of obstacles, the advantages and disadvantages of the proposed path planning algorithm were compared with those of the classic RRT algorithm, the RRT* method, and the P_RRT* algorithm. Each group of experiments was performed 200 times, and the average of the \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Search step \(\rho\) & 1.0 dm \\ Starting point & (0,0,0)/dm \\ Ending point & (8,10,10)/dm \\ Gravitational coefficient \(z\), \(\mathrm{K_{p}}\) & 0.05 \\ Repulsion coefficient \(\eta\) & 100.0 \\ \(\alpha\) & 0.4 \\ \(\beta\) & 0.6 \\ Obstacle influence radius \(\rho_{0}\) & 0.3 dm \\ Target sampling rate & 0.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Manipulator motion control parameter table. Figure 9: Comparison of the Bezier fitted curve and original path. results is shown in Table 2, where the search success rate was that the search was within 100 s of a successful search, and the search was unsuccessful outside of 100 s.  
According to Table 2, the search time, path length, number of sampling nodes, and search success rate of the algorithms are compared. The search time of the classic RRT algorithm was relatively short when there are few obstacles. When the number of obstacles gradually increased, the search time greatly increased, and the search success rate decreased. Compared with the classic RRT algorithm, the RRT* method was superior. The average search time and the average number of sampling nodes were greatly improved, and the algorithm maintained good results when the number of obstacles gradually increased. Compared with the RRT* algorithm, the P_RRT* algorithm exhibited further improvements, and the search efficiency was higher. With an increasing number of obstacles, stable search results can be maintained, but compared with the improved APF and RRT hybrid algorithm in this article, it still had the disadvantages of a low search efficiency, tortuous paths, and high average number of sampling nodes, which consumed more computing memory. The hybrid algorithm in this paper showed a better effect when the number of obstacles gradually increased. Experiment 2. To analyze the effectiveness of the improved APF and RRT hybrid algorithm, this work compared various algorithms under the same conditions of obstacles and step lengths. Each set of experiments was performed 200 times, and the average of the results is shown in Table 3.  
According to the data in Table 3, the classic RRT algorithm had a slow search speed, a large number of sampling nodes, and tortuous paths when there were many obstacles, as shown in Figure 10a. Compared with the classic RRT algorithm, the RRT* algorithm had a great improvement in the average search time, the path planning efficiency was higher, and the generated path was smoother, as shown in Figure 10b. The average search time of the P_RRT* algorithm was shorter than that of the RRT* algorithm. However, compared with the improved APF and RRT hybrid algorithm in this paper, there were still shortcomings, such as a low search efficiency, tortuous paths, and a large demand on the computing memory. The improved hybrid algorithm in this paper still showed excellent results in the case of many obstacles, the search efficiency was higher, the path was shorter and smoother, and it overcame the phenomenon of tortuous paths and unreachable targets in the APF method when there were obstacles near the starting point and target point. To a certain extent, the blindness of the RRT algorithm was reduced, and the efficient obstacle avoidance ability of the RRT algorithm was fully utilized, as shown in Figure 10d.