*2.5. Loop Closure and Global Optimization*

The place recognition of loop closure is similar to the global map initialization, which depends on the feature point matching provided by DBoW2, and the initial matching through RANSAC and the PnP algorithm. Different from the global map initialization, considering the long-term drift of single-platform SLAM, a finer relative position transition is required. As above, we suppose that *KF<sup>c</sup>* of *Agentc* and *KF<sup>m</sup>* of *KF<sup>m</sup>* have complete initial matching and *Tcm* = *R t* 0 1 ∈ *SE*(3). All converted map points contained within the common-view frame of *KFm*, and those found matching to the key points in *KFc*. After the above intra-agent measurements have been completed, we need to adjust the map information according to the new closed-loop and fuse all the positioning information from each agent to perform global optimization. The details are as follows.

#### 2.5.1. Refinement of Transformation Matrix

*Tcm* is used to convert all map points contained within the common-view keyframe of *KFm*, and matching map points are located in the feature points of *KFc*. To obtain as many matches as possible, the map points are found that matches *KF<sup>c</sup>* in *KF<sup>m</sup>* and all of its keyframes at the same time. The nonlinear optimization of *T*∗ *cm* = *sR t* 0 1 ∈ *sim*(3) is carried out by using all the map point matching relationships found (the initial value of s is 1), and the goal function is the bidirectional reprojection error

#### 2.5.2. Pose Graph Optimization

After obtaining the optimized transformation matrix *T*∗ *cm*, the redundant map points need to be eliminated in the above matching process for each pair of matching map points describing the same feature point. Then propagation of the corrections must be disseminated to the rest of the map through pose graph optimization. To eliminate duplicate points, for each pair of matches the points from *Agentc* are removed, and the points from *Agentm* inherit all the observations of the removed points. By adding edges to the covisibility and essential graphs, the observability is propagating between the common-view frames of *KF<sup>m</sup>* and *KFm*.

As it has sufficient computing power on the server and is not sensitive to the time cost, global BA optimization can be directly carried out on the adjusted visibility and essential graphs.
