LeGO-LOAM-SC: An Improved Simultaneous Localization and Mapping Method Fusing LeGO-LOAM and Scan Context for Underground Coalmine

Simultaneous localization and mapping (SLAM) is one of the key technologies for coal mine underground operation vehicles to build complex environment maps and positioning and to realize unmanned and autonomous operation. Many domestic and foreign scholars have studied many SLAM algorithms, but the mapping accuracy and real-time performance still need to be further improved. This paper presents a SLAM algorithm integrating scan context and Light weight and Ground-Optimized LiDAR Odometry and Mapping (LeGO-LOAM), LeGO-LOAM-SC. The algorithm uses the global descriptor extracted by scan context for loop detection, adds pose constraints to Georgia Tech Smoothing and Mapping (GTSAM) by Iterative Closest Points (ICP) for graph optimization, and constructs point cloud map and an output estimated pose of the mobile vehicle. The test with KITTI dataset 00 sequence data and the actual test in 2-storey underground parking lots are carried out. The results show that the proposed improved algorithm makes up for the drift of the point cloud map, has a higher mapping accuracy, a better real-time performance, a lower resource occupancy, a higher coincidence between trajectory estimation and real trajectory, smoother loop, and 6% reduction in CPU occupancy, the mean square errors of absolute trajectory error (ATE) and relative pose error (RPE) are reduced by 55.7% and 50.3% respectively; the translation and rotation accuracy are improved by about 5%, and the time consumption is reduced by 2~4%. Accurate map construction and low drift pose estimation can be performed.


Introduction
As an important traditional energy industry in China, the coal industry is an important part of China's national economy. Intelligent coal mines are the core technical support for the high-quality development of the coal industry, which is of great significance in improving the safety level of coal mine production and in ensuring the stable coal supply. SLAM is one of the ways to build the underground environmental map of complex coal mines and its own intelligent positioning for coal mine operation vehicles. It is one of the key technologies to realize unmanned driving and autonomous operation in a coal mine [1].
Scholars at home and abroad have carried out a large number of studies on SLAM algorithms based on vision [2][3][4][5] and LiDAR [6][7][8][9][10]. Due to advantages of intuitive mapping, high ranging accuracy, easily unaffected by the variation of illumination and view angle, and its ability to operate in all weather conditions [11], Lidar is widely used in the field of unmanned driving [12][13][14][15] and is more suitable for SLAM in Complex and Sensors 2022, 22, 520 2 of 15 changeable coal mine environments with poor light conditions. Huber and Vandapel [16] used a high-precision laser scanner to build a high-precision three-dimensional geological model of a coal mine, but this method needs post-processing of surveying data, which cannot meet the requirements of real-time mapping and positioning of the coal mine environment, and the cost is high. Ren Z. et al. [17] studied the lightweight loop detection and optimization algorithm based on rules and Generalized ICP (GICP) [18], and proposed the SLAM optimization method based on GICP 3D point cloud registration, but the positioning and mapping accuracy still needs to be improved. Considering the real-time and accuracy of positioning and mapping, there are still many problems to be solved in coal mine underground environment SLAM.
LiDAR Odometry and Mapping (LOAM) [19,20] is presently the most representative real-time 3D laser SLAM algorithm based on feature matching. It has a small amount of calculation and motion compensation, but there is no loop detection, resulting in drift error accumulating over time and poor mapping accuracy, and degradation problems in an open environment. In view of the lack of LOAM algorithm, Shan T [21] added loop detection to find loop points by combining ICP and Euclidean distance, and carried out lightweight and ground optimization processing in feature extraction, and proposed Light weight and Ground-Optimized LiDAR Odometry and Mapping (LeGO-LOAM) to achieve a similar or better accuracy under the condition of reduced computing resources. However, sometimes loop detection has errors or identification omissions. HDL-Graph-SLAM [22] integrates the optimized Normal Distributions Transform (NDT) [23] point cloud registration algorithm, and uses the method of accessing historical key frames to perform loop detection and matching on the scene scanned by the point cloud of the current frame. It has good stability, but the mapping speed is slow and the point cloud matching accuracy is not high. IMLS-SLAM [24] proposed a scan-to-model matching framework based on implicit moving least squares (IMLS) surfaces, which can provide accurate attitude estimation, but it is not real-time estimation. SuMa [25] is a motion estimation and mapping method based on surfel map. It uses projection data association to estimate the dense registration of each projection point. It is more robust to missing features or missing data and can establish a global consistent map in a large-scale environment only based on laser point cloud data with a high accuracy, but the efficiency is limited. Reference [26] proposed an optimization method of loop detection based on ground plane constraints and segmatch to realize low drift positioning and the construction of dense 3D point cloud images. Loop detection methods based on fast point feature histogram (FPFH) [27] and Gasalt3D [28] local descriptors require key point extraction and large-scale local geometric calculation, and has low loop detection efficiency. Rizzini D L [29] studied the global descriptor-based GLAROT loop detection method, but its efficiency is still low. Giseop Kim and ayoung Kim of KAIST University in Korea proposed a scan context loopback detection algorithm [30], which uses a non-histogram global descriptor to realize fast and effective search and matching of current and historical frame data. It has the characteristics of high precision, and low time-consumption and computational costs. It is an efficient and robust loopback detection method.
In view of the real-time and accuracy requirements of map construction of the coal mine underground environment, and considering the high-precision, low-cost, efficient and robust characteristics of the scan context, this paper uses a scan context algorithm to optimize the LeGO-LOAM loopback detection module, and uses an ICP algorithm to optimize the global map obtained by loop, and proposed a LeGO-LOAM-SC SLAM algorithm fusing Scan Context and LeGO-LOAM to improve the accuracy, real-time and robustness of coal mine underground map construction, and also evaluated the performance of the proposed algorithm with the KITTI data set 00 sequence data and the point cloud data collected experimentally in an underground simulation scene, so as to explore a better SLAM algorithm and to provide technical support for map construction and unmanned driving of the coal mine underground environment.

