# A Distributed Indoor Mapping Method Based on Control-Network-Aided SLAM: Scheme and Analysis
## 2 Method
### Control-Network-Aided SLAM Back-End Optimization  
The scan-to-map matching strategy adopted by the front end can reduce the accumulation of positioning errors and mapping errors to a certain extent. However, as the mapping area expands, its positioning accuracy and mapping accuracy will gradually decrease. To further solve this problem, back-end optimization is performed by using the relative constraint information between discontinuous frames, which is called loop closure, to suppress the accumulation of errors. Submap-based back-end optimization is applied in this scheme. It selects some scans in one submap to match the other submaps by scan-to-map matching to obtain the relative pose between the submaps, which is the most time-consuming process. If we find a good match between submaps, the corresponding relative constraint is added to the back-end optimization problem to eliminate the cumulative error. Back-end optimization can also be expressed as a nonlinear least square problem that can be written as  
\[\underset{\{M\}_{m},\{S\}_{n}}{\text{argmin}}\ \ \frac{1}{2}\sum_{ij}\rho(E^{2}( \xi_{i}^{m},\xi_{j}^{S};\sum_{ij^{\prime}}\xi_{ij})) \tag{8}\]  
in which the submap poses \(\{M\}_{m}=\xi_{1}^{M}\), \(\xi_{2}^{M}\cdots\xi_{m}^{M}\) and the scan poses \(\{S\}_{n}=\xi_{1}^{S}\), \(\xi_{2}^{S}\cdots\xi_{n}^{S}\) in the world coordinate system are optimized by relative constraints; \(\xi_{ij}\) indicates the relative pose relationship between submap \(i\) and LiDAR scan \(j\); and \(\sum_{ij}\) represents the covariance matrix. The residual E is calculated as  
\[E^{2}(\xi_{i}^{m},\xi_{j}^{S};\sum_{ij^{\prime}}\xi_{ij})=e(\xi_{i}^{m},\xi_{ j}^{S};\xi_{ij})=\sum_{ij}^{-1}e(\xi_{i}^{m},\xi_{j}^{S};\xi_{ij}) \tag{9}\]  
\[e(\xi_{i}^{m},\xi_{j}^{S};\xi_{ij})=\xi_{ij}-\left(\begin{array}{c}R_{\xi_ {i}}^{-1}(\xi_{i}^{m}-t_{\xi_{j}^{S}})\\ \xi_{i;\rho}^{m}-\xi_{j;\rho}^{S}\end{array}\right) \tag{10}\]  
and \(\rho\) in (8) is a loss function to reduce the effect of outliers since a wrong constraint might be added to the back-end optimization problem during the process of loop closure detection.  
The absolute coordinate information of the control network can be treated as position constraint information to the submap too, which needs to be considered in the process of back-end optimization. Firstly, a reasonable control network is laid out according to the actual situation of the survey area, and the control network is measured using a total station to establish an absolute coordinate system. During the data acquisition process, the LiDAR scanning center can be aligned with a control point on the motion path. At the same time, the aligned scanning frame data are marked with a special number by the data collection software. The residual of such constraints can be computed as  
\[e(\xi_{marked}^{CNC},\xi_{marked}^{Sim},\xi_{CNC/Scan})=t_{\xi_{marked}^{CNC}}-R _{\xi_{CNC/Scan}}t_{\xi_{marked}^{Sim}} \tag{11}\]  
where \(\xi_{marked}^{CNC}\cdot\xi_{marked}^{Sim}\) are the pose of the marked scan frame in the absolute control network coordinate system and in the submap coordinate system of SLAM, respectively; \(\xi_{CNC/Scan}\) describes the transformation relationship between the absolute control network coordinate system and the submap coordinate system of SLAM.