# Integrating a LiDAR Sensor in a UAV Platform to Obtain a Georeferenced Point Cloud
## 2 Materials and Methods
### Data Collection and Processing Procedure Development
#### 2.2.4 Generation of Georeferenced Point Cloud
\begin{table}
\begin{tabular}{c c} \hline \hline
**Static Variables** & **Dynamic Variables** \\ \hline \(R_{cal}\) & \(p_{(t)}^{\mathcal{S}}\) \\ \(R_{b}^{b}\) & \(R_{b}^{\mathcal{S}}(t)\) \\ \(a_{cal}\) & \(p_{(t)}^{\mathcal{S}}\) \\ \(l^{b}\) & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Static and dynamic variables of the georeferencing equation. Figure 9 denotes the raw point cloud PC without applying the rotation matrix. This point cloud contains RP and is in the LiDAR reference system. Figure 10 denotes the raw point cloud RP expressed in the reference system of the UAV. This cloud results from multiplying the \(R_{\text{s}}^{b}\) rotation matrix and adding the \(i^{b}\) displacement to each point cloud element in the LiDAR reference system. With the data in the same reference system, i.e., when the rotation matrix has been resolved, the point cloud calibration process can begin. Figure 11 shows the initial parameters, alignment parameters, and calibration equation used for point cloud calibration. The parameters are detailed below. Figure 10: Non-calibrated point cloud RP in the UAV reference system (\(\text{x}^{\prime},\text{y}^{\prime},\text{z}^{\prime}\)). Figure 9: Non-calibrated point cloud from the LiDAR reference system (x, y, z). Initial and alignment parameters:  
* R_bs2 bi: Rotation Matrix. Converts LiDAR data from LiDAR-centric reference system to the UAV-centric reference system, IMU. * A_bi: Lever Coordinates. Data from the total station. * Alignment Parameters:
* R_al and a_al: Data provided by the CloudCompare software after overlapping the point cloud from the UAV and artificial point cloud from the total station. The artificial point cloud is created with Python based on the measurement from the IMU center of the UAV to the ground. The area generated is proportional to the ground area generated by the LiDAR. This process is executed only once. Table 4 lists the equivalences between the calibration equation and the parameters from the georeferencing equation for the point cloud calibration process. Based on static values, the point cloud covers the entire route, including UAV take-off and landing. The pcap files for each segment are stored in their corresponding folders. There can be multiple pcap files per segment. The program developed for the point cloud georeferencing process uses the following Python packages: Panda, NumPy, PyMap3D and Lapsy. The loaded parameters are provided in Figure 11, which includes initial and alignment parameters. Figure 12 denotes the calibration results from the point cloud PC calibrated using static variables. The folder path is where the corresponding pcap files for each segment are located. The dynamic values of the georeferencing equation are r_bi2 enu and x_gps_enu. R_bi2 enu provides IMU orientation, and x_gps_enu provides GPS positions. Therefore, both values have to be interpolated by the data differences exhibited between the IMU and the GPS over a period of time. \begin{table}
\begin{tabular}{c c} \hline \hline
**Calibration Equation** & **Georeferencing Equation** \\ \hline R\_al & \(R_{cal}\) \\ R\_bs2 bi & \(R_{b}^{b}\) \\ R\_bs & \(p_{(t)}^{s}\) \\ a\_al & \(a_{cal}\) \\ a\_bi & \(l^{b}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Parameter equivalence for the point cloud calibration process. Figure 11: Parameters and calibration equation. Algorithm 1 denotes the development of the georeferenced point cloud for each path. ```
Input: r_s: point cloud matrix within the s-frame, t_s: vector indicating the time associated with each r_s point. euler_bi: Euler angle value matrix (b-frame \(\rightarrow\) i-frame), t_euler: vector indicating the time associated with each euler_bi point. p_eun: UAV position matrix within the i-frame (ENU), t_eun: vector indicating the time associated with each p_eun point. Output: r_utm: matrix containing the values of the georeferenced point cloud. Obtain the time intervals corresponding to the desired path. For each of the r_s points: Multiply r_s(i) by the calibration parameters and obtain r_b(i).