LeGO-LOAM
LeGO-LOAM is a lightweight real-time positioning and mapping algorithm based on 3D LiDAR, proposed by Shan T et al. on the basis of an LOAM algorithm in 2018. It is mainly composed of point cloud segmentation, feature extraction, LiDAR measurement, LiDAR mapping and transformation fusion, as shown in Figure 1.  Let Pt = {p1, p2, ..., pn} be the point cloud data obtained by LiDAR at time t, where pi is a point in Pt and its Euclidean distance to LiDAR is indicated by ri.
To improve the processing efficiency and the accuracy of feature extraction, through the point cloud segmentation module, the point cloud Pt is divided into different clusters and is marked as ground points or segmentation points. At the same time, three features of each point, namely, the label of the point, the row and column index in the depth map and the distance value, are obtained for subsequent modules. First, the point cloud is projected onto a depth map, and the point Pi in Pt is mapped to a pixel on the depth map. Before segmentation, the ground plane of the depth map is estimated to extract the ground features, and the points representing the ground plane are marked as ground points, which do not participate in point cloud segmentation. Then, the point cloud is divided into many clusters by an image segmentation method, and the points in the same cluster are marked as an exclusive label. The ground points are kind of exclusive clusters. When using segmented point cloud for fast and reliable feature extraction, clusters with fewer than 30 points are ignored to reduce the insignificant or unreliable features formed by small objects such as leaves in a noisy environment.
The feature extraction module extracts edge and planar features from ground points or segmentation points. The extraction process is as follows: (1) Let S be the set of continuous points in the same row in the depth map and calculate the roughness c of the point pi where, ri and rj are the Euclidean distances from points pi and pj in set S to LiDAR, respectively.
(2) Divide the depth map horizontally into several equal sub images to extract features evenly. (3) Segment different types of features according to the set threshold cth. The points with roughness value c greater than cth are segmented into edge feature points, and the points less than cth are segmented into plane feature points. The non-ground edge feature point nFe with the largest roughness c and the plane feature point nFp with the smallest roughness c in the ground or segmentation points are selected from each row Let P t = {p 1 , p 2 , . . . , p n } be the point cloud data obtained by LiDAR at time t, where p i is a point in P t and its Euclidean distance to LiDAR is indicated by r i .
To improve the processing efficiency and the accuracy of feature extraction, through the point cloud segmentation module, the point cloud P t is divided into different clusters and is marked as ground points or segmentation points. At the same time, three features of each point, namely, the label of the point, the row and column index in the depth map and the distance value, are obtained for subsequent modules. First, the point cloud is projected onto a depth map, and the point P i in P t is mapped to a pixel on the depth map. Before segmentation, the ground plane of the depth map is estimated to extract the ground features, and the points representing the ground plane are marked as ground points, which do not participate in point cloud segmentation. Then, the point cloud is divided into many clusters by an image segmentation method, and the points in the same cluster are marked as an exclusive label. The ground points are kind of exclusive clusters. When using segmented point cloud for fast and reliable feature extraction, clusters with fewer than 30 points are ignored to reduce the insignificant or unreliable features formed by small objects such as leaves in a noisy environment.
The feature extraction module extracts edge and planar features from ground points or segmentation points. The extraction process is as follows: (1) Let S be the set of continuous points in the same row in the depth map and calculate the roughness c of the point p i where, r i and r j are the Euclidean distances from points p i and p j in set S to LiDAR, respectively. row of the sub image to obtain the edge feature point set F e and the plane feature point set F p in all sub images. Then, the non-ground edge feature nF e with the largest roughness c and the ground plane feature nF p with the smallest roughness c are selected from each row of the sub image to obtain the edge feature set Fe and the plane feature set F p in all sub images. Obviously, F e ⊂ F e , F p ⊂ F p . The LiDAR odometry module estimates the motion of the robot in two consecutive frames, and uses the features extracted from the feature extraction module to find the correlation transformation of the robot position in the continuous scanning frame. During the estimation process, the label matching is used to narrow the matching range and to improve the accuracy, and the two-step Levenberg-Marquardt (L-M) optimization method is used to find the conversion relationship between two consecutive frames. The first step is to use the ground plane features Fp to obtain [t z , θ roll , θ pitch ]; the second step is to match the edge features extracted from the segmented point cloud to obtain the transformation [t x , t y , θ yaw ], and then the 6-dimensional transformation between two consecutive scans is obtained finally by the fusion [t z , θ roll , θ pitch ] and [t x , t y , θ yaw ], which reduces the computational time by approximately 35% with a similar accuracy.
The LiDAR mapping module matches the features in the feature set {F e t , F p t } with the surrounding point cloud map Q −t−1 to further refine the attitude transformation, then uses the final transformed pose obtained by L-M optimization to add the spatial constraints between the new node of the point cloud map and the historically selected node, and adds new constraints through loop detection, then sends the pose map to GTSAM for graph optimization and updates the estimated pose by sensor. The transforming module fuses the pose estimation results from the LiDAR odometry module and the LiDAR mapping module, and outputs the final pose estimation.
The loop detection module of LeGO-LOAM uses a k-dimensional tree (KD tree) model to find the historical pose similar to the current pose and its nearby point clouds based on Euclidean distance, uses ICP to calculate its matching degree and estimates the pose, and uses the robot pose of the most similar historical frame to constrain the current robot pose estimation and updates the point cloud map to obtain the global consistency map. The loop algorithm has a large amount of calculation and a low detection efficiency. To give consideration to real-time and accuracy, a lower frequency loop detection is adopted, and there is still a large cumulative error in the mapping of long-range and large scenes.

