> For the complete documentation index, see [llms.txt](https://doc.ancorasir.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ancorasir.com/2026spring/selected-topics-in-humanoids/class-12-humanoid-contact.md).

# Class 12: Humanoid Contact

This chapter organizes humanoid control from task-space feedback and centroidal models through whole-body optimization, compliant interaction, and model predictive control. The recurring theme is how a floating-base robot coordinates motion and contact forces under physical constraints.

### Contents

1. Motivation and scope
2. Mathematical preliminaries and notation
3. Control architecture for humanoid robots
4. Floating-base dynamics and control implications
5. Task-space control and operational-space ideas
6. Centroidal dynamics and reduced-order balance control
7. Whole-body control
8. Impedance, admittance, and force regulation
9. Model predictive control for humanoids
10. Control of locomotion, manipulation, and loco-manipulation
11. From theory to implementation
12. Research directions and open problems
13. Summary of key takeaways
14. Suggested implementation roadmap for students
15. References for further study

### 1. Motivation and scope

#### 1.1 Why humanoid control is fundamentally different

Humanoid control is not simply “robot control with more joints.” A humanoid is a floating-base multibody system that must coordinate many degrees of freedom while maintaining balance, respecting contact constraints, and performing tasks with the upper and lower body at the same time. Unlike a fixed-base industrial manipulator, a humanoid cannot directly command the wrench of its base with respect to the world. The robot can only influence its global motion through internal joint torques and external contact forces.

This one fact makes humanoid control qualitatively different from standard manipulator control. The controller is not only trying to move links to target poses. It must decide, explicitly or implicitly, how whole-body motion, contact forces, and task priorities interact. The robot should simultaneously:

* stabilize itself under gravity;
* satisfy contact constraints at the feet and possibly hands;
* regulate the center of mass (CoM), linear momentum, and angular momentum;
* track operational tasks such as swing-foot placement, hand trajectories, gaze, or posture;
* keep joint torques, contact forces, and friction demands feasible;
* transition robustly between contact modes.

In other words, humanoid control is a structured coordination problem over motion, force, and contact.

#### 1.2 The predictive-reactive view of humanoid control

A useful high-level view is that modern humanoid control often follows a **predictive-reactive hierarchy**. A predictive layer reasons over a future horizon, often with reduced-order models such as centroidal dynamics or linear inverted pendulum variants, to produce references for balance, footsteps, or net wrenches. A reactive layer then resolves the full-body motion and force distribution subject to instantaneous constraints. In much of the recent literature, this combination takes the form of a model predictive controller (MPC) coupled with a local whole-body controller (WBC).

This hierarchy is attractive because different time scales and different model complexities are handled where they fit best:

* long-horizon balance and motion intent are planned predictively;
* fast constraint enforcement and task coordination are handled reactively;
* reduced-order models provide speed;
* full-order inverse dynamics or kinematics provide physical consistency.

#### 1.3 Scope of these notes

These notes develop a graduate-level introduction to humanoid control with emphasis on model-based methods. The goal is to connect classical robot control ideas to the realities of floating-base balance, multi-contact interaction, and whole-body coordination.

The notes cover:

* floating-base equations of motion and why underactuation matters;
* task-space and operational-space viewpoints;
* centroidal dynamics and reduced-order balance models;
* whole-body control formulations based on kinematics, inverse dynamics, and optimization;
* impedance and force regulation for physical interaction;
* model predictive control for humanoid locomotion and loco-manipulation;
* implementation-oriented guidance, including solver structure, estimation interfaces, contact scheduling, and debugging.

The notes do **not** attempt a full treatment of humanoid learning-based control. Reinforcement learning, imitation learning, and foundation-model-based decision making are intentionally left to the subsequent Humanoid Learning class.

***

### 2. Mathematical preliminaries and notation

#### 2.1 Configuration and generalized velocity

Let the humanoid configuration be

$$
\mathbf{q} = \begin{bmatrix} \mathbf{q}\_b \ \mathbf{q}\_a \end{bmatrix},
$$

where $\mathbf{q}\_b$ denotes the floating-base pose and $\mathbf{q}\_a \in \mathbb{R}^{n\_a}$ denotes the actuated joint coordinates.

The generalized velocity is

$$
\mathbf{v} = \begin{bmatrix} \mathbf{v}\_b \ \dot{\mathbf{q}}\_a \end{bmatrix} \in \mathbb{R}^{n\_v},
$$

where $\mathbf{v}\_b \in \mathbb{R}^6$ is the spatial velocity of the base.

For floating-base systems, it is usually better to formulate dynamics in terms of $(\mathbf{q}, \mathbf{v})$ rather than $(\mathbf{q}, \dot{\mathbf{q}})$ because orientation coordinates are not always globally smooth or minimal.

#### 2.2 Equations of motion

The standard floating-base rigid-body dynamics under contact are

$$
\mathbf{M}(\mathbf{q}) \dot{\mathbf{v}} + \mathbf{h}(\mathbf{q}, \mathbf{v})
\=\mathbf{S}^\top \boldsymbol{\tau}
\+
\mathbf{J}\_c(\mathbf{q})^\top \boldsymbol{\lambda}.
$$

Here:

* $\mathbf{M}(\mathbf{q}) \in \mathbb{R}^{n\_v \times n\_v}$ is the mass matrix;
* $\mathbf{h}(\mathbf{q}, \mathbf{v})$ collects Coriolis, centrifugal, gravity, and possibly modeled passive effects;
* $\mathbf{S}$ selects actuated coordinates;
* $\boldsymbol{\tau} \in \mathbb{R}^{n\_a}$ is the joint torque vector;
* $\mathbf{J}\_c(\mathbf{q})$ is the contact Jacobian;
* $\boldsymbol{\lambda}$ parameterizes the contact force or contact wrench variables.

The actuation matrix

$$
\mathbf{S} = \begin{bmatrix} \mathbf{0}*{n\_a \times 6} & \mathbf{I}*{n\_a} \end{bmatrix}
$$

captures underactuation: the base coordinates are not directly actuated.

#### 2.3 Contact constraints

If a contact frame is assumed to stick relative to the environment, then its velocity must vanish:

$$
\mathbf{J}\_c(\mathbf{q}) \mathbf{v} = \mathbf{0}.
$$

Differentiating gives the acceleration-level constraint:

$$
\mathbf{J}\_c(\mathbf{q}) \dot{\mathbf{v}}
\+
\dot{\mathbf{J}}\_c(\mathbf{q}, \mathbf{v}) \mathbf{v}
\=\mathbf{0}.
$$

Together with the equations of motion, this creates a constrained dynamics system in the unknown acceleration and contact force:

$$
\begin{bmatrix}
\mathbf{M} & -\mathbf{J}\_c^\top \\
\mathbf{J}\_c & \mathbf{0}
\end{bmatrix}
\begin{bmatrix}
\dot{\mathbf{v}} \\
\boldsymbol{\lambda}
\end{bmatrix}
\=\begin{bmatrix}
\mathbf{S}^\top \boldsymbol{\tau} - \mathbf{h} \\
-\dot{\mathbf{J}}\_c \mathbf{v}
\end{bmatrix}.
$$

#### 2.4 Task maps and Jacobians

A task variable $\mathbf{x}(\mathbf{q})$ may describe:

* hand position or pose;
* swing-foot pose;
* CoM position;
* torso orientation;
* gaze direction;
* relative object pose.

Its differential kinematics are

$$
\dot{\mathbf{x}} = \mathbf{J}\_x(\mathbf{q}) \mathbf{v},
$$

and its acceleration is

$$
\ddot{\mathbf{x}} = \mathbf{J}\_x(\mathbf{q}) \dot{\mathbf{v}} + \dot{\mathbf{J}}\_x(\mathbf{q}, \mathbf{v}) \mathbf{v}.
$$

These relations are the basic building blocks for task-space feedback and whole-body optimization.

#### 2.5 Centroidal quantities

Let $\mathbf{c}$ be the CoM. The centroidal momentum is

$$
\mathbf{h}\_G =
\begin{bmatrix}
\mathbf{l} \\
\mathbf{k}
\end{bmatrix},
$$

where $\mathbf{l}$ is linear momentum and $\mathbf{k}$ is angular momentum about the CoM.

The centroidal momentum matrix $\mathbf{A}\_G(\mathbf{q})$ satisfies

$$
\mathbf{h}\_G = \mathbf{A}\_G(\mathbf{q}) \mathbf{v}.
$$

The centroidal dynamics are

$$
m \ddot{\mathbf{c}} = \sum\_i \mathbf{f}\_i + m \mathbf{g},
$$

$$
\dot{\mathbf{k}} = \sum\_i (\mathbf{p}\_i - \mathbf{c}) \times \mathbf{f}\_i + \sum\_i \boldsymbol{\mu}\_i,
$$

where $(\mathbf{p}\_i, \mathbf{f}\_i, \boldsymbol{\mu}\_i)$ denote the location, force, and moment of contact $i$.

These equations are central because they reduce full-body behavior to the net effect of contact wrenches on global motion.

***

### 3. Control architecture for humanoid robots

#### 3.1 A layered view

A practical humanoid controller is rarely a single monolithic law. Most systems use layers operating at different time scales:

1. **State estimation and contact estimation**\
   Estimate base pose, velocity, IMU state, contact states, and sometimes contact forces.
2. **Mode and gait scheduling**\
   Decide whether the robot is in double support, single support, hand support, or a transition state.
3. **Predictive motion generation**\
   Compute future references for CoM, momentum, footsteps, or net contact wrench over a horizon.
4. **Whole-body control / inverse dynamics**\
   Convert those references into instantaneous accelerations, torques, and contact forces that satisfy the robot constraints.
5. **Joint-level tracking and motor control**\
   Execute commanded torques, currents, or positions with high-rate servo loops.

This layered decomposition exists because no single model is equally suitable for all time scales and all computational budgets.

#### 3.2 Why hierarchy matters

The most important reason for hierarchy is not software modularity. It is **model mismatch across scales**.

* Long-horizon planning can tolerate simplified dynamics if it captures the correct balance structure.
* Short-horizon constraint satisfaction must use more accurate kinematics and contact models.
* Actuator dynamics, delays, and drive electronics require still faster loops.

Humanoid control is not “one controller,” but an architecture in which different mathematical objects talk to one another.

#### 3.3 Common architectural patterns

Three common patterns appear repeatedly.

**(a) Reduced-order planner + WBC**

A reduced model such as LIP, centroidal dynamics, or a wrench model plans balance-related quantities. A WBC then produces full-body commands.

**(b) Task-space inverse dynamics**

A local optimization computes accelerations, torques, and contact forces directly from task errors and constraints, often without a separate long-horizon planner in simpler tasks.

**(c) MPC + inverse dynamics**

A predictive controller produces future momentum or contact-force references, while inverse dynamics enforces full-body consistency at high rate.

The current literature strongly favors predictive-reactive hierarchies, especially MPC combined with WBC.

***

### 4. Floating-base dynamics and control implications

#### 4.1 Underactuation and the role of contact

For a fixed-base manipulator, inverse dynamics can in principle produce any sufficiently smooth acceleration trajectory that is dynamically feasible and within torque limits. For a humanoid, this is not true because the base is unactuated. The robot cannot directly impose arbitrary global accelerations. Without contact, the generalized actuation lies in a lower-dimensional subspace.

A clean way to see this is to partition the dynamics into base and actuated rows:

$$
\begin{aligned}
\mathbf{M}\_b(\mathbf{q}) \dot{\mathbf{v}} + \mathbf{h}*b(\mathbf{q}, \mathbf{v})
&= \mathbf{J}*{c,b}^\top \boldsymbol{\lambda}, \\
\mathbf{M}\_a(\mathbf{q}) \dot{\mathbf{v}} + \mathbf{h}*a(\mathbf{q}, \mathbf{v})
&= \boldsymbol{\tau} + \mathbf{J}*{c,a}^\top \boldsymbol{\lambda}.
\end{aligned}
$$

The base equation contains no direct torque input. Global motion is shaped through contact.

#### 4.2 Contact-consistent motion

Suppose both feet are flat on the ground. Then a desired acceleration must satisfy the contact constraints:

$$
\mathbf{J}\_c \dot{\mathbf{v}} + \dot{\mathbf{J}}\_c \mathbf{v} = \mathbf{0}.
$$

If a controller asks for an acceleration incompatible with this equation, then one of three things must happen:

* the desired motion is projected into the feasible subspace;
* the contact assumption is changed;
* large tracking errors or contact violations occur.

This is why whole-body controllers work with explicit equality and inequality constraints rather than just independent joint PD loops.

#### 4.3 Contact forces are part of the control problem

In humanoid control, contact forces are not merely disturbances to reject. They are decision variables. The controller often computes

* which contacts should support load;
* how much normal force each contact should bear;
* how tangential forces should be distributed to avoid slip;
* whether internal forces should be regulated between multiple contacts.

Thus motion control and force distribution are coupled.

#### 4.4 Hybrid control viewpoint

Because contact modes switch over time, humanoid control is inherently hybrid. Each contact mode defines a different constrained dynamics manifold. The controller must therefore handle:

* within-mode continuous dynamics;
* discrete transitions such as touchdown and liftoff;
* reset events due to impact or velocity jumps;
* controller gain and task changes during transitions.

This explains why walking and loco-manipulation controllers are often written as state machines or phase-dependent optimization problems.

***

### 5. Task-space control and operational-space ideas

#### 5.1 From joint-space tracking to task-space regulation

Joint-space control is often too indirect for humanoids. A humanoid should regulate physically meaningful quantities such as:

* CoM location;
* swing-foot position and velocity;
* torso or pelvis orientation;
* hand pose relative to the world or an object;
* contact force at a support hand.

Task-space control expresses desired behavior directly in these variables.

Let a task error be

$$
\mathbf{e}\_x = \mathbf{x} - \mathbf{x}\_d,
$$

with a desired second-order servo law

$$
\ddot{\mathbf{x}}^\star
\=\ddot{\mathbf{x}}\_d - \mathbf{K}\_d \dot{\mathbf{e}}\_x - \mathbf{K}\_p \mathbf{e}\_x.
$$

Using

$$
\ddot{\mathbf{x}}
\=\mathbf{J}\_x \dot{\mathbf{v}} + \dot{\mathbf{J}}\_x \mathbf{v},
$$

the controller can impose

$$
\mathbf{J}\_x \dot{\mathbf{v}}
\=\ddot{\mathbf{x}}^\star - \dot{\mathbf{J}}\_x \mathbf{v}.
$$

This linear form is especially useful in optimization-based WBC.

#### 5.2 Operational-space intuition

Operational-space control asks a conceptually important question:

> What is the dynamic behavior of the robot as seen from a task coordinate rather than from its joints?

For fixed-base manipulators, the classic operational-space formulation introduces the task-space inertia

$$
\boldsymbol{\Lambda}\_x = \left( \mathbf{J}\_x \mathbf{M}^{-1} \mathbf{J}\_x^\top \right)^{-1},
$$

under suitable rank assumptions. This quantity tells us how difficult it is to accelerate the task in a given direction.

For humanoids under contact, an analogous idea still matters conceptually, but the presence of a floating base and contact constraints means the effective task dynamics depend on the constrained system. In practice, most humanoid systems use the operational-space intuition while implementing it through inverse dynamics or optimization rather than through closed-form decoupling.

#### 5.3 Null-space and redundancy

Humanoids are highly redundant. The same hand task may be achievable with many postures, and a given CoM task may be compatible with multiple contact-force distributions.

This suggests a hierarchy:

1. satisfy essential constraints and high-priority tasks;
2. use remaining redundancy for posture, energy, torque margin, or joint-limit avoidance.

In classical formulations this is expressed with null-space projectors. In modern optimization-based controllers it is often expressed with stacked priorities or weighted costs.

#### 5.4 Limits of pure task-space feedback

Task-space PD control alone is not enough for humanoids because it does not automatically guarantee:

* contact feasibility;
* friction satisfaction;
* torque limits;
* dynamic consistency;
* momentum consistency across tasks.

It remains important as a language for specifying desired behavior, but it is usually embedded inside a larger constrained control formulation.

***

### 6. Centroidal dynamics and reduced-order balance control

#### 6.1 Why reduced-order models are used

Full humanoid dynamics are too expensive and too detailed for every planning layer. Many control problems, especially balance and locomotion, depend more strongly on **global mass distribution and support geometry** than on finger-level or wrist-level details.

Reduced-order models abstract the robot by keeping the quantities most relevant to balance:

* CoM motion;
* net contact wrench;
* sometimes angular momentum;
* sometimes step placement.

This allows faster predictive control.

#### 6.2 Linear inverted pendulum model

The linear inverted pendulum model (LIPM) assumes:

* constant CoM height $z\_c$;
* negligible centroidal angular momentum;
* point-foot or equivalent flat-ground support simplification.

In one horizontal direction,

$$
\ddot{x} = \omega^2 (x - x\_Z), \qquad \omega = \sqrt{\frac{g}{z\_c}},
$$

where $x$ is the CoM coordinate and $x\_Z$ is the ZMP coordinate.

This model is attractive because it is linear and exposes the unstable component of CoM motion. It supports elegant concepts such as the capture point:

$$
\xi = x + \frac{\dot{x}}{\omega}.
$$

Despite its simplicity, the LIPM still underlies many controllers and teaching materials because it gives clear intuition about balance and stepping.

#### 6.3 Limits of the LIPM

The LIPM is too restrictive when:

* CoM height varies significantly;
* upper-body angular momentum matters;
* terrain is not flat;
* contacts are non-coplanar;
* hand support is important;
* manipulation loads affect whole-body balance.

Therefore it is best taught as a conceptual baseline rather than as a final humanoid control model.

#### 6.4 Centroidal dynamics as a richer reduced model

Centroidal dynamics keep the physically important global quantities:

$$
m \ddot{\mathbf{c}} = \sum\_i \mathbf{f}\_i + m \mathbf{g},
$$

$$
\dot{\mathbf{k}} = \sum\_i (\mathbf{p}\_i - \mathbf{c}) \times \mathbf{f}\_i + \sum\_i \boldsymbol{\mu}\_i.
$$

Compared with the LIPM, centroidal dynamics:

* permit varying CoM height;
* incorporate multiple contacts;
* capture angular momentum;
* represent manipulation interaction forces more naturally.

For this reason they are widely used in modern humanoid MPC.

#### 6.5 Wrench-feasibility viewpoint

A powerful control view is that balance can be seen as a wrench-feasibility problem. The controller seeks contact forces such that:

1. the resulting net wrench drives the CoM and angular momentum as desired;
2. each contact force lies within its feasible friction or wrench cone;
3. actuator and posture constraints remain satisfiable.

This perspective connects reduced-order planning directly to whole-body realization.

#### 6.6 Momentum regulation

A common centroidal control idea is to regulate momentum:

$$
\dot{\mathbf{h}}\_G^\star
\= - \mathbf{K}*h (\mathbf{h}*G - \mathbf{h}*{G,d}) + \dot{\mathbf{h}}*{G,d}.
$$

Given this desired momentum rate, one solves for contact forces or a net wrench that realizes it. Then the full-body controller maps those force objectives into consistent joint torques and accelerations.

This makes momentum a bridge between balance and full-body motion.

***

### 7. Whole-body control

#### 7.1 What whole-body control tries to do

Whole-body control (WBC) coordinates the full robot under constraints. A typical WBC simultaneously handles:

* rigid contact constraints;
* CoM or momentum regulation;
* swing-foot tracking;
* torso stabilization;
* hand pose or force tasks;
* posture regularization;
* torque and friction limits.

The essential idea is not a particular solver. It is the explicit joint treatment of tasks and constraints at the scale of the full robot.

#### 7.2 Kinematic vs dynamic WBC

**Kinematic WBC**

Kinematic WBC solves for generalized velocities or accelerations from task Jacobians and contact constraints, without explicitly enforcing the full rigid-body dynamics. It can work well when low-level torque control is unavailable or when motion generation is the priority.

**Dynamic WBC**

Dynamic WBC solves for $\dot{\mathbf{v}}$, $\boldsymbol{\tau}$, and often $\boldsymbol{\lambda}$ while enforcing the equations of motion. This is better suited to force-sensitive balance and contact-rich tasks.

#### 7.3 Optimization form of WBC

A common inverse-dynamics whole-body controller is formulated as a constrained optimization problem over the generalized acceleration, actuator torque, and contact force:

$$
\min\_{\dot{\mathbf{v}}, \boldsymbol{\tau}, \boldsymbol{\lambda}}
\quad
\sum\_j \left| \mathbf{W}\_j \left(\mathbf{J}*j \dot{\mathbf{v}} - \mathbf{b}*j \right) \right|^2
\+
\left| \mathbf{W}*{\tau} \boldsymbol{\tau} \right|^2
\+
\left| \mathbf{W}*{\lambda} \boldsymbol{\lambda} \right|^2
$$

subject to

$$
\mathbf{M} \dot{\mathbf{v}} + \mathbf{h} = \mathbf{S}^\top \boldsymbol{\tau} + \mathbf{J}\_c^\top \boldsymbol{\lambda},
$$

$$
\mathbf{J}\_c \dot{\mathbf{v}} + \dot{\mathbf{J}}\_c \mathbf{v} = \mathbf{0},
$$

$$
\mathbf{A}*{\lambda} \boldsymbol{\lambda} \le \mathbf{b}*{\lambda},
$$

$$
\boldsymbol{\tau}*{\min} \le \boldsymbol{\tau} \le \boldsymbol{\tau}*{\max},
$$

$$
\dot{\mathbf{v}}*{\min} \le \dot{\mathbf{v}} \le \dot{\mathbf{v}}*{\max}.
$$

This optimization is one of the standard mathematical forms of dynamic whole-body control. It expresses a central idea of humanoid control: the robot should realize multiple motion objectives simultaneously, but only in ways that remain dynamically feasible, contact-consistent, and actuator-feasible.

**Decision variables and physical meaning**

The unknowns are:

* $\dot{\mathbf{v}} \in \mathbb{R}^{6+n}$, the generalized acceleration of the floating-base humanoid,
* $\boldsymbol{\tau} \in \mathbb{R}^{n}$, the vector of joint torques at the actuated joints,
* $\boldsymbol{\lambda} \in \mathbb{R}^{m}$, the stacked vector of contact forces or contact wrenches.

Here $n$ is the number of actuated joints, and the extra $6$ components in $\mathbf{v}$ correspond to the unactuated floating base. It is common in humanoid control to optimize over $\dot{\mathbf{v}}$ rather than directly over $\ddot{\mathbf{q}}$, because the generalized velocity representation is often cleaner for floating-base rigid-body dynamics.

The matrix $\mathbf{M}$ is the full generalized inertia matrix, $\mathbf{h}$ collects Coriolis, centrifugal, gravity, and sometimes modeled disturbances, $\mathbf{S}$ is the actuation selection matrix, and $\mathbf{J}\_c$ is the Jacobian of the active contact constraints.

***

**Task terms in the objective**

The term

$$
\left| \mathbf{W}\_j \left(\mathbf{J}\_j \dot{\mathbf{v}} - \mathbf{b}\_j \right) \right|^2
$$

represents task $j$.

Each task defines a desired relation at the acceleration level. The matrix $\mathbf{J}\_j$ is the Jacobian associated with that task, and $\mathbf{b}\_j$ is the desired task-space acceleration after compensating for known kinematic terms. The controller tries to choose $\dot{\mathbf{v}}$ so that the realized task acceleration $\mathbf{J}\_j \dot{\mathbf{v}}$ is close to the desired one.

A common construction is

$$
\mathbf{J}\_j \dot{\mathbf{v}} + \dot{\mathbf{J}}\_j \mathbf{v} = \ddot{\mathbf{x}}\_j,
$$

where $\mathbf{x}\_j$ is the task variable, such as center-of-mass position, torso orientation, hand pose, or swing-foot pose. If a desired task acceleration $\ddot{\mathbf{x}}\_j^\star$ is specified, then the acceleration matching condition becomes

$$
\mathbf{J}\_j \dot{\mathbf{v}} \approx \ddot{\mathbf{x}}\_j^\star - \dot{\mathbf{J}}\_j \mathbf{v}.
$$

Thus one usually sets

$$
\mathbf{b}\_j = \ddot{\mathbf{x}}\_j^\star - \dot{\mathbf{J}}\_j \mathbf{v}.
$$

A standard choice for $\ddot{\mathbf{x}}\_j^\star$ is a PD-type feedback law in task space:

$$
\ddot{\mathbf{x}}*j^\star
\= \ddot{\mathbf{x}}*{j,\mathrm{ref}} + \mathbf{K}*{d,j} \big(\dot{\mathbf{x}}*{j,\mathrm{ref}} - \dot{\mathbf{x}}*j\big) + \mathbf{K}*{p,j} \big(\mathbf{x}\_{j,\mathrm{ref}} - \mathbf{x}\_j\big).
$$

This means that the optimization is not directly tracking position or velocity; rather, it is tracking a desired task acceleration generated from motion errors.

Typical tasks include:

* center-of-mass regulation,
* pelvis or torso orientation stabilization,
* swing-foot trajectory tracking,
* hand pose tracking,
* gaze direction,
* postural regularization,
* momentum regulation.

The weighting matrix $\mathbf{W}\_j$ determines how strongly task $j$ influences the solution. Larger weights push the optimizer to satisfy that task more closely. In practice, these weights encode soft priorities when all tasks cannot be satisfied exactly at the same time.

***

**Torque and contact regularization**

The terms

$$
\left| \mathbf{W}*{\tau} \boldsymbol{\tau} \right|^2
\qquad \text{and} \qquad
\left| \mathbf{W}*{\lambda} \boldsymbol{\lambda} \right|^2
$$

are regularization terms.

They do not usually represent primary control objectives. Their role is to bias the solution toward numerically well-behaved, physically reasonable actuation and contact force distributions.

The torque penalty discourages unnecessarily large actuator effort. This often improves robustness, reduces energy consumption, and prevents the optimizer from relying on aggressive torque cancellation.

The contact-force penalty regularizes the distribution of forces among multiple contacts. In double support or multi-contact motion, there are often many contact-force solutions that satisfy the same net-body dynamics. Penalizing $\boldsymbol{\lambda}$ helps avoid arbitrary force redistribution and can suppress excessive internal forces.

In some implementations, the regularization on $\boldsymbol{\lambda}$ is replaced or supplemented by a force-tracking term, especially when one wants a desired load-sharing pattern between contacts.

***

**Dynamic feasibility constraint**

The equation

$$
\mathbf{M} \dot{\mathbf{v}} + \mathbf{h} = \mathbf{S}^\top \boldsymbol{\tau} + \mathbf{J}\_c^\top \boldsymbol{\lambda}
$$

is the rigid-body dynamics of the floating-base humanoid.

This is the main physical consistency constraint in the problem. It states that the generalized inertial and bias forces must be balanced by actuator torques and contact forces.

This equation is important because task-space objectives alone do not guarantee physically realizable motion. For example, a desired swing-foot acceleration, torso motion, and center-of-mass correction might be kinematically meaningful, but they are invalid unless some torque and contact-force combination can actually produce them.

For humanoids, this constraint is essential because the base is not directly actuated. The floating base can only be accelerated indirectly through internal joint torques and environmental contacts.

***

**Contact-consistency constraint**

The equality

$$
\mathbf{J}\_c \dot{\mathbf{v}} + \dot{\mathbf{J}}\_c \mathbf{v} = \mathbf{0}
$$

enforces rigid sticking contact.

If a foot is assumed firmly planted on the ground, then its contact point should have zero acceleration relative to the environment. This equation is simply the acceleration-level version of that assumption.

It plays two roles:

* it prevents the optimizer from generating accelerations that would break the modeled contact,
* it links body motion to the contact-force solution.

For example, in quiet standing with both feet flat on the ground, the contact Jacobian corresponds to both stance feet, and this equality says that the stance feet are not allowed to move. In single support, only the stance foot appears in $\mathbf{J}\_c$, while the swing foot is removed from the contact set and becomes a tracking task instead.

When contacts change, such as during walking, the set of active constraints changes, so both $\mathbf{J}\_c$ and the feasible contact-force space change as well.

***

**Contact-force inequalities**

The inequality

$$
\mathbf{A}*{\lambda} \boldsymbol{\lambda} \le \mathbf{b}*{\lambda}
$$

collects contact-force feasibility constraints.

These constraints typically encode:

* unilateral contact: normal force must be nonnegative,
* friction-cone or friction-pyramid constraints,
* center-of-pressure bounds inside the foot support region,
* torsional moment bounds,
* contact wrench limits.

For a simple point contact with linearized friction, one may impose

$$
\lambda\_n \ge 0, \qquad
|\lambda\_t^{(x)}| \le \mu \lambda\_n, \qquad
|\lambda\_t^{(y)}| \le \mu \lambda\_n.
$$

For flat-foot contact, the constraints are often written at the wrench level, for example bounding the center of pressure inside the foot sole and limiting yaw torque about the contact normal.

These inequalities are essential because a dynamics equation can always be balanced by mathematically convenient but physically impossible contact forces. The friction and wrench constraints prevent the optimizer from using such unrealizable support forces.

***

**Torque and acceleration bounds**

The bounds

$$
\boldsymbol{\tau}*{\min} \le \boldsymbol{\tau} \le \boldsymbol{\tau}*{\max}
$$

reflect motor limits. They encode what the actuators can really produce.

The bounds

$$
\dot{\mathbf{v}}*{\min} \le \dot{\mathbf{v}} \le \dot{\mathbf{v}}*{\max}
$$

are sometimes used for numerical conditioning, safety, or conservative dynamic feasibility. They can help prevent unrealistically large accelerations that may arise from tracking conflicts or poorly tuned weights.

In some implementations, these acceleration bounds are replaced or augmented by joint-acceleration limits, jerk limits, or velocity-dependent saturation rules.

***

**Why this becomes a quadratic program**

If all task costs are quadratic and all constraints are linear in the optimization variables, then the WBC problem is a quadratic program:

$$
\min\_{\mathbf{z}} \quad \frac{1}{2}\mathbf{z}^\top \mathbf{H}\mathbf{z} + \mathbf{g}^\top \mathbf{z}
\quad
\text{subject to}
\quad
\mathbf{C}\mathbf{z} = \mathbf{d}, \qquad
\mathbf{E}\mathbf{z} \le \mathbf{f},
$$

with

$$
\mathbf{z} =
\begin{bmatrix}
\dot{\mathbf{v}} \\
\boldsymbol{\tau} \\
\boldsymbol{\lambda}
\end{bmatrix}.
$$

This is one of the reasons QP-based WBC became so dominant in humanoid robotics: it is expressive enough to encode many tasks and physical constraints, while remaining computationally tractable at servo rates.

***

**Interpretation of weighted tasks**

The weighted formulation above is a soft-priority formulation. It tries to satisfy all tasks as well as possible, but if they conflict, the optimizer resolves the conflict according to the weights.

This differs from strict hierarchical WBC, where tasks are ordered lexicographically:

1. hard physical constraints,
2. highest-priority motion task,
3. lower-priority tasks in the null space of higher-priority ones.

The weighted version is easier to implement and often works well in practice, but it does not provide absolute task priority guarantees. If a strict hierarchy is required, one may solve a sequence of QPs or use null-space projection methods. In many humanoid systems, physical feasibility constraints are always hard, while motion objectives are soft.

***

**Examples of tasks in common humanoid behaviors**

**Standing**

In quiet standing, the active contacts are usually both feet. The controller may include:

* center-of-mass regulation,
* pelvis orientation stabilization,
* upper-body posture regularization,
* equal or desired force sharing between left and right feet.

In this case, $\mathbf{J}\_c$ corresponds to the stance-foot constraints, and $\boldsymbol{\lambda}$ represents the ground reaction wrenches. The optimizer chooses torques and support forces that keep the body upright without violating friction or center-of-pressure constraints.

**Walking**

During walking, the task set changes across phases.

* In single support, the stance foot is constrained, while the swing foot is a motion task.
* In double support, both feet appear in $\mathbf{J}\_c$, and the optimizer distributes the load between them.

Typical tasks include:

* center-of-mass or momentum tracking,
* swing-foot pose tracking,
* torso stabilization,
* step-timing-consistent contact transitions.

The same optimization structure can be reused, but the contact set and task references are phase-dependent.

**Handling an object while balancing**

Suppose the humanoid holds a box while standing or walking slowly. Then the arm motion, the object-induced wrench, and the balance objective must be resolved together. One may add hand or object pose tasks while the dynamics term naturally captures the changed loading through $\mathbf{h}$ or through explicit external-wrench modeling. The contact-force optimization becomes especially important because the ground reaction forces must compensate not only for body motion but also for the object load.

***

**Internal forces and force distribution**

In multi-contact settings, the net effect of contact forces on the robot may be the same for multiple different values of $\boldsymbol{\lambda}$. Some of these differences correspond to internal forces: force components that redistribute load among contacts without changing the net external wrench on the body.

This is why regularization or explicit force objectives are useful. Without them, the QP may choose a mathematically valid but physically undesirable force distribution, such as overloading one foot or producing excessive hand contact force. In more advanced WBC formulations, internal-force control appears explicitly as an additional task or constraint.

***

**Practical remarks**

Several implementation points are important in practice.

First, the task matrices and bias terms must be updated every servo cycle from the current state estimate. This means $\mathbf{M}$, $\mathbf{h}$, $\mathbf{J}\_j$, $\mathbf{J}\_c$, and $\dot{\mathbf{J}}\_c \mathbf{v}$ are all recomputed online.

Second, the quality of the controller depends strongly on the contact model. If the controller assumes rigid sticking contact but the real foot is slipping or rocking, then the optimization is solving the wrong problem. This is one reason contact estimation and state estimation are tightly coupled to WBC in real humanoid systems.

Third, the tuning of weights matters. If a posture task is weighted too strongly relative to a balance task, the optimizer may sacrifice dynamic robustness for configuration tracking. If the regularization on torque is too strong, the robot may become sluggish. If the force penalty is too weak, contact forces may become unnecessarily aggressive.

Finally, WBC does not replace motion generation. In many systems, a higher-level planner or MPC provides desired center-of-mass, momentum, footstep, or hand trajectories, and the WBC solves the instantaneous constrained inverse-dynamics problem needed to realize those references.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.ancorasir.com/2026spring/selected-topics-in-humanoids/class-12-humanoid-contact.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
