Abstract:In order to enhance the stair-climbing robot’s capability for rapid detection and precise localization of stairs in indoor environments, a stair detection and localization method based on a rotating 2D LiDAR was proposed. A hardware platform consisting of a servo motor, a 2D LiDAR, a Raspberry Pi upper computer, and a DJI Type A developer board was constructed. On this basis, for various relative positional relationships between the robot and the stairs, a stair detection algorithm based on point cloud region-growing clustering and principal component analysis (PCA) was proposed to extract multi-level step facade features and compute the ascent direction angle of the stairs. This enabled the determination of the angle between the stair ascent direction and the robot’s X-axis in the X-Y plane across multiple scenarios. Using the center point of the first-step facade as a key localization parameter, a PCA-based plane fitting algorithm was employed to obtain critical parameters such as step height (H), length (L), and the coordinates of the first-step facade center point, thereby achieving precise stair localization. A total of 240 experiments were conducted across four types of stair scenarios with varying robot-stair relative positions. The results showed that the absolute deviation in stair ascent direction detection ranged from 0.03° to 2.35°, with an average deviation within 1.5°. Localization experiments in different stair scenarios revealed that the maximum positioning deviation of the first-step facade center point in the robot coordinate system was 0.024 m in the X-direction and 0.062 m in the Y-direction. The experimental results demonstrate that the proposed method achieves high detection accuracy and positioning precision across various stair scenarios, providing reliable perception and localization support for autonomous cross-floor navigation of stair-climbing robots in complex indoor environments.