Scan Context
The scan context algorithm, proposed by Giseop Kim and Ayoung Kim of KAIST University, uses global descriptors of non-histograms to enable a faster and efficient search of "context" (current/previous data). Scan context transforms 3D point clouds into 2.5D by dimensionality reduction, and uses a search algorithm to match the point cloud data of the current frame and the historical frame to realize loopback detection. Figure 2 shows the structure diagram of scan context global descriptor. For a frame of point cloud data scanned by LiDAR, the top view is obtained from the top of 3D point cloud (as shown in Figure 2a), and the polar coordinate system is established with the LiDAR position as its origin. Twenty rings are divided outward from origin, and each ring is divided into 60 equal parts, namely 1200 grids, taking the maximum height (Z value) of the points in each grid as the grid value. Then the top view is expanded radially into 20 rows and 60 columns of rectangular images (Figure 2b), the average values of each row and each column are calculated respectively, and the two vectors-ring key and sector are obtained as global descriptors. The flow of scan context loopback detection algorithm is shown in Figure 3. The rectangular image scan context is constructed by using the point cloud data scanned at one time, the KD tree is constructed by using the ring key vector, the nearest neighbor search is performed, multiple similar frames that may loopback with the current frame and their ring key translation values are found, the similarity score is calculated, and the similar frames with high scores are screened out; then, the minimum offset and the similarity score is calculated sector by sector, the frame with the highest similarity score is selected as the loopback frame, and the pose relationship between the current frame and the loopback frame is solved, and the loop detection is realized.

