The localization and map building technology of mobile robot is the key to realize robot indoor autonomous navigation technology. This paper introduces Gmapping SLAM, Hector SLAM, Cartographer SLAM and ORB SLAM2, compares the above algorithms, and expounds the advantages and disadvantages of different algorithms and applicable conditions. The Kinect V2 depth camera is calibrated. On the built mobile robot platform, the ROS operating system is used to verify the four algorithms. According to the map constructed in the experiment, it is concluded that the cartographer SLAM algorithm of laser slam in indoor environment has high accuracy and efficiency, and can be used directly. ORB SLAM2 is rich in 3D features, but the feature points are sparse, so it is difficult to use the map directly.