The application of intelligent equipment and technologies such as robots and unmanned vehicles is an important part of the construction of intelligent mines, and has become China’s national coal energy development strategy and the consensus of the coal industry. Environment perception and instant positioning is one of the key technologies destined to realize unmanned and autonomous navigation in underground coal mines, and simultaneous location and mapping (SLAM) is an effective method of deploying this key technology. The underground space of a coal mine is long and narrow, the environment is complex and changeable, the structure is complex and irregular, and the lighting is poor. This is a typical unstructured environment, which poses a great challenge to SLAM. This paper summarizes the current research status of underground coal mine map construction based on visual SLAM and Lidar SLAM, and analyzes the defects of the LeGO-LOAM algorithm, such as loopback detection errors or omissions. We use SegMatch to improve the loopback detection module of LeGO-LOAM, use the iterative closest point (ICP) algorithm to optimize the global map, then propose an improved SLAM algorithm, namely LeGO-LOAM-SM, and describe its principle and implementation. The performance of the LeGO-LOAM-SM was also tested using the KITTI dataset 00 sequence and SLAM experimental data collected in two coal mine underground simulation scenarios, and the performance indexes such as the map construction effect, trajectory overlap and length deviation, absolute trajectory error (ATE), and relative pose error (RPE) were analyzed. The results show that the map constructed by LeGO-LOAM-SM is clearer, has a better loopback effect, the estimated trajectory is smoother and more accurate, and the translation and rotation accuracy is improved by approximately 5%. This can construct more accurate point cloud map and low drift position estimation, which verifies the effectiveness and accuracy of the improved algorithm. Finally, to satisfy the navigation requirements, the construction method of a two-dimensional occupancy grid map was studied, and the underground coal mine simulation environment test was carried out. The results show that the constructed raster map can effectively filter out outlier noise such as dynamic obstacles, has a mapping accuracy of 0.01 m, and the required storage space compared with the point cloud map is reduced by three orders of magnitude. The research results enrich the SLAM algorithm and implementation in unstructured environments such as underground coal mines, and help to solve the problems of environment perception, real-time positioning, and the navigation of coal mine robots and unmanned vehicles.