# Contact-Implicit Whole-Body Trajectory Optimization for Dynamic Humanoid Locomotion on Parameterizable Uneven Terrain

Robotics.world

> Most trajectory planners for humanoid robots assume flat ground or require the user to specify footstep locations and contact timings in advance, which is impractical in real environments full of…

**arXiv**: 2611.05585

**Published**: 2026-11-03

**Authors**: Roberto Mauceri, Stefano Dafarra, Giulio Romualdi, Marco Gabiccini, Daniele Pucci

## In plain words

Most trajectory planners for humanoid robots assume flat ground or require the user to specify footstep locations and contact timings in advance, which is impractical in real environments full of steps, ramps, and curbs.

## AI summary

## Overview

**Research area:** Robotics — humanoid whole-body motion planning and optimal control (trajectory optimization for legged locomotion on uneven terrain).

**Technical level:** Advanced. The paper assumes familiarity with Lie group robot modeling, centroidal dynamics, complementarity conditions, and nonlinear programming.

**Scope (one sentence):** The paper presents a contact-implicit, whole-body trajectory optimization framework that plans dynamic humanoid locomotion over parameterizable uneven terrain described by a smooth, differentiable surface model, with preliminary feasibility tests in simulation and on the humanoid ErgoCub.

## What This Paper Is About

Most trajectory planners for humanoid robots assume flat ground or require the user to specify footstep locations and contact timings in advance, which is impractical in real environments full of steps, ramps, and curbs. This paper builds a planner that decides *where and when* to make and break contact on its own, while reasoning about the robot's full-body dynamics and a mathematically smooth description of the terrain. The goal is to generate physically feasible, potentially dynamic motions (including jumps) on non-flat surfaces without hand-specified contact sequences.

## Key Contributions

1. **A differentiable terrain representation.** Terrain elements (steps, ramps, prisms, cylinders, tori) are modeled as smooth 2D manifolds built from an exponential "sharpness" function multiplied by a plane, so that discontinuous shapes become differentiable and usable inside gradient-based optimization.
2. **Generalized contact constraints.** The contact, no-slip, friction-cone, no-penetration, and unilateral-force conditions are reformulated using local surface normals and orthogonal projectors, extending contact modeling from flat horizontal ground to arbitrary smooth surfaces.
3. **Mass-scaling of centroidal dynamics.** Dividing momenta, contact forces, and force-rate inputs by the robot's total mass makes the planner converge faster to feasible solutions; the total mass then appears explicitly only in the centroidal-momentum consistency constraint.
4. **Trajectory generation and validation on non-coplanar terrain.** The approach produces walking and jumping motions by shaping the cost function and initial guess, with preliminary feasibility tests in simulation and open-loop experiments on the real humanoid ErgoCub (a step-up motion is shown in Fig. 1).

## Main Findings

