RobotGuide

Robotics core · topic B9 · 50 hours

Whole-body control (WBC & QP)

The core algorithm of humanoids. Walking, carrying, surviving a shove — underneath, all of it is solving one constrained optimization.

Specialization stage · Hardcore
Algorithm · Proficient System software · Aware

What to learn

The lesson · plain words

A humanoid or quadruped must satisfy dozens of things every millisecond: feet must not slip, the body must not tip, footsteps must land accurately, torques must stay in range, joints must not hit limits. Written down in math, that pile is one quadratic program: a QP.

This page does no derivations, only intuition: a QP is «inside the fence the constraints build, find the point closest to your wish».

QP: the point you want gets pushed back into the feasible set

Drag the target below: inside the constrained region the solution is the target itself; drag it out and the solution gets pressed onto the boundary — the feasible point nearest you. Whole-body control, MPC, trajectory optimization: underneath, all of them are this one step.

Notice which edge the solution sits on: the violated constraint is the one talking. That is why the first debugging act in WBC is looking at «which constraints are saturating».

Interactive figure · drag it and see

What this figure shows: a two-dimensional feasible region fenced by linear constraints, with a draggable target (cross) — the solution (dot) is the target itself when inside the region, and the nearest feasible point on the boundary when outside. Takeaway: a solution hugging an edge means that constraint is active — in whole-body control, «which constraints are saturating» is the first thing a field engineer checks.

The task pyramid: who yields to whom

Not all tasks can hold at once. A typical priority: centroidal momentum > foothold placement > body attitude > swing-leg trajectory > joint limits. Higher tasks always win.

Two implementations: strict hierarchy (solve layer by layer) or weighting (one big QP with weights). The weighting trap: absolute weight values mean nothing — the ratios drive behavior. That sentence again.

Contact is a constraint, not an input

A foot on the ground: the floor can push but never pull (a unilateral constraint), and friction must stay inside the friction cone — or the foot slides. Both go into the QP, and only then does the robot «actually stand».

A classic field failure is a wrong friction coefficient: the planner reasons for μ = 0.8 while the world is wet tile at 0.1, and the foot skids the instant it lands.

Why solve it again every millisecond

The state never stops changing, so a QP solution is valid only for this instant. Real-time operation means producing a solution at the millisecond scale — which makes the solver itself an engineering centerpiece (qpOASES, OSQP, and friends).

There must be a fallback when no solution arrives: reuse last frame's solution, or degrade to a safe posture. On real hardware «no solution found» is not an exception — it is a fall.

Three questions — do you really get it?

1. The QP solution sits exactly on a constraint boundary — what does that tell you?

  • AThe solver is buggy
  • BThat constraint is active (the target wants to violate it)
  • CThe target is inside the feasible set
Show answer

B. With the target inside, the solution is the target. Solution on the edge means the target wanted out and this constraint stopped it.

2. The friction-cone constraint got left out — the typical symptom?

  • AJoint-limit alarms
  • BThe foot slides on landing and the robot cannot hold
  • CSolve time grows
Show answer

B. Without the cone, the planner may demand ground reaction forces beyond what friction can supply — on hardware, landing slips.

3. Why must WBC re-solve the QP at millisecond rate?

  • ATo save power
  • BFor smoother output
  • CThe state keeps changing — old solutions expire immediately
Show answer

C. Control and estimation are «this instant» business. Solve too slowly and you are acting on stale information.

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 write a «keep balance + track the end effector» task as a QP, explain the geometry of null-space projection, and say why the friction-cone constraint is a second-order cone.

The Chinese edition carries the full topic page for Whole-body control (WBC & QP), including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/B9/.