The shape and parameters of hardware are diverse, so the robot needs to have high precision to ensure the correct docking of hardware and apply appropriate force. In order to avoid damaging the hardware fittings, this paper designs an automatic online and offline system for the quality inspection robot of the power transmission line hardware fittings. The hardware structure includes user layer module, decision layer module, execution layer module and equipment layer module. The four functional modules work in coordination to enhance the robot trajectory planning effect. In the software part, the S-shaped trajectory planning method is improved to ensure the shortest planned path distance, and when the robot encounters obstacles, it can quickly plan straight and turning paths to effectively avoid obstacles, thus completing the design of the robot automatic online and offline system. The experimental results show that the trajectory error of the proposed method is less than 0.1rad.