- **Contact-implicit planning without a contact schedule works on curved and inclined terrain:** The framework determines contacts freely rather than from a predefined sequence, and the authors report the ability to plan on steps, ramps, and other topologies — a regime the comparison table marks as "strongly curved or inclined surfaces," which prior listed methods do not claim.
- **Initial guess controls the qualitative motion:** Because the nonlinear program is non-convex, the choice of initial guess steers the solver to different local minima. Setting contact-force guesses to zero in the relevant phases yields realistic jumping motions; alternately nullifying foot forces yields walking.
- **Terrain smoothness is preserved while approximating discontinuities:** The proposed map f(x) = exp(−g(x)^s)·π(x) stays differentiable for any sharpness s ≥ 2, with fixed points f(0) = 1 and f(1) = e⁻¹ independent of s; as s → +∞ it approaches a step function.
- **Multiple primitive shapes are expressible in closed form:** Rectangles (with half-widths w_x, w_y; p = 2 gives an ellipse or circle), equilateral triangles, and torus-like surfaces (the paper's example uses g(x,y) = (x² + y² − 2)² with s = 4) are all constructed from the same template, and elements can be summed to form stairs or inclined platforms.
- **Problem size and solve time:** The search-space dimension is 88(N+1) + 78N, and the authors report optimization times ranging from tens of seconds to a few minutes on a laptop with an 11th Gen Intel Core i7 and 32 GB of RAM — i.e., an offline planner rather than an onboard one.
- **Foot contact is discretized at four points per foot:** Four contact points at the sole vertices are used per foot (n_c = 8 total), fixed relative to the foot frame throughout the motion.
- **Not reported in the available content:** The Results section is truncated at the description of the dynamical model used for testing, so quantitative tracking errors, success rates, force/torque measurements, terrain parameter values for the experiments, and any numerical comparison against the baselines in Table I are not available here.

## Methodology in Plain English

The authors set the problem up as an optimal control problem and solve it as a nonlinear program.

**Describing the ground.** Instead of a jagged heightmap, each piece of terrain is written as a smooth formula whose value is near one over the obstacle and near zero elsewhere, then multiplied by a plane equation. Turning a knob called "sharpness" makes the transition from zero to one more abrupt, so a stair edge can be approximated as closely as the optimizer tolerates while never actually becoming non-differentiable. Because the surface is given by an explicit function z = F(x), the local surface normal at any point can be computed analytically from the gradient — which is exactly what friction and contact conditions need.

**Describing contact.** At each foot contact point, the planner picks a corresponding point on the terrain and writes constraints: the foot may not pass through the surface, the contact force may only push (not pull) along the normal, the force must lie inside a friction cone defined with respect to the *local* normal rather than a global vertical, and the foot must not slide. The two conditions that are normally equalities (contact and no-slip) are relaxed into small intervals, a standard trick to keep the solver numerically stable.

**Describing the robot.** The state includes centroidal momentum, the center of mass, the floating-base pose (position plus a unit quaternion) and joint angles, the contact point positions, and the contact forces. Controls include the generalized velocities and rate inputs on contact positions and forces, which keep those signals smooth. The dynamics combine centroidal momentum dynamics, full kinematics, and simple first-order rate models for the contact points and forces. Joint position, velocity, and torque limits are imposed, with torques obtained by inverting the full Euler-Poincaré equations (motor-side torques can be constrained instead, matching datasheet limits).

**Shaping the motion.** The cost function is a weighted sum of tasks: state and control regularization, swing height, force regularization, motor-torque minimization, and a lateral foot-distance term that prevents the legs from colliding during forward walking.

**Getting the solver started.** Since the problem is non-convex, the initial guess matters. The authors build it by (a) finding static-equilibrium configurations at the start and end, which requires choosing foot roll and pitch so that at least three contact points per foot touch the surface (solved by minimizing the squared roll and pitch angles), resolving the hyper-static force distribution as a small optimization subject to the contact constraints, and then solving for a whole-body configuration with the desired CoM and foot poses; and (b) interpolating linearly between the two states, with spherical linear interpolation for the quaternion, and nulling the force guesses where flight or swing is desired.

**Solving.** The problem is transcribed with multiple shooting, explicit Euler integration with a Lie-algebra/exponential-map update for the quaternion, and solved with IPOPT using the mumps and MA57 linear solvers, all implemented in Python 3.10 with CasADi.

## Why This Matters

**Impact on research.** The paper bridges two usually separate strands: contact-implicit optimization (which frees the planner from hand-authored contact schedules) and whole-body dynamics on genuinely non-flat geometry (which prior convex or reduced-model planners avoid because convexity is lost). Making the terrain differentiable is the enabling trick — without it, gradient-based solvers cannot use terrain information at all. The comparison table positions the work against MICP-based methods using centroidal or CoM models, FDDP with whole-body dynamics, and NLP with a gravito-inertia-acceleration model on non-smooth heightmaps, and it is the only entry marked as combining differentiable terrain, strongly curved or inclined surfaces, dynamic motions, whole-body dynamics, and implicit contacts.

**Real-world applications:**

- Legged robots climbing stairs, curbs, and loading ramps in warehouses and delivery settings.
- Inspection and maintenance in industrial plants or construction sites where floors are cluttered and uneven.
- Humanoid deployment in disaster response or rubble environments where terrain cannot be mapped to flat polygons in advance.
- Offline motion libraries for entertainment, service, or assistive humanoids that must be pre-validated for safety before execution.

**Industry relevance.** Because the planner runs offline in tens of seconds to minutes, it is best suited as a trajectory-generation and validation tool: producing certified motions, generating references or initial guesses for faster online controllers, or stress-testing a robot's torque and friction margins against terrain models before deployment.

## Future Directions

- **Online or receding-horizon use.** Solve times of tens of seconds to minutes on a laptop currently preclude real-time replanning; warm-starting, code generation, or reduced-order surrogates would be the natural next step.
- **Closed-loop execution.** The real-robot demonstration on ErgoCub is described as open-loop (Fig. 1, step-up), so pairing the planner with a stabilizing whole-body controller and measuring tracking performance remains open.
- **Richer terrain and contact models.** The current model uses point contacts with Coulomb friction on a known, static terrain; extending it to deformable, slippery, or unknown terrain, and to surface (not point) contacts, is a clear extension.
- **Systematic comparison against the baselines.** Table I is qualitative only; quantitative benchmarks against MICP, FDDP, and GIA-based NLP planners on shared terrain would test whether the added nonlinearity pays off in success rate, torque margin, and compute time.
- **Initial-guess sensitivity.** Since the initial guess determines whether the solver finds a walk or a jump, automatic or learned initialization strategies could make the framework more reliable.

## Target Audience

Graduate students and researchers in legged and humanoid robotics working on trajectory optimization and optimal control; robotics engineers who need to generate or validate locomotion on non-flat ground; and practitioners familiar with nonlinear programming, CasADi, or IPOPT who want a concrete, differentiable formulation of terrain and contact constraints. Readers without a background in Lie group dynamics or complementarity formulations will find the mathematics demanding, though the geometric intuition behind the terrain model is accessible.

## Authors’ abstract

This letter presents a trajectory planner for humanoid robots to perform dynamic motions on complex, parameterizable terrains using a contact-implicit whole-body optimization framework. The planner generates feasible movements without predefined contact sequences, considering the robot's full dynamics and kinematics. To plan bipedal locomotion on steps, ramps, and other terrains, we propose a mathematical model to approximate ground geometry with a smooth surface. The rigid…

[The full abstract on arXiv](https://arxiv.org/abs/2611.05585)

[Read the original paper](https://arxiv.org/abs/2611.05585)

## Related papers

- [Differentiable Contact Dynamics for Legged Locomotion: Policy Learning and Contact-Implicit Trajectory Optimization](https://robotics.world/paper/differentiable-contact-dynamics-for-legged-locomotion-policy-learning-2610.35852) 2026-10-26 · cs.RO · Key terms of the title in common
- [Shooting for Contact: Contact-Implicit Multiple Shooting for Dynamic Motion Retargeting](https://robotics.world/paper/shooting-for-contact-contact-implicit-multiple-shooting-for-dynamic-2608.03116) 2026-08-04 · cs.RO · Key terms of the title in common
- [Reusing Locomotion Training Recipes Across Humanoids via Body-Aligned Virtual Joints](https://robotics.world/paper/reusing-locomotion-training-recipes-across-humanoids-via-body-aligned-2611.18003) 2026-11-13 · cs.RO · Key terms of the title in common
- [Adaptive Whole-Body MPC with Optimal Posture Planning for Humanoid Robots under Unknown Payloads](https://robotics.world/paper/adaptive-whole-body-mpc-with-optimal-posture-planning-for-humanoid-2610.12972) 2026-10-09 · cs.RO · Key terms of the title in common
- [Humanoid Horizon: Extending Task Horizon in Whole-Body Loco-Manipulation via Parallel Training, Dynamic Starting, and Reward Gating](https://robotics.world/paper/humanoid-horizon-extending-task-horizon-in-whole-body-loco-manipulation-2610.08320) 2026-10-06 · cs.RO · Key terms of the title in common

---

Canonical: https://robotics.world/paper/contact-implicit-whole-body-trajectory-optimization-for-dynamic-2611.05585
