Due to the excellent maneuverability and obstacle crossing of legged robots, it is possible for an autonomous legged wall-climbing robots to replace manual inspection of ship exterior panels. However, when the magnetic adsorption legged wall-climbing robot steps on the convex point or convex line of the wall, or even when the robot missteps, the robot is likely to detach from the ferromagnetic wall. Therefore, this paper proposes a tactile sensor for the legged magnetic adsorption wall-climbing robot to detect the magnetic adsorption state and improve the safety of the autonomous crawling of the robot. The tactile sensor mainly comprises a 3D-printed shell, a tactile slider, and three isometric sensing units, with an optimized geometry. The experiment shows that the triboelectric tactile sensor can monitor the sliding depth of the tactile slider and control the LED signal light. In addition, in the demonstration experiment of detecting the adsorption state of the robot's foot, the triboelectric tactile sensor has strong adaptability to various ferromagnetic wall surfaces. Finally, the study establishes a robot gait control system to verify the feedback control ability of the triboelectric tactile sensor. The results show that the robot equipped with the triboelectric tactile sensor can recognize the dangerous area on the crawling wall and autonomously avoid the risk. Therefore, the proposed triboelectric tactile sensor has great potential in realizing the tactile sensing ability of robots and enhancing the safety and intelligent inspection of ultra-large vessels. Video MOvie S4 - Application of TTS for control the robot(2).mp4 Movie S1 - Demonstration of tactile monitoring system.mp4 Movie S2 - Application of TTS for control the LEDs.mp4 Movie S3 - Application of TTS for control the robot(1) .mp4