# Calibration of a Rotating or Revolving Platform with a LiDAR Sensor
## 3 Calibration Method
### Optimisation  
As mentioned before, the LiDAR's orientation is optimised separately from its translation. The vectors \(\vec{d}_{i}\) and \(\vec{d}_{j}\), between a pair of sphere centers estimated from two different carrier orientations \(R_{i}\) and \(R_{j}\), need to be anti-parallel when the configured extrinsic parameters of the sensor are close or equal to the true pose. This is exploited by formulating the error for a single pair of spheres as the magnitude of the cross-product of \(\vec{d}_{i}\) and \(\vec{d}_{j}\). Thus, the norm directly depends on the angle \(\phi\) between the two vectors \(\vec{d}_{i}\) and \(\vec{d}_{j}\), which should be anti-parallel, i.e., \(\phi=\pi\). This observation leads to an error function for a single pair of spheres:  
\[E_{ij}(R)=||\vec{d}_{i}\times(\vec{d}_{j})||=||R_{i}*R*(p_{i}-q_{i})\times R_{ j}*R*(p_{j}-q_{j})||. \tag{6}\]  
Figure 4: Direction-vectors between (e.g., \(\vec{d}_{1}\) and \(\vec{d}_{3}\)) become anti-parallel if the rotation is well known. The picture shows an exemplary target arrangement using \(M=4\) spheres. The depicted vectors indicate that the platform is not yet calibrated. As can be seen in Equation (6) \(R_{i}\), \(p_{i}\), \(q_{i}\), \(R_{j}\), \(p_{j}\) and \(q_{j}\) are all measured quantities. Therefore, the error of the vector pair \(\vec{d}_{i}\) and \(\vec{d}_{j}\) only depends on the LiDAR orientation \(R\). In addition, the cross product's norm of two anti-parallel vectors becomes zero, so it works well as a minimisation objective in the first step. Thus, an overall error for the rotational part \(R\) of \(T_{R^{\prime}S}\) can be formulated as  
\[E(R)=\sum_{i=0}^{M/2}E_{ij}(R), \tag{7}\]  
where, again, \(j=i+\frac{M}{2}\) and \(M\) is the number of spheres. The orientation \(R^{*}\) that minimizes \(E(R)\) approximates the LiDAR's actual orientation:  
\[R^{*}=\underset{R}{\text{argmin}}\left[E(R)\right]. \tag{8}\]  
Afterwards, the translation is optimised separately. The sphere centers representing the same target can be used to formulate the error of a given sensor translation \(\vec{t}\). As the orientation \(R^{*}\) has been estimated previously, the translation error can be formulated as  
\[E_{ij}(\vec{t})=p_{i}^{\prime}-q_{j}^{\prime}=R_{i}*R^{*}*(p_{i}+\vec{t})-R_{ j}*R^{*}*(q_{j}+\vec{t}). \tag{9}\]  
Again, \(R_{i}\), \(p_{i}\), \(R_{i}\), and \(q_{j}\) are measured. Furthermore, note that \(R^{*}\) is assumed to be already estimated accurately. Therefore, \(\vec{t}\) is the only independent variable. As already done for the LiDAR's orientation, Equation (9) can be used to formulate a sum. This time as a least squares problem:  
\[E(\vec{t})=\sum_{i=0}^{\frac{M}{2}}E_{ij}(\vec{t})^{2},\ \ \ j=i+\frac{M}{2}. \tag{10}\]  
The actual translation with respect to the carrier's rotation center \(\vec{t}\)\({}^{*}\) is estimated as:  
\[\vec{t}\)\({}^{*}=\underset{\vec{t}}{\text{argmin}}\left[E(\vec{t})\right]. \tag{11}\]  
Both error functions have to be minimised with respect to their respective argument. In our experiments, attempts to do this via classic gradient descent or trust region methods often converged to one of many local minima for the orientation, and thus did not result in the desired global minimum. A global minimisation approach seems to be better suited. A simple grid search to determine global minima gets tractable due to the reduction of the dimensionality of the original problem, achieved by decoupling the orientation and translation of the six degrees of freedom pose. However, this still leads to cubic complexity of both objective functions, if no further optimisations are performed. A further dimension reduction is possible for the translation optimisation, since the \(z\) component of \(\vec{t}\) can not be found. Changes in \(z\) will just lift or lower all measurements equally and therefore will have no effect on the error function. Ignoring \(t_{z}\) will reduce the translation search to quadratic complexity. However, the complexity of the optimisation of the sensor orientation remains cubic.