A terrain-guided gait generation method
By using terrain perception and obstacle detection to dynamically adjust gait parameters, the problem of insufficient adaptability of legged robots in complex off-road environments is solved, achieving stable obstacle avoidance and smooth transition, thus improving the robot's motion performance.
Patent Information
- Application Number
- CN202511862987.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-26
AI Technical Summary
Existing legged robot gait planning methods are not adaptable enough to complex and dynamically changing off-road environments, making it difficult to effectively cope with uncertain obstacles and terrain features, resulting in unstable movement and insufficient obstacle avoidance capabilities.
The system acquires terrain data through a terrain perception step, extracts slope and roughness features through a deep convolutional neural network, combines obstacle detection, dynamically adjusts step length and step frequency, plans gait in real time to adapt to terrain changes, and achieves autonomous obstacle avoidance through multi-sensor fusion.
It improves the mobility and obstacle avoidance capabilities of legged robots in complex terrain, ensures smooth transitions in dynamic environments, and enhances the robot's intelligence and operational continuity.
Smart Images

Figure CN122085989A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of legged robot motion control technology, specifically relating to a method for autonomous obstacle avoidance and gait coordination control of legged robots based on terrain feature perception. Background Technology
[0002] With the rapid development of robotics technology, legged robots have attracted increasing attention due to their ability to perform tasks in complex terrains. Especially in off-road environments, legged robots need a certain degree of autonomous obstacle avoidance to adapt to irregular terrains such as mountains and forests, thereby ensuring efficient and safe completion of tasks. However, gait planning algorithms for legged robots are mainly focused on flat ground or known terrain, lacking sufficient adaptability to real off-road environments with dynamically changing and uncertain obstacle distributions.
[0003] Existing gait planning methods for legged robots mainly fall into two categories: map-based path planning and sensor-feedback-based real-time obstacle avoidance. Map-based path planning relies on a pre-built environment model, calculating the globally optimal path to guide the robot's movement. This method has the advantage of providing a globally optimal solution, but it requires high map accuracy and struggles to handle sudden obstacles. On the other hand, sensor-feedback-based real-time obstacle avoidance methods adjust the robot's movements by detecting changes in the surrounding environment in real time, offering greater flexibility and immediate response. However, this method is prone to getting trapped in local optima, making it difficult to find the globally optimal solution from the starting point to the destination. Furthermore, traditional gait generation techniques often neglect the influence of terrain features on gait selection. For example, key factors such as slope, ruggedness, and obstacle distribution are not adequately considered in gait planning, leading to poor robot performance in complex terrains. This limitation makes existing technologies insufficient for meeting practical needs in dynamically changing off-road environments.
[0004] Therefore, how to achieve efficient and stable gait planning in dynamic, uncertain, and complex terrain is a major challenge in current legged robot research. Summary of the Invention
[0005] To address the shortcomings of existing gait planning methods for legged robots, this invention provides a terrain-guided gait generation method that enables legged robots to autonomously avoid obstacles in complex terrains. Furthermore, when entering a new terrain area, it ensures a smooth transition for the legged robot to the new walking state, thereby improving the robot's adaptability to real-world off-road environments with dynamically changing and unpredictable obstacle distributions.
[0006] The technical solution for implementing the present invention is as follows: A terrain-guided gait generation method includes the following steps: S1. Terrain perception step: Obtain terrain data of the environment in which the legged robot is located, extract features from the terrain data, and obtain terrain feature information that characterizes the terrain slope and roughness. S2. Gait planning steps: Based on the terrain feature information, dynamically calculate and adjust the stride length and stride frequency of the legged robot; S3, Obstacle Avoidance Steps: Real-time detection of obstacles in the direction of travel of the legged robot, and planning of obstacle avoidance trajectory based on the detection results; S4. Gait switching step: When the legged robot enters a new terrain area, steps S1 and S2 are repeated to generate a step length and step frequency adapted to the new terrain area.
[0007] Furthermore, step S1 specifically includes: The terrain's 3D point cloud data is acquired using LiDAR, and its 2D image data is acquired using a visual camera. Feature extraction is performed on the three-dimensional point cloud data and the two-dimensional image data using a point cloud processing network and a convolutional neural network, respectively. The extracted point cloud features are fused with image features, and the terrain feature information is output through a network branch dedicated to predicting terrain slope and roughness.
[0008] Furthermore, the process of calculating the step size in step S2 includes: The slope and roughness values in the terrain feature information are normalized. Based on the normalized slope value, the slope influence factor is calculated according to different travel directions; Calculate the roughness influence factor based on the normalized roughness value; The slope influence factor and the roughness influence factor are combined with a nonlinear fusion function to calculate the recommended step size under the current terrain.
[0009] Furthermore, the process of calculating the step frequency in step S2 includes: Based on the slope and roughness values in the terrain feature information, a quantitative value for terrain complexity is calculated. Calculate the robot load impact factor based on the current load mass of the legged robot; By combining the quantified value of terrain complexity with the robot load influence factor and introducing a preset weighting coefficient, the recommended step frequency under the current terrain and load conditions is calculated.
[0010] Furthermore, step S3 specifically includes: By fusing lidar point cloud data and camera image data, obstacles are identified using a deep learning object detection network. Within the velocity dynamic window, multiple candidate combinations of linear velocity and angular velocity are sampled, and the future motion trajectory corresponding to each velocity combination is predicted. The reward value for each predicted trajectory is calculated by an evaluation function that takes into account at least the alignment of the trajectory endpoint toward the target direction and the distance between the trajectory and the obstacle. The speed combination corresponding to the trajectory with the highest reward value is selected as the current optimal control command.
[0011] Furthermore, step S4 specifically includes: Continuously monitor changes in terrain features; When the change in terrain features exceeds a preset threshold, it is determined that the legged robot has entered a new terrain area, and step S1 is triggered to re-extract terrain feature information. Based on the newly extracted terrain feature information, step S2 is performed to recalculate and switch to step length and step frequency adapted to the new terrain area.
[0012] Beneficial effects: 1. This invention integrates lidar point cloud and visual image data to extract terrain slope and roughness features in real time, and dynamically adjusts step length and step frequency accordingly, enabling legged robots to autonomously adapt to undulating, rugged and other varied terrains, overcoming the problem of insufficient adaptability of traditional methods in unknown or dynamic terrains.
[0013] 2. This invention combines terrain features and obstacle detection results to plan gait and local paths in real time, effectively avoiding collisions and instability. Especially on unstable surfaces such as slopes and gravel, the system can optimize gait parameters by comprehensively considering slope, roughness, and load factors, significantly improving the robot's motion stability and environmental interaction safety.
[0014] 3. When the terrain changes, the system of this invention can autonomously re-perceive the terrain features and quickly generate a matching gait to achieve a smooth transition between different terrains. At the same time, by using multi-sensor fusion to detect obstacles and adopting a dynamic window trajectory planning method, it can achieve autonomous obstacle avoidance and continuous walking in complex obstacle environments, thereby improving the overall intelligence and operational continuity of the robot in field tasks. Attached Figure Description
[0015] Figure 1 This is a structural framework diagram of a legged robot.
[0016] Figure 2 Network architecture diagram for terrain feature extraction.
[0017] Figure 3 This is a diagram of the network architecture for target detection.
[0018] Figure 4 This is a flowchart of gait switching. Detailed Implementation
[0019] This invention provides a terrain-guided gait generation method. It introduces a terrain feature extraction module based on a deep convolutional neural network to fuse point cloud features and image features, extracting high-level semantic features containing information on ground roughness and slope in off-road environments to support gait planning for legged robots. Simultaneously, an obstacle detection module based on an attention network is used for obstacle detection, enabling the legged robot to autonomously avoid obstacles in complex terrains. Furthermore, when entering a new terrain area, the aforementioned terrain feature extraction module can be used to regenerate stride length and stride frequency adapted to the current terrain environment, ensuring a smooth transition to the new walking state and improving the adaptability of legged robots in dynamic, unpredictable off-road environments with varying obstacle distributions.
[0020] The specific implementation process is as follows: S1. Terrain perception steps: First, as... Figure 1 As shown, the legged robot uses an equipped LiDAR and a vision camera to acquire terrain information. The LiDAR generates 3D point cloud data of the terrain, while the vision camera generates 2D image data. Both types of data are used together for terrain feature analysis. For the image data acquired by the vision camera, normalization is first performed, normalizing the pixel values to the range [0,1], as shown in the following formula:
[0021] in, For the original image, and These represent the minimum and maximum pixel values of the image, respectively. The normalized image data is then input into a deep learning model, where a convolutional neural network (CNN) is used to extract terrain features.
[0022] For point cloud data acquired by LiDAR, downsampling is first performed using a voxel grid downsampling algorithm to reduce the amount of data, as shown in the following formula:
[0023] in, P The raw point cloud data, This is the downsampled point cloud data. The downsampled point cloud data is then input into the PointNet++ deep point cloud network to extract terrain features.
[0024] Next, a fusion module is used to fuse the extracted point cloud features with image features to obtain a fused representation of the terrain features. The network structure is as follows: Figure 2 As shown: To enable the network to extract slope and roughness features of the terrain, slope and roughness branches are further added to the network's output. Specifically, the slope branch is trained using the mean squared error loss function.
[0025] in, To predict the slope value, This represents the actual slope value. N This represents the number of training samples.
[0026] In the roughness branch, the root mean square error is used as the loss function:
[0027] in, To predict the slope value, Here, represents the actual slope value, and N represents the number of training samples. Through training with the aforementioned loss function, the deep neural network mounted on the legged robot can extract rich slope and roughness features of the terrain.
[0028] S2. Gait Planning Steps: The terrain roughness and slope extracted by the above modules are used to adjust the stride length and stride frequency of the legged robot. Specifically, the stride length is calculated first: The slope output by the neural network is then... With roughness Normalize, ,
[0029] in, This is the maximum slope that a legged robot can adapt to. It is the maximum tolerable roughness.
[0030] Secondly, calculate the impact of slope in different directions (uphill, downhill, side slope): =
[0031] Then, an adaptive roughness decay function is introduced to correct the roughness effect:
[0032] in, This represents the roughness sensitivity threshold.
[0033] Next, the nonlinear fusion function of slope and roughness:
[0034] Finally, by combining linear combination and nonlinear fusion functions, the complete step size calculation formula is obtained:
[0035] in, It is the maximum step length on flat terrain, determined by the mechanical structure.
[0036] After completing the step length calculation, begin calculating the step frequency: First, calculate the combined quantitative value of slope and roughness, using the following formula:
[0037] in, θ The slope value is the output of the deep neural network. This represents the roughness output by the deep neural network. This formula indicates that the steeper the slope or the more rugged the terrain, the higher the terrain complexity. The larger.
[0038] Secondly, the normalized processing of the robot's load mass on the step frequency is calculated using the following formula:
[0039] in, This represents the robot's current total mass (including load). This is the baseline mass of the robot when it is unloaded. This is the mass of the robot when it is not carrying a load. When the load is heavy, M=1; if the load increases, the value of M increases proportionally. This formula reflects the effect of increased mass on the robot's motion inertia: the heavier the load, the more torque the joint drive motors need to output to maintain acceleration, thus requiring a reduction in step frequency to avoid exceeding power limits or instability.
[0040] Taking into account both terrain complexity and quality normalization parameters, the optimal step frequency calculation formula is as follows:
[0041] in, This is the robot's maximum step frequency under flat, unloaded conditions (determined by hardware performance). α and β Weighting coefficients for terrain and quality (default values) α =0.2, β =0.1). The 1 in the denominator of the formula represents the unperturbed term under the baseline condition. αT Quantifying the suppressive effect of terrain complexity on step frequency. β(M 1) Quantify the negative impact of load increments.
[0042] S3. Obstacle Avoidance Steps: Use sensors installed at the front of the robot to detect whether there are obstacles in front, and adjust the trajectory of the movement according to the detection results to avoid collisions.
[0043] like Figure 3 As shown, this invention utilizes an improved deep learning network that integrates LiDAR point clouds and camera image inputs to achieve accurate obstacle detection through cross-modal feature alignment. Specifically, the LiDAR point cloud is processed by an improved PointNet++ network to extract 3D geometric features (such as obstacle distance, height, and density distribution), while the binocular camera identifies 2D object bounding boxes using a lightweight YOLOv7 network. Then, a multi-feature fusion module is employed to achieve deep fusion of LiDAR point cloud features and image features: a simple channel attention module is used to select important fusion features. This fusion module can be represented as follows:
[0044] Where [·,·] represents the splicing operation along the channel dimension. It is a function that fuses visible light features and laser point cloud features through a 3×3 convolutional layer, used to reduce the number of channels for dimensionality reduction and feature stitching.
[0045] The object detection algorithm uses classification loss and localization loss to optimize the object detection head. The classification loss is used to predict the category of the detected object, and the formula is defined as follows:
[0046] Where N is the number of samples, It is the true label of sample i. These are the predicted labels output by the model.
[0047] The localization loss is used to match the difference between the target's true location and its predicted location. The formula is defined as follows:
[0048] After completing target detection, path planning is further performed based on the detection of obstacles in the road. Specifically: First, the selectable linear velocity of the legged robot at the current moment is defined. Scope: ,
[0049] Then, considering the acceleration limitations and braking capabilities of the legged robot, the linear velocity is generated. Dynamic windows:
[0050]
[0051] in and These are the current linear velocity and angular velocity. and It is the maximum acceleration corresponding to linear velocity and angular velocity. Indicates the planning period.
[0052] Next, regarding the candidate speed ( Predict the trajectory in the next T seconds:
[0053]
[0054]
[0055] in,( () is the pose at time t.
[0056] Then, the reward value is calculated based on the predicted trajectory, thus identifying the optimal speed pair first. ): ( ) = arg
[0057] Among them, Heading ( This is used to calculate the alignment between the current trajectory endpoint and the target direction. Heading=1-
[0058] Clearance This is used to calculate the maximum distance between the trajectory and the nearest obstacle. Clearance=
[0059] Based on the above formula, the optimal path can be selected.
[0060] S4. Gait switching steps: as follows Figure 4 As shown, when the robot enters another terrain area (e.g., from a hillside to a plain), the terrain perception module 2 re-extracts the terrain information and transmits the extracted terrain information to the gait planning module 3 to regenerate the stride length and stride frequency that can adapt to the current terrain environment, ensuring that the robot can smoothly transition to the new walking state.
[0061] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A terrain-guided gait generation method, characterized in that, Includes the following steps: S1. Obtain terrain data of the environment where the legged robot is located, extract features from the terrain data, and obtain terrain feature information that characterizes the terrain slope and roughness. S2. Based on the terrain feature information, dynamically calculate and adjust the stride length and stride frequency of the legged robot; S3. Real-time detection of obstacles in the direction of travel of the legged robot, and planning of obstacle avoidance trajectory based on the detection results; S4. When the legged robot enters a new terrain area, repeat steps S1 and S2 to generate a step length and step frequency adapted to the new terrain area.
2. The terrain-guided gait generation method according to claim 1, characterized in that, The S1 step specifically includes: The terrain's 3D point cloud data is acquired using LiDAR, and its 2D image data is acquired using a visual camera. Feature extraction is performed on the three-dimensional point cloud data and the two-dimensional image data using a point cloud processing network and a convolutional neural network, respectively. The extracted point cloud features are fused with image features, and the terrain feature information is output through a network branch dedicated to predicting terrain slope and roughness.
3. The terrain-guided gait generation method according to claim 2, characterized in that, The process of calculating the step size in step S2 includes: The slope and roughness values in the terrain feature information are normalized. Based on the normalized slope value, the slope influence factor is calculated according to different travel directions; Calculate the roughness influence factor based on the normalized roughness value; The slope influence factor and the roughness influence factor are combined with a nonlinear fusion function to calculate the recommended step size under the current terrain.
4. The terrain-guided gait generation method according to claim 2, characterized in that, The process of calculating the step frequency in step S2 includes: Based on the slope and roughness values in the terrain feature information, a quantitative value for terrain complexity is calculated. Calculate the robot load impact factor based on the current load mass of the legged robot; By combining the quantified value of terrain complexity with the robot load influence factor and introducing a preset weighting coefficient, the recommended step frequency under the current terrain and load conditions is calculated.
5. The terrain-guided gait generation method according to claim 1, characterized in that, The S3 step specifically includes: By fusing lidar point cloud data and camera image data, obstacles are identified using a deep learning object detection network. Within the velocity dynamic window, multiple candidate combinations of linear velocity and angular velocity are sampled, and the future motion trajectory corresponding to each velocity combination is predicted. The reward value for each predicted trajectory is calculated by an evaluation function that takes into account at least the alignment of the trajectory endpoint toward the target direction and the distance between the trajectory and the obstacle. The speed combination corresponding to the trajectory with the highest reward value is selected as the current optimal control command.
6. The terrain-guided gait generation method according to claim 4 or 5, characterized in that, The S4 step specifically includes: Continuously monitor changes in terrain features; When the change in terrain features exceeds a preset threshold, it is determined that the legged robot has entered a new terrain area, and step S1 is triggered to re-extract terrain feature information. Based on the newly extracted terrain feature information, step S2 is performed to recalculate and switch to step length and step frequency adapted to the new terrain area.
