# Multi-Robot Trajectory Planning and Position/Force Coordination Control in Complex Welding Tasks
## 3 Task-Oriented Multi-Robot Trajectory Planning
### Trajectory Planning Strategy  
As shown in Figure 2, the coordinate systems involved in the multi-robot cooperative welding process are numerous, and the transformation between coordinate systems is complicated. At the same time, the welding requirements as described above must also be met in order to finish the welding task smoothly. We can conduct that the initial welding position affects whether the entire welding task can proceed smoothly or not. Based on the above constraints and requirements, a multi-robot trajectory planning based on \"hierarchical scheme\", which considered the optimal initial welding position, is proposed in this paper. The basic idea of the above scheme is to first determine the optimal initial welding position, that is to determine the position of the reference coordinate system of the object in the world coordinate system. Then according to the welding task, the trajectory of the object in its reference coordinate system is planned. Finally, the robot end-effector trajectory is planned through the constraint relationship between the robot and the object. The following steps are used to obtain the trajectory of multi-robot. The first step is to determine the layout of the optimal welding position in the initial state, it is same to determine the position \(\mathbf{p}\) (\(x\),\(y\),\(z\)) which \(\mathbf{T}_{o}\) is related to the world coordinate \(\mathbf{T}_{w}\). In combination with the requirements of the multi-robot cooperative welding process, the following indicators are considered to affect the layout selection of initial welding position. 1. The dual-arm task-based directional manipulability measure (DATBDMM) is mainly aimed at the transfer robots. 2. Flexible measure (FM) is mainly for the welding robot. 3. Global joint exercise (GJE) is used for the transfer robots and the welding robot. Figure 2: The system coordinates of multi-robot pipe-connect-pipe welding task. According to the above performance indicators, the mathematical model for establishing the optimal initial welding position layout is shown in Equation (1). \[\left\{ \begin{array}{l}\mathrm{DATBDMM}_{cv}=\max\limits_{n-1}\left(\mathbf{p}^{ \mathsf{T}}\mathbf{I}_{vc}\mathbf{p}\right)^{-1}\\ \mathrm{FM}=\max\limits_{m-1}\frac{\sum\limits_{n-1}^{a}D_{p}(\alpha,\beta)}{ \sum\limits_{m-1}^{a}\sum\limits_{n-1}^{b}1}\\ \mathrm{GJE}=\min\limits_{j=1}^{3}\sum\limits_{i=1}^{n}{{}^{j}w_{i}(\theta_{i }(k)-{{}^{j}}\theta_{i}(k-1))}^{2}\end{array} \right., \tag{1}\]  
where \(\mathbf{p}\in\mathbf{R}^{3\times 1}\) represents the velocity unit vector at the point of mass center of the workpiece. \(\mathbf{I}_{vc}=\left(\mathbf{I}_{1 cv}\mathbf{I}_{1 cv}\mathbf{{}^{\mathsf{T}}}\right)^{-1}+ \left(\mathbf{I}_{2 cv}\mathbf{I}_{2 cv}\right)^{-1},\mathbf{I}_{icv}\) represents the speed Jacobian matrix of the robot at the center of operated object. \(\alpha,\beta\) indicate the rotation angle of welding torch around the \(y\)-axis and \(z\)-axis, respectively. After rotation, it can meet the welding requirements (shipping welding requirements). \(D_{P}(\alpha,\beta)\) denotes a pose reachable function. If there is an inverse solution, it is denoted as \(D_{P}(\alpha,\beta)=1\). Otherwise, it is denoted as \(D_{P}(\alpha,\beta)=0\). \({{}^{j}}w_{i}\) represents the influence factor of each joint. \({{}^{j}}\theta_{i}(k)-{{}^{j}}\theta_{i}(k-1)\) indicates the amount of joint change at a certain moment. The optimal initial welding position \(\mathbf{p}\) (\(x\),\(y\),\(z\)) is determined according to the above performance index, and the mathematical model of the optimal initial welding position for multi-robot cooperative welding is shown in Equation (2), then the optimal solution can be solved.