In the process of transporting commodity by sea, the ship clearance of general cargo ship has always been a hassle for the crew. Under a tight schedule and heavy task chart, it is frequently essential to work day and night upside down for crew to accomplish the cleaning of the cabin and unloading work. Sometimes it may not even be possible to complete unloading and clearance in time, resulting in massive economic losses. In this paper, a multi-functional ship clearance and sorting robot model is proposed based on the actual environment of the cargo ship's hold, which can not only realize the sorting of goods, but also assist in the cleaning of the ship hold after unloading. We have combined a robotic arm, a relevant target recognition algorithm and an Automatic Guided Vehicle(AGV) chassis which equipped with a Simultaneous Localization and Mapping (SLAM) algorithm to realize this robot, Collaborate with each other through the Robot Operating System(ROS) system. Experimental trials show that our robot is more accurate in positioning in the cabin environment compared to other algorithms, and has the preliminary function of cleaning the cabins of general cargo ships as a potential intelligent future trend, it may be useful for ship clearance functions. This project can be applied to the above scenarios or other similar areas. This article also compared two classic SLAM algorithms: hector slam and gmapping, and ultimately concluded that hector slam is more suitable for the above environment.