# Automatic Optimal Robotic Base Placement for Collaborative Industrial Robotic Car Painting
## 6 Formulating the Multi-Objective Optimization Problem  
In this section, we formulate a proper multi-objective optimization problem using the cost functions developed in Sections 4 and 5.  
Considering the base positions \(\mathbf{p}_{i}\), \(1\leq i\leq M\), as the decision variables, the cost functions \(\mathcal{F}_{1}(\cdot),\mathcal{F}_{2}^{\text{top}}(\cdot),\mathcal{F}_{2}^{ \text{side1}}(\cdot),\mathcal{F}_{2}^{\text{side2}}(\cdot)\) constitute a proper objective function vector. We recall that \(\mathcal{F}_{1}(\cdot)\) given by (12) quantifies the possibility of collision between the robots during painting. On the other hand, \(\mathcal{F}_{2}^{\text{top}}(\cdot)\), \(\mathcal{F}_{2}^{\text{side1}}(\cdot)\), and \(\mathcal{F}_{2}^{\text{side2}}(\cdot)\) given by (13), (14), and (15), respectively, quantify the vehicle's top and sides' paint coverage ratios.  
We are interested in finding optimal decision variables \(\mathbf{p}_{i}\), \(1\leq i\leq M\), such that \(\mathcal{F}_{1}(\cdot)\) is minimized while \(\mathcal{F}_{2}^{\text{top}}(\cdot)\) (resp., \(\mathcal{F}_{2}^{\text{side1}}(\cdot)\), \(\mathcal{F}_{2}^{\text{side2}}(\cdot)\)) is maximized. Equivalently,we can seek to minimize \(-\mathcal{F}_{2}^{\text{top}}(\cdot)\) (resp., \(-\mathcal{F}_{2}^{\text{side}_{1}}(\cdot)\), \(-\mathcal{F}_{2}^{\text{side}_{2}}(\cdot)\)). Using the cost functions \(\mathcal{F}_{1}(\cdot)\), \(-\mathcal{F}_{2}^{\text{top}}(\cdot)\), \(-\mathcal{F}_{2}^{\text{side}_{1}}(\cdot)\), and \(-\mathcal{F}_{2}^{\text{side}_{2}}(\cdot)\) we formulate the following multi-objective optimization problem  
\[\min_{\mathbf{p}_{1}\cdots\cdot\mathbf{p}_{M}}\mathcal{F}_{\text{BP}}( \mathbf{p}_{1},\cdots,\mathbf{p}_{M}) \tag{16}\]  
where the objective function vector \(\mathcal{F}_{\text{BP}}(\cdot)\) is defined by  
\[\mathcal{F}_{\text{BP}}(\mathbf{p}_{1},\cdots,\mathbf{p}_{M}):=\begin{bmatrix} \mathcal{F}_{1}(\mathbf{p}_{1},\cdots,\mathbf{p}_{M})\\ -\mathcal{F}_{2}^{\text{top}}(\mathbf{p}_{1},\cdots,\mathbf{p}_{M})\\ -\mathcal{F}_{2}^{\text{side}_{1}}(\mathbf{p}_{1},\cdots,\mathbf{p}_{M})\\ -\mathcal{F}_{2}^{\text{side}_{2}}(\mathbf{p}_{1},\cdots,\mathbf{p}_{M})\\ \end{bmatrix}. \tag{17}\]  
Having formulated the multi-objective optimization problem as in (16) and (17), we can invoke any standard multi-objective optimizer for computing the optimal fixed base positions. In this paper, we adopted the goal attainment algorithm [56], which has an efficient implementation through the function fgoalattain in MATLAB, R2020b, Mathworks, Natick, MA. To determine the goals in the goal attainment problem, we set the goal of the first cost function equal to 0. This indicates a goal value of zero for the overlap area between the projection of the robot workspace ellipsoids. Since we are minimizing the cost functions \(-\mathcal{F}_{2}^{\text{top}}(\cdot)\), \(-\mathcal{F}_{2}^{\text{side}_{1}}(\cdot)\), and \(-\mathcal{F}_{2}^{\text{side}_{2}}(\cdot)\) in the objective function vector given by (17), we set their associated goal values equal to \(-1\).  
**The overall proposed solution:**Figure 9 illustrates the overall proposed solution to the multi-robot car-painting base placement problem. The pre-processing stage (see Algorithm 1) performs a point cloud rendering of the reachable workspace of the forearms of the robotic arms and fits ellipsoids to these point clouds. Using the constructed cost function in (12), we quantify the possibility of collision between the robotic arms without any need for planning their motion trajectories a priori. This cost function can be computed using a projection of the ellipsoids on the factory floor/ceiling and summing the resulting ellipse overlap areas. Similarly, using the constructed cost functions in (13), (14), and (15) computed using Algorithm 2, we quantify the possibility of the vehicle paint coverage. These cost functions can then be utilized within any standard multi-objective optimization routine to compute the optimal robot base positions.