RobotGuide

Robotics core · topic B10 · 45 hours

Legged locomotion & gaits

The mobility of quadrupeds and humanoids lives here. Also one of the most job-dense algorithm directions in the China market.

Specialization stage · Hardcore
Algorithm · Proficient System software · Aware Mechanical · Aware

What to learn

The lesson · plain words

Wheels fear stairs; legs go anywhere — the price is that control is a hundred times harder. Every millisecond, four legs switch between «stance» and «swing», and that switching schedule is the gait.

This page gets gaits straight: it is not «how the legs move» but «at each instant, how many legs are on the ground».

A gait = one phase table

Each leg gets a phase; a gait is a rule about phase offsets: walk staggers the legs by 0.25 in turn; trot pairs the diagonal legs; pace pairs the same-side legs. Duty factor is «stance time as a share of the whole cycle».

Click through the gait buttons below and watch the stance legs (blue) and swing legs (orange) change shifts, and where the center of mass sits.

Interactive figure · drag it and see

What this figure shows: phase bars for the four legs (LF/RF/LH/RH) across three gaits — walk, trot, pace — where blue is stance (on the ground) and orange is swing (in the air), plus the center-of-mass position over the support pattern. Takeaway: a gait is a rule about phase offsets; duty factor 0.75 (walk) keeps at least three feet down at all times, duty 0.5 (trot) keeps only a diagonal pair — that one number decides static versus dynamic balance.

Static balance and dynamic balance

Walk at duty 0.75: at least 3 legs on the ground at every instant, the center of mass always inside the support triangle — it can stop on a dime. Slow, but safe. Trot at duty 0.5: only a diagonal pair remains, the center of mass balanced on a support line by inertia.

«Can it stop instantly?» is the practical criterion separating the two. Toy quadrupeds walk; racing dogs all trot — fast, and they fall just as fast.

Layering: simple models plan, whole-body control executes

Directly optimizing all 12 joints whole-body is too expensive. The mainstream is layered: plan the center-of-mass trajectory and footholds with a reduced model like the linear inverted pendulum (LIP) — one or two states.

The whole-body controller (B9's QP) then translates «CoM command + footholds + swing trajectories» into torques for 12 joints. Layering is not a compromise — it is the balance point between compute and performance.

Why quadrupeds went first and humanoids arrive later

A quadruped: 12 joints, four support points, a big redundancy margin — one leg slips and three still carry. A biped alternates between two points; any single misstep is a fall.

So the industry order is quadrupeds first (inspection, transport), humanoids after (general manipulation). Understand this redundancy gap and you understand the industry timeline.

Three questions — do you really get it?

1. In a trot gait, how many legs are in stance at any instant?

  • A3
  • B1
  • C2 (the diagonal pair)
Show answer

C. Diagonal pairs move in sync; at duty 0.5 stance and swing split evenly. The support region is a line — balance is dynamic.

2. «Can stop instantly at any moment» corresponds to which balance?

  • ADynamic balance
  • BEither one
  • CStatic balance (CoM inside the support polygon)
Show answer

C. When the support region covers the CoM, cutting all torque still stands. Dynamic balance leans on inertia — an instant stop is a fall.

3. The mainstream control architecture for legged robots?

  • AIndependent PID on each of 12 joints
  • BPure end-to-end reinforcement learning
  • CReduced-model CoM planning plus whole-body QP execution
Show answer

C. Layering is the mainstream: the model predicts the big picture and the QP handles the constraints. Pure RL has landed too, but explainability and safe fallbacks remain open engineering problems.

Keep going deeper

Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.

How it fails in the field

You have learned enough when

You can explain the difference between ZMP and CP, name the four components of a convex-MPC gait, and compare the engineering costs of model-based versus RL gaits.

The Chinese edition carries the full topic page for Legged locomotion & gaits, including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/B10/.