A method for autonomous obstacle avoidance of a quadruped robot climbing stairs

CN122593280APending Publication Date: 2026-08-18SUZHOU HENGWEN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610892942.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-21
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]本发明公开一种四足机器人上下楼梯自主避障方法,旨在解决背景技术中提出来的move_base2D导航框架误判楼梯面为障碍物、无法区分楼梯面与楼梯上障碍物、上下楼梯避障可靠性差的问题,通过语义分割精准识别两类目标,结合代价消除与障碍标记优化代价地图,实现四足机器人上下楼梯时自由通行楼梯面、精准避让障碍物,提升导航避障的安全性与适配性

Benefits of technology

[0021]1. Semantic segmentation technology is used to accurately distinguish between stair surfaces and obstacles. Combined with RGB images and depth data from an RGB-D depth camera, pixel-level recognition and 3D coordinate positioning of the two types of targets are achieved. This solves the problem that existing methods cannot accurately distinguish between stair surfaces and obstacles and are prone to misjudgment. The recognition accuracy can reach over 98%, and the positioning accuracy is ≤0.05 meters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593280A_ABST
    Figure CN122593280A_ABST
Patent Text Reader

Abstract

The application discloses a kind of four-legged robot autonomous obstacle avoidance methods of going up and down stairs, specifically includes the following steps: step one: four-legged robot deployment and equipment initialization;Step two: RGB image acquisition and semantic segmentation;Step three: target coordinate conversion and point cloud extraction;Step four: move_base2D cost map optimization;Step five: autonomous obstacle avoidance navigation of going up and down stairs;Step six, real-time correction and closed-loop control, based on the optimized map planning path, realize autonomous going up and down stairs and obstacle avoidance;Real-time data update and closed-loop correction, guarantee accurate and reliable.The four-legged robot autonomous obstacle avoidance methods of going up and down stairs disclosed in the application solve the problem of stair surface misjudgment and inaccurate obstacle avoidance, have strong adaptability and high safety, and are suitable for autonomous operation of four-legged robots in multiple scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quadruped robot navigation and obstacle avoidance technology, and in particular to a method for quadruped robots to autonomously avoid obstacles when going up and down stairs. Background Technology

[0002] Quadruped robots, with their excellent terrain adaptability and mobility, are widely used in autonomous inspection, material transportation, and emergency rescue. Climbing stairs is one of their core capabilities for expanding their operational range. Currently, quadruped robot navigation mostly uses the move_base2D series navigation framework, which combines environmental data collected by sensors to generate a cost map, and then plans traversable paths based on the cost map.

[0003] In existing technologies, some solutions eliminate obstacles by manually setting the coordinates of the stair area, but they have poor adaptability, cannot cope with staircases of different sizes and slopes, and cannot respond to changes in the staircase scene in real time; some solutions use LiDAR to identify staircases and obstacles, but they are costly and energy-intensive, and are not suitable for lightweight deployment of small quadruped robots.

[0004] To address the aforementioned issues, there is an urgent need for a method for quadruped robots to autonomously avoid obstacles when going up and down stairs. Summary of the Invention

[0005] This invention discloses an autonomous obstacle avoidance method for quadruped robots going up and down stairs. It aims to solve the problems of the move_base2D navigation framework misjudging the stair surface as an obstacle, being unable to distinguish between the stair surface and obstacles on the stairs, and having poor reliability in obstacle avoidance when going up and down stairs. By accurately identifying the two types of targets through semantic segmentation, and combining cost elimination and obstacle marking to optimize the cost map, the quadruped robot can freely traverse the stair surface and accurately avoid obstacles when going up and down stairs, thereby improving the safety and adaptability of navigation and obstacle avoidance.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A method for a quadruped robot to autonomously avoid obstacles when going up and down stairs, specifically including the following steps:

[0008] Step 1: Deployment of the quadruped robot and equipment initialization;

[0009] Step 2: RGB image acquisition and semantic segmentation;

[0010] Step 3: Target coordinate transformation and point cloud extraction;

[0011] Step 4: Move_base2D cost map optimization;

[0012] Step 5: Autonomous obstacle avoidance navigation when going up and down stairs;

