In order to solve the problem that it is difficult to obtain accurate robot actual motion trajectory and environmental parameters when running SLAM (simultaneous location and mapping) algorithms in unknown environments, this paper uses the ROS (Robot Operating System) based on Gazebo simulation platform for evaluation. In this paper, a URDF (Unified Robot Description Format) robot model with 2D Lidar and a Gazebo simulation environment with known parameters are built. Then, the robot model can run three different mapping algorithms in the simulation environment and evaluate the mapping results. Finally, a 2D Lidar is used to verify the mapping in a real environment. The obtained map comparison results apparently indicate that these above difficult problems can be well solved by this method.