# Obstacle Avoidance Path Planning for the Dual-Arm Robot Based on an Improved RRT Algorithm
## 4 Simulation
### Obstacle Avoidance Path Planning for Dynamic Dual-Arm Robots  
Through the above path planning simulations in conventional scenarios, the effectiveness of the GA_RRT algorithm in path searching and reducing redundancy is successfully verified. Finally, in order to verify the effectiveness of the algorithm for the obstacle avoidance path planning of the dual-arm robot, this paper establishes a three-dimensional obstacle environment through the robot simulation toolbox. The starting joint angle and target joint angle of the main arm are set to 45, \(-\)15, \(-\)15, 0, 0, 0 and 5, 45, 5, 15, \(-\)5, 0. The starting joint angle and target joint angle of the slave arm are set to 35, 30, 20, 0, 0, 0 and 0, \(-\)45, 30, \(-\)30, \(-\)15, 0, respectively. Due to the bounding sphere collision detection model, the obstacles will eventually be equivalent to a sphere. Therefore, this paper sets five spherical static obstacles of different sizes in the environment. The center and radius of each obstacle are shown in Equation (10). \[O_{sphere0}=\left[ \begin{array}{ccc}-0.55&-0.25&0.15\\ -0.5&0.3&-0.5\\ -0.45&-0.2&0.15\\ -0.3&0.3&0.15\\ -0.4&0.25&0.15\end{array} \right];\;\mathrm{R}=\left[ \begin{array}{ccc}0.05&0. 04&0.03&0.05&0.06\end{array} \right] \tag{10}\]  
The obstacle is placed on the path of the dual-arm robot moving towards the target point. The initial scene is shown in Figure 8a. As shown in Figure 8b,c, if the robot arm does not plan the obstacle avoidance path, the slave robot arm will collide with the static obstacle and the master arm link during the movement. The final state of the dual-arm robot reaching the target point is shown in Figure 8d. Keeping the surrounding environment of robot arm unchanged, the obstacle avoidance path planning algorithm of the dual-arm robot based on GA_RRT is added into the simulation. Figure 9a shows the exploration process of the main arm joint angle. In order to visualize the six-dimensional exploration process, it is divided into the exploration process of the first three joints and the exploration process of the last three joints. The angle exploration process is shown in Figure 9. The final result of the exploration is shown in Figure 10. From Figure 10, we can clearly observe the change process of the joint angle. The starting joint angle and target joint angle of the main arm are 45, \(-\)15, \(-\)15, 0, 0, 0 and 5, 45, 5, 15, \(-\)5, 0, respectively. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **RRT** & **G\_RRT** & **GA\_RRT** \\ \hline
**Total number of nodes** & 348 & 129 & 75 \\ \hline
**Path length** & 683.53 & 465.42 & 459.3 \\ \hline
**Average time/s** & 13.1 & 5.5 & 3.6 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The average experimental data for Scenario B. Similarly, Figure 11 shows the path exploration process for the slave arm. The starting joint angle and target joint angle of the slave arm are 35, 30, 20, 0, 0, 0 and 0, \(-45,30,\)\(-30,\)\(-15,\)\(0,\) respectively. We can draw similar conclusions from the search results in Figure 12.  
Figure 8: Motion state decomposition without obstacle avoidance path planning: (**a**) initial state; (**b**) motion state 1, collide with the environment; (**c**) motion state 2, self-collision; (**d**) side view of final state. Figure 11: Exploration process of the salve arm: (**a**) the first three joint angles of the slave arm; (**b**) the posterior three joint angles of the slave arm. Figure 10: The final result of the path planning for the main arm. Figure 9: Exploration process of the main arm joint angle: (**a**) the first three joint angles of the main arm; (**b**) the posterior three joint angles of the main arm. The simulation realizes the search process and results of a total of 12 joint angles of the main arms and slave arms. It can be seen from the search process that the joint angle search starts from the green starting point. At the beginning, because of the obstacles, the random points directly extended to the target point were not able to pass the obstacle detection.