Improved Algorithm Principle
To overcome the shortcomings of the LeGO-LOAM loop detection algorithm, the scan context algorithm is used to replace the ICP loop detection method based on the Euclidean distance in the LeGO-LOAM algorithm, and the pose constraints are calculated by ICP and added to GTSAM for global pose optimization to build a global map, named as the LeGO-LOAM-SC algorithm. This algorithm reduces the dimension of the point cloud by integrating the scan context loopback algorithm, with a small amount of computation and a fast loopback detection, to improve the mapping accuracy and efficiency. The algorithm block diagram is shown in Figure 4. The flow of scan context loopback detection algorithm is shown in Figure 3. The rectangular image scan context is constructed by using the point cloud data scanned at one time, the KD tree is constructed by using the ring key vector, the nearest neighbor search is performed, multiple similar frames that may loopback with the current frame and their ring key translation values are found, the similarity score is calculated, and the similar frames with high scores are screened out; then, the minimum offset and the similarity score is calculated sector by sector, the frame with the highest similarity score is selected as the loopback frame, and the pose relationship between the current frame and the loopback frame is solved, and the loop detection is realized. The flow of scan context loopback detection algorithm is shown in Figure 3. The rectangular image scan context is constructed by using the point cloud data scanned at one time, the KD tree is constructed by using the ring key vector, the nearest neighbor search is performed, multiple similar frames that may loopback with the current frame and their ring key translation values are found, the similarity score is calculated, and the similar frames with high scores are screened out; then, the minimum offset and the similarity score is calculated sector by sector, the frame with the highest similarity score is selected as the loopback frame, and the pose relationship between the current frame and the loopback frame is solved, and the loop detection is realized.

Improved Algorithm Principle
To overcome the shortcomings of the LeGO-LOAM loop detection algorithm, the scan context algorithm is used to replace the ICP loop detection method based on the Euclidean distance in the LeGO-LOAM algorithm, and the pose constraints are calculated by ICP and added to GTSAM for global pose optimization to build a global map, named as the LeGO-LOAM-SC algorithm. This algorithm reduces the dimension of the point cloud by integrating the scan context loopback algorithm, with a small amount of computation and a fast loopback detection, to improve the mapping accuracy and efficiency. The algorithm block diagram is shown in Figure 4.

Improved Algorithm Principle
To overcome the shortcomings of the LeGO-LOAM loop detection algorithm, the scan context algorithm is used to replace the ICP loop detection method based on the Euclidean distance in the LeGO-LOAM algorithm, and the pose constraints are calculated by ICP and added to GTSAM for global pose optimization to build a global map, named as the LeGO-LOAM-SC algorithm. This algorithm reduces the dimension of the point cloud by integrating the scan context loopback algorithm, with a small amount of computation and a fast loopback detection, to improve the mapping accuracy and efficiency. The algorithm block diagram is shown in Figure 4.  (a) Encode point cloud data The 3D point cloud is divided into Ns axial sector and Nr radial ring bin in LiDAR coordinates at equal intervals, as shown in Figure 2a. If the maximum sensing range of the LiDAR is Lmax, the radial gap between the rings is Lmax/Nr, and the central angle of the sector is equal to 2π/Ns. Generally, Ns and Nr are set at 60 and 20, respectively. Set Pij be a point set that belongs to the overlapping bins of the ith ring and jth sector, and take the maximum height of the point cloud p in the point set Pij as the value of the the radial ring bin, then the bin coding function is: where z( ) is a function of the z-coordinate value of point cloud p, and the empty bin is assigned a zero value. Then the scan context I is finally expressed as the Nr × Ns matrix, as follows: (b) Generate a scan context The point cloud and candidate point cloud to be queried are retrieved, the distance between two column vectors at and of the same index by cosine distance is calculate, and the distance function is normalized by dividing the (a) Encode point cloud data The 3D point cloud is divided into N s axial sector and N r radial ring bin in LiDAR coordinates at equal intervals, as shown in Figure 2a. If the maximum sensing range of the LiDAR is L max , the radial gap between the rings is L max /N r , and the central angle of the sector is equal to 2π/N s . Generally, N s and N r are set at 60 and 20, respectively. Set P ij be a point set that belongs to the overlapping bins of the i th ring and j th sector, and take the maximum height of the point cloud p in the point set P ij as the value of the the radial ring bin, then the bin coding function is: where z( ) is a function of the z-coordinate value of point cloud p, and the empty bin is assigned a zero value. Then the scan context I is finally expressed as the N r × N s matrix, as follows: (b) Generate a scan context The point cloud and candidate point cloud to be queried are retrieved, the distance between two column vectors at c q j and c c j of the same index by cosine distance is calculate, and the distance function is normalized by dividing the sum of the distances between columns in the same index by the total number of columns N s .
where, I q and I c are the scan context obtained from the point cloud to be queried and the candidate point cloud, respectively. Get the vector K. The displacement of LiDAR sensor coordinates relative to the global coordinates will change the column order. Use all possible column displacement scanning contexts to calculate the distance and find the minimum distance. Set I c shift n columns to get matrix I c n , then the column movement number n and the corresponding distance of the best alignment can be obtained according to the minimum distance, Each row r of scan context is encoded into a real value by the ring coding function ψ, and the ring key is represented by the N r dimensional vector K, whose element is taken from the nearest ring to the farthest ring from the LiDAR. k = (ψ(r 1 ), · · · , ψ(r N r )), ψ : r i → R (c) Confirm the index of the loopback frame. Vector K is used to construct the key of KD tree. The queried ring key is used to find similar ring keys and their corresponding scan indexes. Use distance D(I q , I c ) to compare the candidate scan context with the scan context to be queried, where c is a set of candidate indexes extracted from KD tree, τ is the given threshold, and c * is the index where it is determined to be looped.
(6) Combine m keyframes near c * into a local map, convert the current key frame to the world coordinate system, register with the local map and calculate the registration score by the ICP method. If the registration score is less than the given threshold, the loopback is considered successful, and the pose constraints between the loopback frame and the current frame is obtained. The constraints are added to GTSAM for map optimization and to update the point cloud map. The transform fusion module fuses the position and position estimation results from the LiDAR range meter module and the LiDAR mapping module, and outputs the final position and the position estimation.

