In order to overcome the limitations of using a single sensor to locate and map the sterile mobile robot in complex environment, this paper combines the advantages of lidar and depth camera, presents a method to fuse the depth information of the depth camera with the lidar data to get point cloud data, uses gampping algorithm to construct two-dimensional indoor map, establishes the robot and simulation environment in gazebo, and tests the algorithm. Map information is more comprehensive than building maps directly using lidar.