Abstract In the realm of computer vision and robotics, lidar SLAM is an important technical means. Lidar SLAM frequently serves to ascertain the spatial coordinates and orientation of mobile robots amidst their surroundings. In this paper, an adaptive factor graph optimization of the lidar pose estimation method using only point-to-line constraints is proposed. The algorithm only employs the measure of distance between a point and a line to construct the constraint problem and solves the pose through point-to-line ICP and the pose with higher accuracy by optimizing the factor graph. The robustness of mobile robots in indoor scenes is improved. According to different application scenarios, including street and gate, comparative experiments are carried out on the open-source data set M2DGR containing lidar data. Empirical findings demonstrate that the algorithm put forth enhances the precision of the lidar odometer when confronted with outdoor scenarios, thereby bolstering the resilience of mobile robots traversing urban thoroughfares.