The KITTI Dataset Test
The test software environment is Ubuntu 18.04, ROS melodic, PCL 1.10, GTSAM 4.0.3, Python 2.7.17, and the hardware configuration is 8 GB of RAM, Intel Core i3-4100M, and NVIDIA GeForce 940M. The test data set adopts KITTI data set 00 sequence.  Figure 6 is a partial enlarged view of the red box part of Figure 5. It can be seen that when mapping by LeGO-LOAM algorithm, the loopback effect is poor and there is a phenomenon of point cloud map drift, and the initial map and loopback map

Track Comparison
Evo is a Python package for the evaluation of odometry and SLAM, and provides executables and a small library for handling, evaluating and comparing the trajectory output of odometry and SLAM algorithms [31,32]. It supports many trajectory formats: 'TUM' trajectory files, 'KITTI' pose files, 'EuRoC MAV' (.csv groundtruth and TUM trajectory file), ROS and ROS2 bagfile, etc. evo has several advantages over other public benchmarking tools: common tools for different formats; algorithmic options for association, alignment, scale adjustment for monocular SLAM etc.; flexible options for output, plotting or export (e.g., LaTeX plots or Excel tables); a powerful, configurable CLI that can cover many use cases; modular core and tools libraries for custom extensions; faster than other established Python-based tools. The motion tracks were extracted using the evo tool, as shown in Figure 7. As can be seen from the figure that the motion trace generated by

Track Comparison
Evo is a Python package for the evaluation of odometry and SLAM, and provides executables and a small library for handling, evaluating and comparing the trajectory output of odometry and SLAM algorithms [31,32]. It supports many trajectory formats: 'TUM' trajectory files, 'KITTI' pose files, 'EuRoC MAV' (.csv groundtruth and TUM trajectory file), ROS and ROS2 bagfile, etc. evo has several advantages over other public benchmarking tools: common tools for different formats; algorithmic options for association, alignment, scale adjustment for monocular SLAM etc.; flexible options for output, plotting or export (e.g., LaTeX plots or Excel tables); a powerful, configurable CLI that can cover many use cases; modular core and tools libraries for custom extensions; faster than other established Python-based tools. The motion tracks were extracted using the evo tool, as shown in Figure 7. As can be seen from the figure that the motion trace generated by

Track Comparison
Evo is a Python package for the evaluation of odometry and SLAM, and provides executables and a small library for handling, evaluating and comparing the trajectory output of odometry and SLAM algorithms [31,32]. It supports many trajectory formats: 'TUM' trajectory files, 'KITTI' pose files, 'EuRoC MAV' (.csv groundtruth and TUM trajectory file), ROS and ROS2 bagfile, etc. evo has several advantages over other public benchmarking tools: common tools for different formats; algorithmic options for association, alignment, scale adjustment for monocular SLAM etc.; flexible options for output, plotting or export (e.g., LaTeX plots or Excel tables); a powerful, configurable CLI that can cover many use cases; modular core and tools libraries for custom extensions; faster than other established Python-based tools. The motion tracks were extracted using the evo tool, as shown in Figure 7. As can be seen from the figure that the motion trace generated by LeGO-LOAM-SC had more coincidence with the real trace. At a sharp turning angle (circled in red in the Figure 7), LeGO-LOAM failed to smooth the loop, while the loop of LeGO-LOAM-SC algorithm is smoother and the effect is better.
LeGO-LOAM-SC had more coincidence with the real trace. At a sharp turning angle (circled in red in the Figure 7), LeGO-LOAM failed to smooth the loop, while the loop of LeGO-LOAM-SC algorithm is smoother and the effect is better.

