Legged locomotion
How a four-legged robot stays up while it moves: gaits and their timing, the support polygon, static and dynamic stability, and the foot-placement rule that Strido's trot generator uses.
In Strido
The scripted gait is TrotGait in packages/strido-core/src/strido/gait.py, shared by MuJoCo, Gazebo and the real robot (via ros2/strido_control/strido_control/gait_node.py). The learned policy (packages/strido-sim/) receives a clock with the same GAIT_PERIOD_S in packages/strido-core/src/strido/policy.py). Practical usage is in Kinematics and gaits.
Gaits as timing patterns
A gait is a periodic pattern of foot contacts. Each leg
where
Gaits differ only in
| Gait | Duty factor | Offsets (FL, FR, RL, RR) | Feet on ground |
|---|---|---|---|
| Walk (crawl) | always | ||
| Trot | 2 (a diagonal pair) | ||
| Pace | 2 (a lateral pair) | ||
| Bound | 2 (front or rear pair) |
With
Centre of mass and the support polygon
The centre of mass (CoM) of bodies with masses
The support polygon is the convex hull of the contact points projected onto the ground. A robot standing still (or moving slowly enough that inertia is negligible) is statically stable if the ground projection of the CoM lies inside this polygon: gravity then produces no net tipping moment about any polygon edge.
The static stability margin is the shortest distance from the projected CoM to the polygon's boundary:
Beyond statics: ZMP and the capture point
When the body accelerates, inertial forces add to gravity. The zero-moment point (ZMP) is the point on the ground where the horizontal moments of gravity plus inertia vanish. For a point mass at height
The contact forces can only push, so the ZMP must stay inside the support polygon; if the plan demands a ZMP outside it, a foot rolls or lifts and the robot tips. ZMP planning is the classic tool for walking humanoids.
The same pendulum gives the capture point (instantaneous capture point, divergent component of motion). Its dynamics
is where a foot must be placed for the body to come to rest above it. Intuition: the faster you are moving, the further ahead you must step to stop.
Worked example. Strido's default body height is GaitConfig.body_height). Then
At the maximum forward command
Raibert-style foot placement
Marc Raibert's hopping and running machines decomposed control into three parts: hopping height, body attitude, and forward speed via foot placement. The idea: during stance the body moves a distance
The feedback term
How Strido's trot generator works
TrotGait is a deliberately simple, deterministic, open-loop version of the above (no feedback term, GaitConfig:
| Parameter | Value | Meaning |
|---|---|---|
period | full cycle | |
duty | trot: stance and swing equal | |
step_height | swing apex | |
body_height | hip axis above the feet | |
max_linear | command clamp | |
max_yaw_rate | command clamp |
PHASE_OFFSET gives FL and RR
Per-foot velocity. For a command
where
Stance. With normalised stance progress
Swing. With
So each foot lands at clamp_leg). With a zero command the feet stay at their nominal stance.
Worked example. Forward command
Each foot sweeps from
For a pure turn, packages/strido-core/src/strido/geometry.py), so
Limitations. Being open-loop, the generator does not react to pushes, slips or tilt: nothing moves the foot further forward when the body is too fast. That is the gap the learned policy fills — it sees the IMU and can learn feedback (see Reinforcement learning).
Check yourself
A gait has
. How many feet are on the ground at any instant, and can it be statically stable? Answer
Each leg is airborne for 20 % of the cycle; with staggered offsets only one leg swings at a time, so at least three feet are down. Yes, if the CoM stays inside the support triangle.
Why is the static stability margin of a trot almost always non-positive?
Answer
Only two diagonal feet support the body, so the support polygon is a line segment; the CoM projection lies on it only by chance, never strictly inside it.
In
TrotGait, what is the stride length at, and where does the foot land? Answer
; the foot lands ahead of nominal. What does raising
body_heightdo to the capture-point time constant?Answer
grows, so the body tips more slowly but the capture point lies further ahead for the same speed. Which Raibert term is missing from Strido's trot, and what does that mean?
Answer
The speed-feedback term
. The gait cannot correct speed errors or disturbances.
Further reading
- M. H. Raibert, Legged Robots That Balance, MIT Press, 1986.
- B. Siciliano and O. Khatib (eds.), Springer Handbook of Robotics, 2nd ed., 2016 — chapters on legged robots and walking.
- J. Pratt, J. Carff, S. Drakunov and A. Goswami, "Capture Point: A Step toward Humanoid Push Recovery", IEEE-RAS Humanoids, 2006.
- M. Vukobratović and B. Borovac, "Zero-Moment Point — Thirty Five Years of Its Life", International Journal of Humanoid Robotics, 2004.
- R. B. McGhee and A. A. Frank, "On the stability properties of quadruped creeping gaits", Mathematical Biosciences, 1968.