# A Sampling-Based Unfixed Orientation Search Method for Dual Manipulator Cooperative Manufacturing
## 4 Minimum Distance Prediction  
Collision detection is a fundamental theoretical research area of robotics, focusing on establishing a reasonable manipulator model and calculating the minimum distance between the manipulator and the obstacle. Collision detection can generally be divided into static collision detection, dynamic collision detection, and continuous collision detection [24]. Static collision detection is for the case where the manipulator and the obstacle are in a static state. In this case, collision detection can be modeled as the process of computing the minimum distance between two static geometric models in Cartesian space. Dynamic collision detection is where at least one of the manipulators and the obstacle is moving. The dynamic collision detection problem can be transformed into static collision detection because continuous time can be discretized. Both the manipulator and the obstacle can be considered static at each time interval. Continuous collision detection uses time as a variable to study the trend of the minimum distance between the manipulator and the obstacle in a given time interval. Obviously, by observing Formulas (2) and (3), the optimal function and condition functions in the optimization equations are all contain the same variable term \((\mathbf{x}_{1},\mathbf{x}_{2})\). However, the inequality function \(d_{t+t_{s}}^{min}\geq L_{min}\) cannot connect with the optimization function via the common variables through the existing discrete collision detection algorithm. The static collision detection and dynamic collision detection methods are not satisfied to determine the relationship between the minimum distance and the movement trend of path-planned manipulators. Therefore, we need to find a continuous collision detection algorithm that transforms the constraint functions of the minimum distance into inequality functions that take \((\mathbf{x}_{1},\mathbf{x}_{2})\) as variables, so that the whole set of optimization equations can be transformed into a function set with the same vector variables, which will be easy for us to solve. The first step for collision detection is robot modeling. For multi-axis chain manipulators, there are many mature modeling methods [25]. Here, we use the Sweep Sphere Volume (SSV) [26] method, which envelops each link of a manipulator's arm with a capsule body. For \(d_{t+t_{s}}^{min}\geq L_{min}\), it is equivalent to:  
\[d_{t+t_{s}}^{min}\geq L_{min}\Leftrightarrow d_{t}^{min}-\Delta d_{t+t_{s}} \geq L_{min}\Leftrightarrow\Delta d_{t+t_{s}}\leq d_{t}^{min}-L_{min} \tag{5}\]  
where \(d_{t}^{min}\) is the shortest distance between manipulator and obstacle(s) at current time instant t, so its value must be known, and \(L_{min}\) is a predefined value. Thus, we need to figure out how to express \(\Delta d_{t+t_{s}}\) in some kind terms of \((\mathbf{x}_{1},\mathbf{x}_{2})\) in the dual manipulator situation. In the following content of this section, we will propose a novel minimum distance prediction (MDP) method to meet our requirements. MDP method is derived from the algebraic geometry (AG) method of collision detection. Via the AG method, the problem of calculating the minimum distance between objects is transformed into the calculation of distance between abstract space geometries. From Figure 5, we can observe that the movements of the minimum-distance points of the two manipulators along their respective mechanical arms are continuous, and there exists only one minimum-distance point for each manipulator at a time. At the same time, the calculation of minimum distance between two manipulators can be simplified into the calculation of minimum distance between two space segments according to the principle of collision detection. Therefore, based on the knowledge of the positions and the velocities of the two minimum-distance points under the current instant, we can predict the possible locations of the minimum-distance points and the distance between them in the next scanning period.