Intermediate

Humanoid Robot Locomotion

Bipedal walking is one of the hardest problems in robotics - humans do it effortlessly, but it requires solving balance, dynamics, and terrain adaptation simultaneously.

The Challenge of Bipedal Walking

Bipedal walking is inherently unstable. A two-legged robot is essentially a controlled fall - constantly tipping forward and catching itself with the next step. This requires:

  • Dynamic balance: Maintaining the center of mass over a small support polygon (the feet)
  • Gait generation: Coordinating joint angles and timing for smooth, efficient walking
  • Impact absorption: Handling the forces when a foot strikes the ground
  • Adaptation: Adjusting to uneven terrain, slopes, and external disturbances

Classical Control Approaches

Traditional locomotion uses model-based control:

MethodDescriptionPros/Cons
ZMP ControlKeep the Zero Moment Point within the support polygonReliable but produces stiff, unnatural gaits
LIPMLinear Inverted Pendulum Model simplifies the robot to a point mass on a massless legComputationally fast, limited to flat terrain
Whole-Body ControlOptimize full-body dynamics with constraintsNatural motion but computationally expensive
CPGCentral Pattern Generators produce rhythmic locomotion patternsBio-inspired, robust, but hard to tune

RL-Based Locomotion

Modern humanoid robots increasingly use reinforcement learning for locomotion. The policy network maps sensor observations to joint torques:

Python - RL Locomotion Training
import torch
from isaacgym import gymapi

# Observation space: joint positions, velocities, IMU data
# Action space: target joint positions for PD controller

class LocomotionPolicy(torch.nn.Module):
    def __init__(self, obs_dim=48, act_dim=12):
        super().__init__()
        self.network = torch.nn.Sequential(
            torch.nn.Linear(obs_dim, 256),
            torch.nn.ELU(),
            torch.nn.Linear(256, 256),
            torch.nn.ELU(),
            torch.nn.Linear(256, act_dim),
        )

    def forward(self, obs):
        return self.network(obs)

# Reward function components:
# + Forward velocity tracking
# + Upright torso orientation
# - Energy consumption
# - Joint torque penalties
# - Foot slip penalty

Terrain Adaptation

Real-world robots must handle diverse terrain. Modern approaches use:

  • Heightmap encoding: A terrain scan around the robot's feet is encoded as input to the policy network
  • Privileged learning: Train with ground-truth terrain info in simulation, then distill to a vision-only policy for deployment
  • Curriculum learning: Gradually increase terrain difficulty during training - start on flat ground, progress to stairs and rough terrain

Dynamic Movement

Beyond walking, advanced humanoid locomotion includes:

  • Running: Both feet leave the ground (flight phase), requiring different balance strategies
  • Stair climbing: Precise foot placement and weight shifting
  • Recovery: Regaining balance after pushes or trips
  • Crouching and crawling: Navigating constrained spaces
Key takeaway: Bipedal locomotion has shifted from classical control methods to RL-based policies trained in simulation. The combination of massively parallel simulation, domain randomization, and curriculum learning produces robust walking policies that transfer to real hardware.

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.