# Real-Time Kinematics-Based Self-Collision Avoidance Algorithm for Dual-Arm Robots
## 4 Simulation and Application of the Algorithm
### Simulations  
The simulation was performed using an Intel Atom(r) E3845 processor (Quad Core, 1.91 GHz, 10 W) with 32 GB of RAM, and Ubuntu 16.04 using ROS Kinetic. The simulation results are shown in Figure 8.  
The algorithm was simulated on a dual-arm robot with 10 control points on each arm. First, the system needs to detect and update the matrix in real time. Following the steps presented in Section 3, the new joint velocities were calculated, which changes the motion of the robot to avoid collision. These processes are illustrated in Figure 8. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Joint** & **1** & **2** & **3** & **4** & **5** & **6** & **7** \\ \hline Joint limit (degrees) & \(-\)180, 25 & \(-\)270, 90 & \(-\)270, 90 & \(-\)220, 45 & \(-\)180, 180 & 0, 100 & \(-\)90, 90 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Constraints of joints. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Point** & **1** & **2, 3** & **4** & **5, 6** & **7** & **8** & **9, 10** \\ \hline Link & 1 & 2 & 3 & 4 & 5 & 6 & 7 (end-effector)  
\end{table} 
Table 2: Sphere diameters. Figure 7: Collision model of the robot used to calculate the distances of the collision model. The red lines represent the distance from the two points on the right arm to all points on the left arm. Figure 8: _Cont._  
In Figure 8(a.i, i = 1, 2), we intentionally set the same target positions for the two arms (i.e., without the self-collision avoidance algorithm, the two arms will collide as the end-effectors approach their targets). Actually, with the self-collision avoidance strategy, the repulsive velocities are calculated on the control points. In Figure 8(a.1), the repulsive velocity acted on the end-effector of the left arm and link 6 of the right arm; in Figure 8(a.2), the repulsive velocity acted on the end-effectors of the robotic arms. Both the left and right arms changed their motion to avoid collision. The repulsive velocity on each arm both act on the end-effectors, which makes each arm move away from their target. In Figure 8(b.i, i = 1, 2, 3), we intentionally set the left and right end-effectors with different targets. Without the self-collision avoidance algorithm, the two arms will collide as the end-effectors approach their targets. With the self-collision avoidance strategy, the repulsive velocities were calculated on the control points. In Figure 8(b.1), the repulsive velocity acted on link 7 of the left arm and link 6 of the right arm; in Figure 8(b.2) the repulsive velocity acted on the end-effector of the left arm and link 6 of the right arm; in Figure 8(b.3) the repulsive velocity acted on link 6 of the left arm and link 6 of the right arm. The simulated process of avoiding self-collision is illustrated in Figure 8(b.i, i = 1, 2, 3). The right arm and left arm both changed their trajectories to avoid self-collision, but one of the dual-arms was also close to the target in the other trajectory. In Figure 8(b.1), the left arm was close to the target. In Figure 8(b.2), the left arm was close to the target. In Figure 8(b.3), the right arm was close to the target. A common approach for self-collision avoidance is the artificial potential field in which one of the arms is modeled with an obstacle. However, these strategies often result in a (topologically unnecessary) minimum [28]. Meanwhile, we completed two simulations using the traditional artificial potential field method. These methods do not consider the velocity vector of the end-effector. In Figure 9a, two arms of dual-arm had a common target and in Figure 10a, two arms of dual-arm had different targets. The trajectories of each arm illustrated that the two arms both easily fell into the local minimum and vibrated around the local minimum points, as illustrated in Figure 9b, Figure 10b, respectively. Figure 8: Process of avoiding self-collision in the dual-arm system. (**a.1**) Left arm collides with right arm; the repulsive velocity acts on the end of the arm.