To diminish mapping noise caused by excessive delay and accumulated odometer errors, this paper investigates the optimization problem of the Cartographer simultaneous localization and mapping (SLAM) algorithm based on comparative experiments. Firstly, with the premise of normalization, comparative experimental analysis was conducted on four mainstream LiDAR SLAM algorithms. It solves the problem that the comparative analysis of current LiDAR SLAM algorithms mostly stays in the simulation level and few on experiment, and also confirm the superiority of Cartographer and discover its shortcomings. Then, make further optimizations for Cartographer: (1) Introducing a threshold to reduce computational load, so that global SLAM and local SLAM always keep up with real-time input, solving the problem of excessive delay between global SLAM and local SLAM; (2) Optimizing the rotation weight based on the confidence level of local SLAM or odometer to reduce the accumulated odometer error. Finally, an autonomous navigation experiment for complex indoor scenes was designed using the Ackerman car as the platform, and the A* and TEB algorithms were introduced to verify the optimized Cartographer mapping effect. The experimental results show that the optimized Cartographer reduces noise and greatly improves subsequent navigation accuracy and stability.