Estimate Trajectory Length Deviation and Time
The evo tool is used to analyze the track length and its deviation, CPU occupancy and time consumption obtained by LeGO-LOAM and LeGO-LOAM-SC, as shown in Table 1. It can be seen that compared with the LeGO-LOAM algorithm, the LeGO-LOAM-SC optimizes the loop detection link and the actual track length is closer to the real track length, the deviation is reduced by 47.8%, the time consumption is reduced by 2%, and the CPU occupancy is reduced by 6%, indicating that the improved algorithm has a higher mapping accuracy, a better real-time performance and a lower resource occupancy.  Table 2 shows the maximum error, minimum error and mean square error of ATE and RPE. It can be seen that the maximum error, minimum error and mean square error of ATE by LeGO-LOAM-SC algorithm are reduced by 49.4%, 79.1% and 55.7% respectively, and that the maximum error, minimum error and mean square error of RPE are reduced by 62.9%, 25.0% and 50.3% respectively, which shows that the LeGO-LOAM-SC algorithm has a better accuracy in long-distance scenes, and is suitable for the mapping of large-scale scenic cloud maps with a higher accuracy.

Estimate Trajectory Length Deviation and Time
The evo tool is used to analyze the track length and its deviation, CPU occupancy and time consumption obtained by LeGO-LOAM and LeGO-LOAM-SC, as shown in Table 1. It can be seen that compared with the LeGO-LOAM algorithm, the LeGO-LOAM-SC optimizes the loop detection link and the actual track length is closer to the real track length, the deviation is reduced by 47.8%, the time consumption is reduced by 2%, and the CPU occupancy is reduced by 6%, indicating that the improved algorithm has a higher mapping accuracy, a better real-time performance and a lower resource occupancy.  Table 2 shows the maximum error, minimum error and mean square error of ATE and RPE. It can be seen that the maximum error, minimum error and mean square error of ATE by LeGO-LOAM-SC algorithm are reduced by 49.4%, 79.1% and 55.7% respectively, and that the maximum error, minimum error and mean square error of RPE are reduced by 62.9%, 25.0% and 50.3% respectively, which shows that the LeGO-LOAM-SC algorithm has a better accuracy in long-distance scenes, and is suitable for the mapping of large-scale scenic cloud maps with a higher accuracy.

Experimental Verification
A tracked car equipped with 16-line lidar is used to simulate the mobile operation vehicle in a coal mine. The equipped LiDAR is RS-LiDAR-16, with a measurement range of 150 m, an accuracy of ±2 cm, a vertical perspective of 30 • , a horizontal perspective of 360 • , a vertical angle resolution of 2 • , a horizontal angular resolution of 0.2 • , and a rotation rate of 10 Hz. The testing was carried out at a large underground parking lot with two floors, as shown in Figure 8. The parking lot has a large scene and rich environmental characteristics. There are bumpy roads such as deceleration belts and sewers, which can test the positioning and mapping accuracy and robustness of the algorithm.

Experimental Verification
A tracked car equipped with 16-line lidar is used to simulate the mobile operation vehicle in a coal mine. The equipped LiDAR is RS-LiDAR-16, with a measurement range of 150 m, an accuracy of ±2cm, a vertical perspective of 30°, a horizontal perspective of 360°, a vertical angle resolution of 2°, a horizontal angular resolution of 0.2°, and a rotation rate of 10 Hz. The testing was carried out at a large underground parking lot with two floors, as shown in Figure 8. The parking lot has a large scene and rich environmental characteristics. There are bumpy roads such as deceleration belts and sewers, which can test the positioning and mapping accuracy and robustness of the algorithm. Feature extraction is the key module of point cloud map construction. For a frame of point cloud data obtained by RS-LiDAR-16 LiDAR, the feature extraction was performed using LeGO-LOAM-SC, and the results of feature extraction at every stage were shown in Figure 9. In Figure 9, (a) shows the original point cloud data collected by LiDAR; and (b) shows the results after point cloud segmentation. The points marked in red represent ground points while the points marked in others represent segmentation points, and the points that cannot be clustered have been removed; (c) shows the visualization diagram of the edge feature points nFe (in blue) and the plane feature points nFp (in orange) extracted Feature extraction is the key module of point cloud map construction. For a frame of point cloud data obtained by RS-LiDAR-16 LiDAR, the feature extraction was performed using LeGO-LOAM-SC, and the results of feature extraction at every stage were shown in Figure 9.

