With the rapid development of various technologies of unmanned autonomous platforms, research on highly autonomously controlled unmanned ships is a new goal of the shipbuilding and shipping industry. It is of great research significance to improve real-time collision avoidance during unmanned ship navigation. The artificial potential field method is a more mature and efficient algorithm in the real-time collision avoidance algorithm, which allows the moving object to avoid the obstacle while taking into account the moving performance of the moving object. Therefore, it is widely used in real-time obstacle avoidance for mobile robots. For the real-time collision avoidance algorithm of unmanned ships, this paper builds on the gravitational field and repulsive field based on the artificial potential field method. The target point is attractive to the unmanned boat, and the obstacle has repulsive force to the unmanned boat. The unmanned boat moves under the effect of the combined force and keeps approaching the target point. Simulation results show that the unmanned ship real-time collision avoidance algorithm based on artificial potential field method enables the unmanned ship to avoid obstacles quickly and reach the target point.