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.
What to learn
- Gait phases, stance versus swing, foothold planning
- Two stability criteria: ZMP (zero moment point) and CP (capture point), and when each applies
- The convex-MPC gait pipeline in full: state equation, constraints, receding-horizon solve
- RL gait reward design and domain randomization, and how it trades off against the model-based route
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
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
- Tuned only on flat floor: a 2 cm doorstep knocks it over, because foothold planning has no terrain term
- Chasing stability with a higher step frequency: current and temperature spike, and it derates after ten minutes of walking
You have learned enough when
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/.