Experimental Verification
A tracked car equipped with 16-line lidar is used to simulate the mobile operation vehicle in a coal mine. The equipped LiDAR is RS-LiDAR-16, with a measurement range of 150 m, an accuracy of ±2cm, a vertical perspective of 30°, a horizontal perspective of 360°, a vertical angle resolution of 2°, a horizontal angular resolution of 0.2°, and a rotation rate of 10 Hz. The testing was carried out at a large underground parking lot with two floors, as shown in Figure 8. The parking lot has a large scene and rich environmental characteristics. There are bumpy roads such as deceleration belts and sewers, which can test the positioning and mapping accuracy and robustness of the algorithm. Feature extraction is the key module of point cloud map construction. For a frame of point cloud data obtained by RS-LiDAR-16 LiDAR, the feature extraction was performed using LeGO-LOAM-SC, and the results of feature extraction at every stage were shown in Figure 9. In Figure 9, (a) shows the original point cloud data collected by LiDAR; and (b) shows the results after point cloud segmentation. The points marked in red represent ground points while the points marked in others represent segmentation points, and the points that cannot be clustered have been removed; (c) shows the visualization diagram of the edge feature points nFe (in blue) and the plane feature points nFp (in orange) extracted In Figure 9, (a) shows the original point cloud data collected by LiDAR; and (b) shows the results after point cloud segmentation. The points marked in red represent ground points while the points marked in others represent segmentation points, and the points that cannot be clustered have been removed; (c) shows the visualization diagram of the edge feature points nF e (in blue) and the plane feature points nF p (in orange) extracted from ground points or segmentation points according to the value of roughness c. The edge feature nF e with the largest roughness c, and the non-ground and plane feature nF p with the smallest roughness c and the ground are extracted from each row of the subgraph to obtain the edge feature set F e and the plane feature set F p in all subgraphs, shown as (d).
The loopback frames at the entrance of the parking lot are detected respectively by using the traditional LeGO-LOAM and the LeGO-LOAM-SC proposed in this paper; the visualization results are shown in Figure 10. Among them, (a) is the result of loop detection and visual processing by traditional LeGO-LOAM, and (b) is the visual diagram of loop detection by improved LeGO-LOAM-SC. The results show that scan context is used as loopback detection to make the point cloud coincidence degree of the current frame and the detected historical loopback frame higher, indicating that the correction effect of historical pose and map is better and has a better loopback effect. from ground points or segmentation points according to the value of roughness c. The edge feature nFe with the largest roughness c, and the non-ground and plane feature nFp with the smallest roughness c and the ground are extracted from each row of the subgraph to obtain the edge feature set Fe and the plane feature set Fp in all subgraphs, shown as (d).
The loopback frames at the entrance of the parking lot are detected respectively by using the traditional LeGO-LOAM and the LeGO-LOAM-SC proposed in this paper; the visualization results are shown in Figure 10. Among them, (a) is the result of loop detection and visual processing by traditional LeGO-LOAM, and (b) is the visual diagram of loop detection by improved LeGO-LOAM-SC. The results show that scan context is used as loopback detection to make the point cloud coincidence degree of the current frame and the detected historical loopback frame higher, indicating that the correction effect of historical pose and map is better and has a better loopback effect.

Mapping Effect
For the point cloud data for the two scenarios obtained from the experiment, the maps were constructed respectively using three algorithms-LOAM, LeGO-LOAM and LeGO-LOAM-SC-as shown in Figures 11 and 12.

Mapping Effect
For the point cloud data for the two scenarios obtained from the experiment, the maps were constructed respectively using three algorithms-LOAM, LeGO-LOAM and LeGO-LOAM-SC-as shown in Figures 11 and 12.

Mapping Effect
For the point cloud data for the two scenarios obtained from the experiment, the maps were constructed respectively using three algorithms-LOAM, LeGO-LOAM and LeGO-LOAM-SC-as shown in Figures 11 and 12.   It can be seen from Figure 11 and Figure 12 that in the mapping test of the two scenarios, the loam algorithm failed to build a complete map; compared with the LeGO-LOAM algorithm, the map constructed by the LeGO-LOAM-SC algorithm is clearer and the mapping effect is better. Figure 13 is the partial enlarged map of the Figure 11 (the part in the red box). It shows that the LeGO-LOAM loopback effect is poor with point cloud map drift and misalignment at the loopback location (Figure 13a), and that the LeGO-LOAM-SC reduces the map drift and coincides at the loop, and the loopback effect is better (Figure 13b).

