This paper studies the positioning and obstacle avoidance control of automated guided vehicles (AGV). First, we have established the kinematics model for AGV by equivalent the obstacle to a circle. Different from the conventional obstacle avoidance methods, we use the polar coordinate method to express the obstacle position. Second, for the presented AGV system, we propose a safety heading angle base on the Line of sight (LOS) method. Unlike the traditional LOS method, this paper introduces the tangent angle of the circle formed by AGV and obstacles as the guidance of LOS. Therefore, AGV's heading will not be toward obstacles to achieve obstacle avoidance control. Then, to ensure that AGVs reach the target point, we propose a positioning heading angle that can achieve obstacle avoidance based on the above safety guidance algorithm. Compared with the traditional artificial potential field (APF) obstacle avoidance method, the proposed method has no misalignment of the balance point. Finally, experiments are conducted using a ROS-based AGV experimental platform to demonstrate the algorithm's feasibility. The experimental results show that the algorithm can effectively solve the problem of misalignment of target points in the traditional artificial potential field algorithm.