[0013] Step 6: Real-time correction and closed-loop control.

[0014] In a preferred embodiment, the quadruped robot is deployed and initialized as follows: A quadruped robot capable of autonomously climbing stairs is deployed in the target staircase scenario (such as an interior staircase in a building). This quadruped robot is equipped with an RGB-D depth camera (integrating an RGB imaging unit and a depth imaging unit), a point cloud map processing module, an attitude sensor, and a navigation control module. The navigation control module incorporates the move_base2D navigation framework for path planning and motion control. The depth camera undergoes comprehensive calibration, including intrinsic parameter calibration (determining parameters such as camera focal length and principal point coordinates) and extrinsic parameter calibration (determining the relative positional relationship between the camera and the robot's own center). The timestamps of the depth camera and the LiDAR are synchronized (synchronization accuracy ±10ms) to ensure the synchronization of the two types of data acquisition. Initialize the quadruped robot's walking parameters, including its speed and walking mode when going up and down stairs, to adapt to stairs with different inclines; initialize the semantic segmentation model parameters (inference frame rate, confidence threshold), the semantic segmentation model adopts a pre-trained Fast_SCNN model, which has been trained on stair scene data and can accurately distinguish between stair surfaces and obstacles; initialize the move_base2D navigation framework parameters, including global path planning algorithm (A* algorithm) parameters and local obstacle avoidance algorithm (time elastic band algorithm) parameters; set the cost map thresholds, including obstacle cost threshold (250-255) and passable cost threshold (0-10), to provide a basis for subsequent cost map optimization.

[0015] In a preferred embodiment, RGB image acquisition and semantic segmentation are performed as follows: The quadruped robot initiates a stair-climbing navigation mode, slowly moving to the starting position of the stairs. RGB data is acquired via a depth camera, and RGB images of the stair area ahead are captured in real-time at a preset frame rate (20-30 frames / second) to ensure complete coverage of the stair treads, landings, and potential obstacles. Each acquired RGB image frame is preprocessed: Gaussian filtering is used to remove image noise, and image size is normalized to a size suitable for the semantic segmentation model (e.g., 512×512 pixels) to avoid image distortion affecting segmentation accuracy. The preprocessed RGB images are input into a pre-trained Fast_SCNN semantic segmentation model. The model extracts texture and contour features from the image through the encoder, restores the feature map size through the decoder, performs pixel-level classification inference, and outputs a semantic segmentation mask map. In the mask map, different mask values ​​are used to label the stair surface and obstacles respectively; for example, the stair surface mask value is 1, and the obstacle mask value is 0, clearly defining the pixel coordinate range of the two types of targets and ensuring accurate segmentation results.

[0016] In a preferred embodiment, target coordinate transformation and point cloud extraction are performed as follows: The depth camera and solid-state multi-channel LiDAR work synchronously, acquiring environmental data of the staircase area ahead at the same frame rate; the system acquires RGB data and point cloud data, and combines them with the semantic segmentation mask map (binary mask, target area mask value = 1, obstacle area mask value = 0) obtained in step 2. The LiDAR point cloud in the navigation coordinate system is transformed to the camera optical coordinate system using TF coordinate transformation, and the camera intrinsic parameters (principal point) are then used to extract the point cloud. , ,focal length , The pinhole camera imaging model is projected orthographically onto a two-dimensional image plane, and the projection formula is: , ,in The image pixel coordinates are used to classify the LiDAR point cloud into target points (green) and obstacle points (light gray / dark gray) by determining whether the projected point is within the effective field of view and whether the corresponding mask value is 1. Finally, the navigation coordinate system point cloud data with semantic labels is output to clarify the three-dimensional spatial position of the target and obstacle on the stair surface.

[0017] In a preferred embodiment, move_base cost map optimization involves calling the cost map generation module of the move_base2D navigation framework in the quadruped robot's navigation control module. Based on the environmental data collected by the depth camera, an initial global cost map (for global path planning) and a local cost map (for local obstacle avoidance) containing the stair area are generated. To address the issue of the move_base framework misidentifying stair surfaces as obstacles, the initial cost map is optimized as follows: First, based on the stair surface point cloud coordinates obtained in step 3, the corresponding area of ​​the stair surface is located in the cost map. The obstacle cost of this area is reset to zero, eliminating the obstacle marker on the stair surface. Simultaneously, the passable cost of the stair surface area is set to a preset minimum value (0-10), clearly marking it as a passable area. Second, the obstacle point cloud obtained in step 3 is imported into the cost map. Based on the coordinate range of the obstacle point cloud, the corresponding area of ​​the obstacle is located in the cost map. A preset maximum obstacle cost (250-255) is assigned to this area, clearly marking it as an impassable area. Finally, the cost map update frequency and update threshold are set to ensure that the cost map can synchronize the positional changes of stair surfaces and obstacles in real time. The optimized cost map can accurately distinguish between passable stair surfaces and obstacles, fully adapting to the path planning requirements of the move_base2D navigation framework.

[0018] In a preferred embodiment, the autonomous obstacle avoidance navigation for ascending and descending stairs is achieved using the move_base2D navigation framework. This framework uses an optimized cost map as its core input, combined with real-time position data collected by the quadruped robot's own posture sensors, to initiate the path planning process. The global path planning module employs the A* algorithm, based on the global cost map, to plan the optimal passable path from the start of the stairs to the end point (or landing). The path only covers the passable area of ​​the stair surface, strictly avoiding obstacle-marked areas. The local obstacle avoidance planning module uses a time-elastic band algorithm, based on the local cost map and the robot's real-time motion state, to dynamically correct path deviations and adapt to the height, width, and slope of the stair treads. Based on the path planning results, the navigation control module sends control commands to the quadruped robot's joint motors to adjust the robot's gait and speed. When ascending or descending stairs, the robot's gait is adjusted according to the stairs to ensure stability. When encountering obstacles on the stairs, the robot's lateral position is fine-tuned (offset along the Y-axis) based on the local path planning results, avoiding obstacles and returning to the optimal path. Ultimately, this achieves autonomous movement of the quadruped robot up and down stairs without colliding with obstacles.

[0019] In a preferred embodiment, real-time correction and closed-loop control are implemented: throughout the quadruped robot's navigation up and down stairs, steps 2-4 are continuously repeated to form a closed-loop control, ensuring the stability and accuracy of navigation and obstacle avoidance. This involves real-time acquisition of RGB images and semantic segmentation to update the pixel coordinates of the stair surface and obstacles; simultaneous updating of depth data and target point clouds to correct the 3D coordinates of both types of targets; and dynamic updating of the cost map to adjust the cost allocation corresponding to the stair surface and obstacles in a timely manner, avoiding misjudgments caused by scene changes (such as robot pose shifts or slight obstacle movements). Simultaneously, attitude and distance sensors are used to detect the distance between the robot and obstacles, as well as the robot's fit with the stair surface, in real time. When the distance between the robot and an obstacle is detected to be less than the obstacle avoidance threshold (0.2-0.3 meters), the local path is immediately adjusted to increase the obstacle avoidance distance. When semantic segmentation deviations or cost map anomalies are detected (such as incorrect stair surface markings), the semantic segmentation and cost map optimization steps are re-executed to dynamically correct the path planning, ensuring that the robot always moves freely along the stair surface and accurately avoids all obstacles on the stairs.

[0020] As described above, a method for autonomous obstacle avoidance for a quadruped robot going up and down stairs specifically includes the following steps: Step 1: Quadruped robot deployment and device initialization; Step 2: RGB image acquisition and semantic segmentation; Step 3: Target coordinate transformation and point cloud extraction; Step 4: move_base2D cost map optimization; Step 5: Autonomous obstacle avoidance navigation up and down stairs; Step 6: Real-time correction and closed-loop control. The autonomous obstacle avoidance method for a quadruped robot going up and down stairs provided by this invention has the following beneficial effects:

[0021] 1. Semantic segmentation technology is used to accurately distinguish between stair surfaces and obstacles. Combined with RGB images and depth data from an RGB-D depth camera, pixel-level recognition and 3D coordinate positioning of the two types of targets are achieved. This solves the problem that existing methods cannot accurately distinguish between stair surfaces and obstacles and are prone to misjudgment. The recognition accuracy can reach over 98%, and the positioning accuracy is ≤0.05 meters.

[0022] 2. An innovative cost elimination strategy is adopted, which clears the obstacle cost corresponding to the stair surface and the obstacle cost of the marked obstacles in the move_base navigation framework. The optimized cost map perfectly adapts to the framework requirements and completely solves the core problem of the existing move_base framework misjudging the stair surface as an obstacle, causing the robot to be unable to go up and down the stairs to avoid obstacles, ensuring that the robot can freely pass through the stair surface.

[0023] 3. It integrates stair climbing and obstacle avoidance functions without the need for additional dedicated obstacle avoidance modules. Through semantic segmentation and cost map optimization, the robot can accurately avoid obstacles while climbing stairs, simplifying the robot control system, reducing hardware costs, and adapting to the lightweight deployment requirements of small quadruped robots.

[0024] 4. It has strong scene adaptability. The semantic segmentation model can be fine-tuned to adapt to stair scenes with various slopes and sizes. The cost map can be dynamically updated in real time and can cope with subtle changes in stair scenes (such as obstacle position shifts and stair surface wear). There is no need to manually set stair parameters, making it more practical.

[0025] 5. By adopting a closed-loop control mechanism, deviations in semantic segmentation, coordinate transformation, and cost map are corrected in real time to ensure the stability and safety of the robot when going up and down stairs, avoid collision accidents, improve the reliability of the quadruped robot's operation on stairs, expand the robot's operating range, and can be widely used in various scenarios such as inspection and rescue. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the overall process of a method for autonomous obstacle avoidance when a quadruped robot goes up and down stairs, as proposed in this invention.

[0027] Figure 2 The image shows the original RGB staircase image on the left and the semantic mask image on the right (staircase surface highlighted, obstacles dark) of a method for autonomous obstacle avoidance of a quadruped robot going up and down stairs proposed in this invention.

[0028] Figure 3 This is a schematic diagram illustrating the coordinate transformation and point cloud extraction principle of the stair surface and obstacles in the autonomous obstacle avoidance method for a quadruped robot going up and down stairs proposed in this invention.

[0029] Figure 4This is a comparative diagram of the cost map before and after optimization of the autonomous obstacle avoidance method for a quadruped robot going up and down stairs proposed in this invention (left: before optimization, right: after optimization).

[0030] Figure 5 This is a schematic diagram of a real-world scenario illustrating the autonomous obstacle avoidance method for a quadruped robot going up and down stairs, as proposed in this invention. Detailed Implementation

[0031] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment takes an internal staircase (45° slope, 18 steps, step height 0.15 meters, step width 0.3 meters) as the target scenario, and a quadruped robot is used for building inspection to ensure the operability of the embodiment, while not being limited to the scenario of this embodiment.

[0032] Reference Figures 1-5 A method for a quadruped robot to autonomously avoid obstacles when going up and down stairs, specifically including the following steps:

[0033] Step 1: Deployment of the quadruped robot and equipment initialization;

[0034] Step 2: RGB image acquisition and semantic segmentation;

[0035] Step 3: Target coordinate transformation and point cloud extraction;

[0036] Step 4: Move_base2D cost map optimization;

[0037] Step 5: Autonomous obstacle avoidance navigation when going up and down stairs;

[0038] Step 6: Real-time correction and closed-loop control.

[0039] Example 1

[0040] In this embodiment, the target scene is an internal staircase in a building. The staircase has a 45° slope, 18 steps, a step height of 0.15 meters, and a step width of 0.3 meters. There are a few obstacles on the staircase (such as people and small tools). The quadruped robot is a small quadruped autonomous walking robot with a body weight of 10 kg. It is equipped with an RGB-D depth camera (resolution 1280×720, RGB frame rate 25 frames / second, depth frame rate 25 frames / second, depth measurement range 0.5-10 meters), a solid-state multi-channel LiDAR, and a built-in move_base2D navigation framework in the navigation control module. The semantic segmentation model uses a pre-trained Fast_SCNN model with a confidence threshold of 0.85. The cost map update frequency is set to 12Hz, the maximum obstacle cost is set to 255, the walkable cost of the stair surface is set to 5, and the obstacle avoidance distance threshold is set to 0.25 meters.

[0041] In a preferred embodiment, the quadruped robot is deployed and the equipment is initialized as follows: The quadruped robot is deployed at the starting position of the building stairs, the RGB-D depth camera is calibrated to obtain the intrinsic parameters: =640 pixels, =360 pixels, =606.6 pixels, =607.2 pixels; the intrinsic and extrinsic parameters are calibrated and the timestamp is synchronized (synchronization accuracy ±15ms), and the TF static transformation is automatically published; the robot's walking parameters are initialized, with the stride range set to 0.12-0.18 meters, the step frequency set to 1.5Hz, and the body pitch angle adjustment range set to 0°-25°; the Fast_SCNN semantic segmentation model is initialized, with the inference frame rate set to 25 frames / second; the move_base2D framework parameters are initialized, with the global path planning using the A* algorithm and the local obstacle avoidance using the dynamic window method, thus completing the initialization.

[0042] In a preferred implementation, RGB image acquisition and semantic segmentation: The robot initiates navigation up and down the stairs, and the depth camera acquires RGB images of the stair area in front. After Gaussian filtering for noise reduction and size normalization (512×512 pixels), the images are input into the Fast_SCNN semantic segmentation model. The model infers and outputs a semantic segmentation mask map, in which the mask value of the stair surface (steps, platforms) is 1, and the mask value of obstacles (mineral water bottles, small tools) is 0. The pixel coordinate range of the two types of targets is accurately identified, and the recognition accuracy reaches 98.5%.

[0043] In a preferred embodiment, target coordinate transformation and point cloud extraction are performed as follows: The depth camera synchronously acquires depth data of the stair area, and combined with the semantic segmentation mask, the LiDAR point cloud in the navigation coordinate system is transformed to the camera coordinate system through TF transformation. The pinhole camera model is orthographically projected onto the image plane, and the point cloud is classified into target points (green) and obstacle points (light gray / dark gray) according to the corresponding values ​​of the projected points in the mask. This yields semantically labeled navigation coordinate system point cloud data, which clarifies the three-dimensional position of the target on the stair surface and the background obstacles, achieving a positioning accuracy of 0.04 meters.

[0044] In a preferred implementation, the move_base2D cost map is optimized as follows: The move_base2D framework generates an initial cost map, in which stair surfaces are mistakenly marked as obstacle areas (cost 255); the initial map is optimized by resetting the cost of the area corresponding to the stair surface point cloud to 5 (passable), and setting the cost of the area corresponding to the obstacle point cloud to 255 (impassable); the cost map is set to be updated every 12Hz to ensure that the map is synchronized with the actual scene, and the optimized cost map accurately distinguishes between passable stair surfaces and impassable obstacles.

[0045] In a preferred implementation, the robot performs autonomous obstacle avoidance navigation when going up and down stairs: the move_base2D framework takes an optimized cost map as input and combines it with the robot's real-time pose data. The A* algorithm plans a global path from the starting position of the stairs to the stair landing, and the path fits the stair surface. The dynamic window method corrects the path deviation in real time, adapts to the stair slope, controls the robot's body pitch angle to be adjusted to 20°, and sets the stride to 0.15 meters to ensure smooth ascent and descent. When an obstacle is detected on the stairs, a lateral offset path is planned (0.1 meters offset along the Y-axis) to avoid the obstacle and return to the optimal path without collision.

[0046] In a preferred implementation, real-time correction and closed-loop control are implemented: during navigation, RGB images, semantic segmentation results, point cloud data, and cost maps are continuously updated; when the robot pose deviates slightly (0.03 meters), the point cloud position is corrected through semantic segmentation and coordinate transformation, the cost map is updated, and the path planning is adjusted to ensure that the robot conforms to the stair surface; there is no semantic segmentation deviation or cost map anomaly throughout the process, and the closed-loop control effect is good.

[0047] In this experiment, the quadruped robot successfully completed the movement up and down 18 steps of stairs, freely traversing the stair surface and accurately avoiding all obstacles. The total time for going up and down the stairs was 90 seconds. The robot remained stable without tilting or colliding, and the obstacle avoidance response time was ≤0.3 seconds. This fully meets the obstacle avoidance requirements for building inspection scenarios. Compared with existing methods, it solves the problems of misjudging the stair surface and inaccurate obstacle avoidance, and significantly improves reliability.

[0048] Example 2

[0049] The difference between this embodiment and Embodiment 1 is that the target scene is an outdoor staircase in a park (35° slope, 20 steps, step height 0.12 meters, step width 0.35 meters), and the obstacles on the staircase are lighting devices and small stones; the semantic segmentation model adopts the SegNet model, the cost map update frequency is set to 15Hz, the obstacle avoidance distance threshold is set to 0.3 meters, and the robot step frequency is set to 1.2Hz.

[0050] During implementation, a depth camera captures RGB images of the outdoor staircase, and the SegNet model accurately identifies the staircase surface and obstacles (lighting devices, pebbles), achieving an accuracy rate of 98%. After coordinate transformation, a precise point cloud is obtained, and the optimized cost map accurately marks the passable and impassable areas. The move_base2D framework plans the optimal path, controlling the robot to smoothly ascend and descend the stairs, successfully avoiding all obstacles. Even when dealing with slight changes in outdoor lighting (such as tree shade), semantic segmentation and cost map updates remain stable, with no misjudgments or biases, adapting to the usage requirements of outdoor staircase scenarios.

[0051] This invention is not limited to the above embodiments. Various modifications and improvements can be made without departing from the core technical solution of this invention. For example, the semantic segmentation model can be changed, the cost map threshold can be adjusted, stairs with different slopes can be adapted, and the depth camera model can be changed. All these modifications and improvements fall within the protection scope of this invention.

[0052] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for autonomous obstacle avoidance when a quadruped robot goes up and down stairs, characterized in that, Specifically, the following steps are included: Step 1: Deployment and initialization of the quadruped robot; Step 2: RGB image acquisition and semantic segmentation; Step 3: Target coordinate transformation and point cloud extraction; Step 4: Move_Base2D cost map optimization; Step 5: Autonomous obstacle avoidance navigation when going up and down stairs; Step six: Real-time correction and closed-loop control.

2. The method for autonomous obstacle avoidance of a quadruped robot going up and down stairs according to claim 1, characterized in that, In step one, a quadruped robot capable of climbing stairs is deployed in the target scene. The quadruped robot is equipped with a depth camera, LiDAR, point cloud map processing module, and navigation control module. The navigation control module has a built-in move_base2D navigation framework. The depth camera and LiDAR are calibrated to complete intrinsic parameter calibration, extrinsic parameter calibration, and timestamp synchronization. The robot's walking parameters, semantic segmentation model parameters, and move_base2D navigation framework parameters are initialized.

3. The method for autonomous obstacle avoidance of a quadruped robot going up and down stairs according to claim 2, characterized in that, In step one, the depth camera is an RGB-D depth camera, the LiDAR is a 16-line or higher LiDAR, and the semantic segmentation model adopts the Fast_SCNN model. The pre-training process uses the RGB image of the stair scene and the corresponding mask image as the training set, and the training objective is to accurately distinguish the stair surface from others. The parameters of the move_base2D navigation framework include global path planning algorithm parameters, local obstacle avoidance algorithm parameters, and cost map update frequency. The walking parameters of the quadruped robot in step one include the stride and speed when going up and down stairs. The climbing speed is dynamically adjusted according to the slope of the stairs to adapt to stair scenes with different slopes (30°-60°).

4. The method for autonomous obstacle avoidance of a quadruped robot going up and down stairs according to claim 1, characterized in that, In step two, the quadruped robot initiates navigation up and down the stairs, acquiring RGB images of the stair area in real time using the ROS topic of the depth camera. The RGB images are then input into a pre-trained semantic segmentation model. Through model inference, the model accurately identifies two types of targets in the image—stair surfaces and obstacles—and outputs a semantic segmentation mask, clearly defining the pixel coordinate range of the two types of targets. The inference process of the semantic segmentation model in step two is as follows: the acquired RGB images are preprocessed and then input into the model. The model extracts image features through an encoder, restores the feature map size through a decoder, and outputs a semantic segmentation mask. The stair surfaces and obstacles are marked with different mask values, and the mask values ​​are clearly distinguishable from the background pixel values.

5. A method for autonomous obstacle avoidance by a quadruped robot going up and down stairs according to claim 1, characterized in that, In step three, the depth camera synchronously acquires depth data of the staircase area. Combined with the semantic segmentation mask image obtained in step two, the pixel coordinates corresponding to the staircase surface and obstacles are extracted. By transforming the LiDAR point cloud data from the LiDAR coordinate system to the camera coordinate system, the 3D point cloud is projected onto the 2D image plane using the camera intrinsic parameter matrix to obtain the pixel coordinates of each point in the semantic segmentation mask image. Then, semantic labels are assigned to the point cloud according to the mask category to obtain the staircase surface point cloud and obstacle point cloud. The camera imaging model adopts a pinhole camera model. The coordinate transformation algorithm is jointly calculated by the LiDAR point cloud data and the camera intrinsic parameters. First, the point cloud is transformed from the navigation coordinate system (body_2d) to the camera optical coordinate system through TF transformation to obtain the 3D point coordinates in the camera coordinate system. Then, the 3D points are projected onto the 2D image plane using the camera intrinsic parameter matrix. The projection formula is: , ,in These are the pixel coordinates of the projected image. , For camera focal length, , The principal point coordinates of the camera are then determined; subsequently, based on the semantic segmentation mask... The category labels at each location are used to mark the corresponding 3D points as either stair surfaces or obstacles, resulting in 3D point cloud data with semantic labels.

6. A method for autonomous obstacle avoidance by a quadruped robot going up and down stairs according to claim 1, characterized in that, In step four, the cost map generation module of the move_base2D navigation framework is invoked to initially generate a global cost map and a local cost map containing the staircase area. The cost map is then optimized by clearing the obstacle cost of the area corresponding to the staircase surface to zero, eliminating the obstacle markers on the staircase surface in the cost map, and retaining its passable cost attribute. Simultaneously, the obstacle point cloud extracted in step three is imported into the cost map, and a preset obstacle cost is assigned to the obstacle area, marking it as an impassable area. The cost map includes a global cost map and a local cost map, and the cost map thresholds include an obstacle cost threshold and a passable cost threshold. The cost value of the area corresponding to the staircase surface is set to a preset free value, and the obstacle cost of the obstacle area is set to a preset maximum value, ensuring that the quadruped robot can move freely on the staircase surface and accurately avoid obstacles.

7. A method for autonomous obstacle avoidance by a quadruped robot going up and down stairs according to claim 1, characterized in that, In step five, the move_base2D navigation framework takes the optimized cost map as input and combines it with the robot's own pose data to plan the optimal passable path for going up and down the stairs, avoiding obstacle-marked areas. Based on the path planning results, it controls the quadruped robot to adjust its gait, stride and body posture to achieve autonomous movement up and down the stairs.

8. A method for autonomous obstacle avoidance by a quadruped robot going up and down stairs according to claim 7, characterized in that, In step five, the global path planning uses the A* algorithm to plan the optimal path from the starting position to the end of the stairs based on the global cost map; the local obstacle avoidance planning uses the time elastic band algorithm to correct path deviations based on the local cost map and the robot's real-time pose, adapt to the leg lift height of the stair steps, and adjust the speed to ensure smooth going up and down the stairs.

9. A method for autonomous obstacle avoidance by a quadruped robot going up and down stairs according to claim 1, characterized in that, In step six, during the navigation process, steps two to four are repeated continuously to update the RGB image acquisition, semantic segmentation results, target point cloud and cost map in real time; the distance between the robot and obstacles and the fit of the stair surface are detected; when semantic segmentation deviation or cost map abnormality occurs, the obstacle cost allocation and path planning are dynamically corrected to ensure that the robot always moves freely along the stair surface and accurately avoids obstacles on the stairs.

10. A method for autonomous obstacle avoidance by a quadruped robot going up and down stairs according to claim 9, characterized in that, The real-time correction in step six includes: when the semantic segmentation model recognition error exceeds a preset threshold, re-inputting the latest RGB image for inference; when the obstacle point cloud and the cost map markers deviate too much, re-importing the obstacle point cloud and updating the cost map to ensure obstacle avoidance accuracy and smooth passage.