Trajectory Contrast
The motion trajectories were estimated respectively by three algorithms-LOAM, LeGO-LOAM and LeGO-LOAM-SC-and were extracted using an evo tool, as shown in Figure 14. It can be seen from Figure 14 that LOAM cannot trace the trajectory, and that at the place with the large turning angle (circled in red), the LeGO-LOAM trajectory drift is large, while the LeGO-LOAM-SC algorithm trajectory is smoother, and its overall positioning effect is better. It can be seen from Figures 11 and 12 that in the mapping test of the two scenarios, the loam algorithm failed to build a complete map; compared with the LeGO-LOAM algorithm, the map constructed by the LeGO-LOAM-SC algorithm is clearer and the mapping effect is better. Figure 13 is the partial enlarged map of the Figure 11 (the part in the red box). It shows that the LeGO-LOAM loopback effect is poor with point cloud map drift and misalignment at the loopback location (Figure 13a), and that the LeGO-LOAM-SC reduces the map drift and coincides at the loop, and the loopback effect is better (Figure 13b).  It can be seen from Figure 11 and Figure 12 that in the mapping test of the two scenarios, the loam algorithm failed to build a complete map; compared with the LeGO-LOAM algorithm, the map constructed by the LeGO-LOAM-SC algorithm is clearer and the mapping effect is better. Figure 13 is the partial enlarged map of the Figure 11 (the part in the red box). It shows that the LeGO-LOAM loopback effect is poor with point cloud map drift and misalignment at the loopback location (Figure 13a), and that the LeGO-LOAM-SC reduces the map drift and coincides at the loop, and the loopback effect is better (Figure 13b).

Trajectory Contrast
The motion trajectories were estimated respectively by three algorithms-LOAM, LeGO-LOAM and LeGO-LOAM-SC-and were extracted using an evo tool, as shown in Figure 14. It can be seen from Figure 14 that LOAM cannot trace the trajectory, and that at the place with the large turning angle (circled in red), the LeGO-LOAM trajectory drift is large, while the LeGO-LOAM-SC algorithm trajectory is smoother, and its overall positioning effect is better.

Trajectory Contrast
The motion trajectories were estimated respectively by three algorithms-LOAM, LeGO-LOAM and LeGO-LOAM-SC-and were extracted using an evo tool, as shown in Figure 14. It can be seen from Figure 14 that LOAM cannot trace the trajectory, and that at the place with the large turning angle (circled in red), the LeGO-LOAM trajectory drift is large, while the LeGO-LOAM-SC algorithm trajectory is smoother, and its overall positioning effect is better. Table 3 shows the relative position estimation error when returning to the starting position. It can be seen from the table that the translation and rotation deviations of the three SLAM algorithms are large, indicating that it is difficult to obtain accurate positioning results only by 3D LiDAR. In comparison, the LeGO-LOAM-SC proposed in this paper can still achieve more accurate positioning and mapping results when only using 3D LiDAR information, and the translation and rotation accuracy of the map is improved by about 5%.  Table 3 shows the relative position estimation error when returning to the starting position. It can be seen from the table that the translation and rotation deviations of the three SLAM algorithms are large, indicating that it is difficult to obtain accurate positioning results only by 3D LiDAR. In comparison, the LeGO-LOAM-SC proposed in this paper can still achieve more accurate positioning and mapping results when only using 3D Li-DAR information, and the translation and rotation accuracy of the map is improved by about 5%.

Track Length and Time Consuming
The trajectory length and time-consuming estimated by LeGO-LOAM and LeGO-LOAM-SC were analyzed using the evo tool, as shown in Table 4. LeGO-LOAM-SC has a better real-time performance and reduces time consumption by about 4%.

Track Length and Time Consuming
The trajectory length and time-consuming estimated by LeGO-LOAM and LeGO-LOAM-SC were analyzed using the evo tool, as shown in Table 4. LeGO-LOAM-SC has a better real-time performance and reduces time consumption by about 4%.

Conclusions
(1) An improved SLAM algorithm fusing LeGO-LOAM with scan context, LeGO-LOAM-SC algorithm, is proposed. The data set test and experimental test results show that the improved algorithm has a higher mapping accuracy and a lower time-consumption and resource occupancy. (2) The KITTI dataset 00 sequence is used to test the mapping and pose estimation performance of LeGO-LOAM and LeGO-LOAM-SC. The results show that LeGO-LOAM-SC improves the drift of the point cloud map, the coincidence degree between motion trajectory estimation and real trajectory is higher, the loop is smoother, the estimated trajectory length is closer to the real trajectory length, and the time consumption is reduced by 2%. The CPU occupancy is reduced by 6%, the maximum error, minimum error and mean square error of ATE are reduced by 49.4%, 79.1% and 55.7% respectively, and the maximum error, minimum error and mean square error of RPE are reduced by 62.9%, 25.0% and 50.3%, respectively. (3) An experimental test found that the map constructed by LeGO-LOAM-SC algorithm is clearer, the loopback effect is better, the generated estimation trajectory is smoother, the overall positioning is more accurate, the translation and rotation accuracy is improved by about 5%, and the time consumption is reduced by about 4%.