Manuscript Offprint
arXiv:2610.20936LEAP: Gradient Flow Augmented Lagrangian Trajectory Optimization for Contact Constrained Robots
César E. Ramos Chuquiure , Ryan Tsai , Yutong Zhou , Zihang Huang
Vansh Thakur , Akshunn Trivedi , Zachary Lin , Pearl Lin
Ruikai Yang , Challen Enninful Adu , Ram Vasudevan

Fig. 1: Hardware execution of a hopscotch trajectory generated by LEAP. The quadruped performs successive jumps between prescribed foothold patterns, shown in the upper-left panel. Numbered frames indicate stages of the sequence, while labels indicate transitions between them. Frames proceed chronologically from left to right across the top row, then the bottom row.
Abstract—Generating dynamically feasible motions for legged and manipulating robots requires solving a large, nonlinear, non-convex optimal control problem (OCP) in which contact wrenches must satisfy friction-cone constraints throughout the motion, not only at isolated instants. Existing solvers are sensitive to the initial guess and scale poorly with the number of joints. This paper introduces LEAP, which transcribes the OCP with pseudospectral collocation and, instead of a Newton or SQP solve, integrates a primal–dual gradient flow of a Powell–Hestenes–Rockafellar augmented Lagrangian to compute a solution. Because the flow is stiff, this paper designs a linearly implicit integrator with a Gauss–Newton metric, momentum, and a merit-based step controller that keeps the augmented Lagrangian monotone. Across locomotion benchmarks on five robot platforms, from planar hoppers to 32-joint humanoids, LEAP is the only method to solve every tested problem, achieves substantial speedups over Crocoddyl and Aligator on several benchmarks, and reaches trackable references at smaller compute budgets. The resulting trajectories are validated by tracking them in a high-fidelity simulator and on hardware. We will make the code public upon final acceptance of this paper.
I. INTRODUCTION
Robots interact with the world through contact: a humanoid walks by planting and lifting its feet, a manipulator pushes, grasps and releases objects, and a quadruped climbs by loading and unloading its limbs. Planning such motions means choosing joint torques and contact forces that respect the robot's dynamics, its actuation limits, and the physics of contact, which requires the contact wrench to stay inside a friction cone at every instant. Trajectory optimization formalizes this as an Optimal Control Problem (OCP) over hybrid dynamics: minimize a cost, subject to the equations of motion in each contact mode, and the constraints above.
Solving this OCP is difficult for three reasons. The dynamics are nonlinear and change discontinuously across contact modes. The constraints, in particular the friction cones and the dynamics themselves, are nonlinear and non-convex, and any solver must decide how to enforce them and where in time. And the resulting problem is non-convex in the decision variables, so the outcome depends on the initial guess, and a good one is often unavailable for a new behavior or a new robot. We refer to these as the dynamics, constraint, and initialization challenges.
State-of-the-art solvers exploit the temporal structure of the dynamics to make each iteration cheap. Differential Dynamic Programming (DDP) methods such as Crocoddyl [18] and Aligator [12] combine quadratic approximations of the value function with multiple shooting, and direct methods such as acados [24, 25] transcribe the OCP into a nonlinear program (NLP) with banded structure. In both families each iteration is a Newton-type step, and this is what makes the constraint and initialization challenges persist. A Newton step is only meaningful near a solution, so these
Department of Robotics, University of Michigan, Ann Arbor, MI, USA.
Computer Science and Engineering, University of Michigan, Ann Arbor, MI, USA.
Department of Electrical Engineering and Computer Science, University of Michigan, Ann Arbor, MI, USA.
This work was supported by AFOSR MURI FA9550-23-1-0400.
solvers rely on a good warm start and on line-search or trust-region globalization whose parameters must be tuned per problem. Constraints are handled by penalties, by projection onto a box, or by an augmented Lagrangian inside the Riccati recursion, and they are enforced only at discrete knots, so the friction cone can be violated between them. In Section V illustrates that, on the contact-constrained problems, these solvers scale poorly with the number of joints and their performance depends strongly on hyper-parameters.
Gradient flows (GF) offer a different way to handle the initialization challenge. Instead of taking Newton steps, the trajectory is deformed continuously in a pseudo-time until it becomes stationary for an action functional. Every step of the flow is a descent step that is well defined anywhere, not only near a solution, so the method tolerates poor initial guesses and admits continuation naturally. [16] and [15] introduced the Affine Geometric Heat Flow (AGHF), whose steady state solves the OCP, and [7], [17] and [8] extended it to free boundary conditions and to low-dimensional legged systems. [2] and [3] improved the numerics to reach higher-dimensional systems, and [14] extends the idea to extended Lagrangians. What these methods gain on initialization they give back on the other two challenges. Constraints enter as quadratic penalties, so they are never satisfied exactly, and raising the penalty to reduce the violation makes the flow stiffer. The stiff flow is then integrated with general-purpose solvers whose error control is unaware of the optimization structure, so the dynamics challenge reappears as a numerical one.
This paper introduces LEAP, a gradient-flow trajectory optimizer for robots in contact under a prescribed contact sequence, together with a numerical scheme designed for that flow. It keeps the robustness to initialization of gradient flows while resolving the aforementioned constraint and stiffness problems. Our contributions are four-fold: First, we utilize a Powell–Hestenes–Rockafellar (PHR) augmented Lagrangian formulation and derive a two-time-scale primal–dual flow to enable exact constraint handling (Section III). Second, we describe how to extend this approach to hybrid dynamical systems and illustrate how to ensure that wrench feasibility is satisfied for all time in Lemma 2. Third, we develop a linearly implicit solver to ensure that the augmented Lagrangian monotonically decreases along the numerical solution to the primal-dual flow (Section IV). Finally, we compare LEAP against Crocoddyl and Aligator on solve time and terminal tracking accuracy under a time budget across two tasks and five robots with two to thirty-two joints with solution quality judged by a whole-body tracking controller in a high-fidelity simulator (Section V). A hopscotch trajectory is executed on a Unitree Go2 quadruped (Section VI).
A. Robot dynamics with a prescribed contact sequence
Consider a robot with configuration , generalized velocity related by , and state on the horizon . Let be the set of possible contacts. A contact is described by a smooth holonomic residual , and is active while . A mode is a set of simultaneously active contacts, which we identify with the subset . Its stacked residual and contact Jacobian are related by . Within mode the state obeys the differential algebraic equation
where is the mass matrix, collects Coriolis and gravity terms, is the actuation matrix, is the control input and is the stacked contact wrench of the contacts in .
We consider motions with a prescribed mode sequence and prescribed switching times , so that mode is active on . At a switching time the configuration is continuous, and the velocity is mapped by a reset , which we model as a Newton impact [1] when a contact becomes active and as the identity when a contact is released. This is a hybrid system in the sense of Burden et al. [4] whose discrete transitions are fixed in advance, so no guard conditions are needed.
B. Contact Sequence Robot OCP
Problem 1. Given the mode sequence and switching times above, the Contact Sequence Robot OCP is
for , where abbreviates .
The equality constraints contain the dynamics (1), the reset map at , and the boundary conditions; the inequality constraints contain the friction cone on and bounds on and . All constraints must hold for every , not only at a finite set of times.
C. Polynomial representations
To transcribe Problem 1 we represent each trajectory on an interval, rescaled to , by a polynomial of degree p in one of two forms [22]. The first is a Lagrange interpolant through the Chebyshev–Gauss–Lobatto (CGL) nodes
(3) parameterized by its nodal values . The second is a Bézier curve
parameterized by its control points , where are the Bernstein basis polynomials on . Either way a trajectory becomes a finite vector of coefficients. The Bézier form has a property that the nodal form lacks, and which we use to enforce wrench constraints for all time.
Lemma 2 (Bézier control points certify convex constraints). Let be convex and let be a Bézier curve with control points . If for all , then for all .
Proof. The Bernstein basis is nonnegative and sums to one, so is a convex combination of the control points.
III. TRANSCRIBING THE OCP INTO A GRADIENT FLOW
This section transcribes Problem 1 into a nonlinear program and derives the pseudo-time Gradient Flow (GF) that LEAP integrates to solve it.
A. Transcription
On the mode interval , we introduce the reference time
and represent each decision function on by a polynomial in using the forms of Section II-C. The state and control are Lagrange interpolants on the CGL nodes (3), so their coefficients are the nodal values , and time derivatives are obtained by the CGL differentiation matrix [22]. The contact wrench is a Bézier curve (4) with control points . Each field can use a different degree. We call one such polynomial segment an element and the collection of elements the mesh; initially there is one element per mode interval, and the -refinement of Section IV-E may later split an element in two. Let collect the coefficients of mode and all decision variables.
The cost (2a) is approximated by Clenshaw–Curtis quadrature on the CGL nodes. The constraints are transcribed in two ways. The dynamics (1), the bounds on and , and any other constraint involving the state or control are collocated at the CGL nodes. The friction cone, which is convex in , is imposed on the Bézier control points rather than at the nodes, so by Lemma 2 it holds for every and not only at the collocation nodes. The reset map at becomes an algebraic constraint linking the last node of element to the first node of element , being continuous and mapped by , and the boundary conditions are imposed on the first and last nodes of the mesh. Constraints collocated at the nodes may be violated between them; Section IV describes how to control this error through -refinement and penalties.
Collecting the rows, we obtain the nonlinear program
Problem 3 (Transcribed OCP).
where collects the collocated dynamics, the reset maps and the boundary conditions, collects the friction-cone rows on the control points and the collocated bounds, and .
B. Gradient Flow
We now define a flow in a pseudo-time s whose equilibria are the KKT points of Problem 3, built on the Augmented Lagrangian of Powell, Hestenes and Rockafellar (PHR) [11, 20, 21].
Definition 4 (PHR augmented Lagrangian). For each constraint , let be its multiplier and its penalty. The effective residual and effective multiplier are
respectively, and the PHR augmented Lagrangian is
For an equality constraint the ith summand equals , and for an inequality constraint , so is continuously differentiable with
Definition 5 (Two-time-scale flow). Let be a curve in pseudo-time , and partition into windows . On each window follows the primal flow at frozen multipliers ,
and at the multipliers jump by the damped update
Proposition 6 (Equilibria and monotonicity). Fix .
(i) If and , then is a KKT point of Problem 3.
(ii) Along any solution of (14) on a window,
with equality if and only if , so is non-increasing on every window and the equilibria of (14) are the stationary points of .
Algorithm 1 LEAP (schematic)
Require: initial guess , tolerance tol, penalty seed
1: FEASIBILITYFLOW( ) Sec. IV-E
2: for level = 0, ..., do one mesh
3: ;
4: repeat one window: , frozen
5: repeat one step
6: LOOKAHEAD( ) Sec. IV-B
7: solve (18) at for Def. 8
8: ACCEPTANDCONTROL( , , )
Lemma 10, (20)
9: until window budget or stationarity signal
10: UPDATEMULTIPLIERS( , , ) (15), (21)
11: until LEVELSTOP( ) Def. 11
12: if and then return
13: end if
14: REFINE( ) Sec. IV-E
15: end for
Proof. (i) Since , gives . For this is ; for , gives , and . Then for all , and (12) turns into , which completes the KKT conditions. (ii) Apply the chain rule along (14): .
The multiplier update (15) ascends , so monotonicity is a property of the primal flow between multiplier updates and not of the composed map . This is the property the integrator of Section IV is designed to preserve.
IV. NUMERICAL SCHEME
Section III reduced trajectory optimization to integrating the flow (14). Doing so with an off-the-shelf integrator fails for three reasons. First, the flow is stiff when the penalties are large [10]. Second, its Jacobian jumps whenever an inequality constraint enters or leaves the active set , which violates the Lipschitz assumption behind the error control of implicit integrators. Third, the point of the flow is the monotonicity of Proposition 6(ii), and a discretization that does not preserve it forfeits the robustness that motivated the approach. Section IV-A builds a step that handles stiffness and the jumps, Section IV-B controls that step so that monotonicity survives discretization, Section IV-C discretizes the outer time scale of the multipliers, Section IV-D decides when the discrete solution is good enough, and Section IV-E handles initialization and mesh adaptation. Algorithm 1 shows how these components fit together.
A. Linearly implicit step
Stiffness calls for an implicit method, but a fully implicit step of (14) requires solving a nonlinear system at every step, and the exact Jacobian contains second derivatives of the dynamics, which are expensive, and the rank-one terms that appear and disappear with the active set. We therefore take a linearly implicit step: one linear solve per step, against a Jacobian model that is cheap, positive semidefinite, and already contains the terms the exact Jacobian is about to gain. A step in the rest of the section means one such update.
Definition 7 (Gauss–Newton model on an anticipatory active set). For a margin , let and define
where is the Gauss–Newton Hessian of and stacks the gradients for .
H is the Gauss–Newton approximation of , obtained from (12) by dropping the curvature terms . The margin enlarges the active set by the constraints within of switching, so that the model already carries the rank-one term the exact Jacobian will gain within the step.
Definition 8 (Linearly implicit step). Given a linearization point v, frozen multipliers , a step and , the -method applied to (14) with Jacobian model is
followed by with chosen in Section IV-B. LEAP uses .
Dividing (18) by shows that solves : a Levenberg–Marquardt step with damping , which is a gradient step as and the Gauss–Newton step as . The pseudo-time step therefore doubles as a trust-region radius, and the question of how large a step to take becomes the question of how far to trust the model . The next lemma provides the quantity that answers it.
Lemma 9 (Descent and predicted decrease). For every and , the step of (18) exists, is unique, and satisfies whenever . The quadratic model predicts the decrease
Proof. is a sum of Gram matrices, so is invertible and . From (18), ; substituting into gives , which is positive since .
B. Acceptance and step control
A stiff integrator chooses h from a local truncation-error estimate, which presumes a smooth vector field and misjudges the step whenever the active set changes. We instead choose h the way an optimizer would: a step is accepted only if decreases, which makes monotonicity a property of the discrete iterates by construction, and h is grown or shrunk according to how well the model of Lemma 9 predicted that decrease. Both tests use only values of , so neither sees the Jacobian jumps.
The linearization point is either the last accepted iterate or an extrapolation of and , which is discarded whenever , so that in either case. The trial is accepted, and becomes , if and only if , starting at and backtracking on rejection; an accepted step advances pseudo-time by . Chaining the two inequalities gives the discrete counterpart of Proposition 6(ii):
Lemma 10 (Monotone accepted sequence). The accepted iterates satisfy for every , with or without look-ahead.
The step is controlled by the ratio of actual to predicted decrease, as in a trust-region method [19, Ch. 4]:
with and . A large means the Gauss–Newton model is accurate and grows toward the Gauss–Newton step; a small shrinks it toward a gradient step. The step-size controller is thus deciding how far to trust , not how accurately to follow the flow in pseudo-time, which is why it can be insensitive to the jumps that defeat the truncation-error estimators of stiff integrators [10].
C. Windows, multipliers and penalties
The flow of Definition 5 holds fixed while descends and updates only once the inner problem is near stationarity. We call the run of accepted steps between two multiplier updates a window. A window ends when its accumulated pseudo-time reaches , or earlier when falls below or the decrease of stalls. At the window boundary the feasibility criterion of Section IV-D is tested; if it fails, the multipliers are updated by (15) with , and any penalty whose constraints are not converging is increased.
The penalty update acts on groups of constraints rather than on all of them at once. Let for and for denote the violation of constraint . The rows of one named constraint of Problem 1 form a term with index set , violation and a shared penalty , and a term whose violation has not contracted by since the previous boundary has its penalty increased:
where . The reason for per-term penalties is a degeneracy of the uniform choice. Suppose the window has converged, , and apply (15) at that . By (12) the gradient becomes . If this is times the gradient of the infeasibility , so at an infeasible stationary point of the infeasibility the update does nothing and raising does not help. Distinct weight the sum differently and generically move the iterate off such a point.
D. Feasibility criterion
The transcription of Section III-A enforces the path constraints of Problem 1 at the CGL nodes. Deciding when the discrete solution is good enough therefore involves two errors of different origin: the violation at the nodes, which the flow drives down, and the violation between nodes, which only refining the mesh can reduce. The criterion measures both, so that the scheme can tell whether to keep flowing or to refine.
Definition 11 (Node gate, fine-grid violation and criterion). Let
where is a fine grid of physical times and runs over the path constraints of element evaluated on its polynomials. is the node gate, the fine-grid violation, and the criterion is and .
A level is the sequence of windows run on one mesh. Each time a window ends, the criterion is evaluated. If it holds, the level ends and the solve is complete. If but , the nodes have converged and the remaining violation lies between them, which the flow cannot reduce; the level ends and the outer loop refines the mesh (Section IV-E). Otherwise the flow continues into the next window.
E. Outer loop
Two things remain outside the inner iteration. It converges to a stationary point of in whose basin it starts, so a poor initial guess must first be brought into a useful basin; and it can only reduce the nodal violation G, so when a level ends with the mesh must change.
a) Feasibility flow: Before the objective and the multipliers enter, the flow (14) is run on the special case of with , a common penalty and dropped, so that reduces to . The step (18) is then the Levenberg–Marquardt iteration for [19, Ch. 10], and this stage removes the bulk of the infeasibility of the initial guess, which in our experiments is a linear interpolation between boundary poses.
b) h-refinement: When a level ends with , each element receives the indicator , and Dörfler marking [6] bisects the elements with the largest indicators at the time of their worst violation [5]. The children keep the parent's degrees, and the iterate is transferred to the new mesh by re-interpolating the nodal fields at the children's CGL nodes and splitting each Bézier wrench by de Casteljau subdivision [9]. Interpolation at nodes reproduces a degree- polynomial exactly, and de Casteljau subdivision returns the same curve on each half with control points that are convex combinations of the parent's, so Lemma 2 applies to the children. Because the constraint set changes, the multipliers are reset and the penalties reseeded; the refined iterate is nearly feasible, so the flow restarts with a large step. The solve ends when the criterion holds, when refinements are exhausted, or when refinement stops reducing , which indicates a wrong basin rather than a discretization error.
V. SIMULATION EXPERIMENTS
This section compares LEAP against the state of the art methods Crocoddyl [18] and Aligator [12]. All methods solve instances of Problem 1 for different robot morphologies and under different constraints. Subsection V-A describes the experimental setup that will allow us to fairly compare the different methods. Subsection V-B compares optimization times and the success of the resulting trajectories under simulated tracking. Subsection V-C illustrates how each method fares when given a time budget to solve the OCP.
A. Experimental setup
To fairly compare the different methods, we define a set of benchmark problems and criteria to evaluate the solution. All experiments are run in a machine with a 2x AMD EPYC 7742 64-Core Processor and for each experiment each method is allocated 12 physical cores.
-
Benchmark Problems: The results presented here comprise ten benchmark problems across two tasks: walking over uneven terrain and jumping over a fence (Figure 2). Each task is evaluated on five robot platforms: a planar hopper , Unitree's Go2 quadruped , H1 biped , G1 humanoid , and PAL Robotics' Talos humanoid . All methods solve the same optimization problem to the extend their formulations allow: same cost function, constraint and initial guess.
-
Solution quality criteria: Each optimization method produces optimal trajectories for the states and torques at the collocation nodes. Small constraint residuals at the collocation nodes do not ensure that a tracking controller can execute the resulting motion and reach the prescribed terminal state. We therefore evaluate the references through closed-loop simulation and assess terminal goal accuracy separately from optimization feasibility. A whole-body inverse-dynamics controller tracks each reference in MuJoCo, using the same controller configuration for all optimization methods on a given task and robot. We refer to the state obtained by numerically integrating the robot dynamics under the controller's torques and the simulator's contact forces as the simulated rollout.
For the solve-time comparisons, success is determined by the rollout's error relative to the problem's prescribed terminal rest pose and foot placements. The position errors and residual speeds must be strictly below the six thresholds in Table I, with identical numerical thresholds for every robot and method.
| Quantity | Error metric | Threshold |
|---|---|---|
| Base position | Euclidean position error | 0.050 m |
| Base orientation | Max. absolute wrapped RPY error | 0.10 rad |
| Joint position | Max. absolute actuated-joint error | 0.20 rad |
| Foot position | Max. Euclidean foot error | 0.040 m |
| Base linear speed | Linear velocity norm | 0.10 m/s |
| Joint speed | Max. absolute actuated-joint velocity | 0.10 rad/s |
TABLE I: Terminal goal thresholds shared by all robots and methods. Each metric must be strictly below its threshold at the final time of the rollout.
| Solve time [s] | Hopper | Go2 | H1 | G1 | Talos |
|---|---|---|---|---|---|
| 2 | 12 | 19 | 29 | 32 | |
| Uneven terrain | |||||
| LEAP | 20.9 | 79.8 | 13693 | 1218 | 4096 |
| Crocoddyl | 143 | 78.1 | 1425 | × | |
| Aligator | 1201 | 487 | 2121 | × | |
| Fence jumping | |||||
| LEAP | 5.2 | 71.6 | 176 | 552 | 658 |
| Crocoddyl | × | 557 | 34.4 | 1867 | × |
| Aligator | × | 1200 | 301 | 8443 | |
TABLE II: Optimization time of the reference trajectories on both benchmarks. Each entry is the solve time in seconds of the reference whose simulated rollout satisfies the terminal-goal criteria of Table I. × marks a method whose rollout does not, and † a run that reached the budget without meeting the feasibility test. Bold marks the fastest successful method for each problem, times above 100 s are rounded to the second and method colors match Figure 3. is the actuated joint count.
B. Scalability to convergence
We compare LEAP, Crocoddyl and Aligator on the Fence and Uneven terrain benchmark. Figure 2 shows the rollout solution produced by LEAP for all the scenarios and all the robots. The goal of this subsection is to compare the solve time of the different methods for solutions whose rollout satisfy the success criteria.
Table II reports the optimization time of the reference trajectories whose simulated rollouts satisfy the terminal tracking criteria in Table I, with the five robot platforms across the columns and the two tasks down the rows. Crosses indicate that the corresponding rollout does not satisfy these criteria. Each entry is the solver time at which a method produced its final iterate within a 14400 s budget. That iterate is the reference tracked in simulation. All three methods stop early once the iterate satisfies the shared feasibility test (maximum node and fine-grid constraint violation below ) or their own convergence test. Across the ten displayed cases, LEAP satisfies the tracking criteria in all ten, compared with seven for Crocoddyl and eight for Aligator.
Table III summarizes each rollout by its largest normalized terminal error in the terminal state. LEAP attains the smallest normalized error on nine of the ten problems. The H1 fence-jumping experiment is the only instance where a comparison method obtains better terminal accuracy.
C. Scalability under a time budget
We next examine how the quality of the simulated rollout improves with the available computation time for the different trajectory optimizers. For each compute budget we retain, the recorded candidate with the smallest node constraint violation available, track it in simulation with the controller
| Robot | Method | ||
|---|---|---|---|
| Uneven terrain | Fence jumping | ||
| Hopper (2) | LEAP | 0.12 | 0.89 |
| Crocoddyl | 0.14 | 147 | |
| Aligator | 0.17 | 14 | |
| Go2 (12) | LEAP | 0.23 | 0.038 |
| Crocoddyl | 0.32 | 0.31 | |
| Aligator | 0.36 | 0.76 | |
| H1 (19) | LEAP | 0.028 | 0.37 |
| Crocoddyl | 0.13 | 0.21 | |
| Aligator | 0.18 | 0.16 | |
| G1 (29) | LEAP | 0.016 | 0.0014 |
| Crocoddyl | 0.047 | 0.24 | |
| Aligator | 0.048 | 0.34 | |
| Talos (32) | LEAP | 0.13 | 0.0023 |
| Crocoddyl | 633 | 678 | |
| Aligator | 569 | 0.0053 | |
TABLE III: Terminal goal accuracy of the simulated rollouts on both benchmarks. Each entry is , the largest of the six errors of Table I divided by its threshold evaluated at the terminal time. A value below one means the rollout reaches the goal. Bold marks the smallest value for each problem, and method colors match Table II and Figure 3. Parentheses give the actuated joint count, listed as terrain/fence for the Hopper, which the two tasks pose differently. It can be seen that for 9/10 cases LEAP attains the smaller terminal error.
of Section V-A, and report the normalized terminal error of Table III. Figure 3 plots this error against the budget, with uneven terrain in the left column and fence jumping in the right column. A curve below the dashed line at one means that the reference available at that budget is tracked to the terminal goal. Counting the budget from which the retained reference stays trackable to the end of the run, LEAP reaches that point first on seven of the ten problems.
VI. HARDWARE EXPERIMENTS
In this section we evaluate whether a hopscotch trajectory generated by LEAP can be executed on a physical quadruped using a tracking controller. The task combines forward jumps, alternating diagonal support, and a widened four-foot stance, as illustrated in Figure 1.
A. Hardware Setup
Experiments use a Unitree Go2 EDU quadruped with 12 actuated joints and a low-level torque-control interface. Robot measurements and control commands are exchanged through the Unitree SDK 2 [23]. Joint positions and the base orientation are obtained from onboard measurements. A Vicon motion-capture system records the position of the floating base in the torso.
B. Controller and System Identification
Execution in hardware follows the reference-generation and feedback-tracking approach used in Section V. To reduce the model mismatch we employ system identification [26, 27] and the tracking controller is trained with domain randomization to accommodate remaining discrepancies between simulation and hardware. The controller is inspired by Deep Tracking Control [13] and observes joint angles, floating-base position and orientation, and base angular velocity. LEAP supplies the reference motion, while the controller provides feedback corrections during execution.
Uneven terrain
Fence jump

Fig. 2: Simulated tracking of LEAP trajectories for both tasks, in side view: walking over uneven terrain (left) and fence jumping (right). Obstacles are red, and robot configurations are colored by elapsed time within that robot's plan, from the initial pose in solid gray to the final pose in solid green. The stepping stones are placed at distinct heights and positions making the gait non-periodic, and self-collision and collision with the fence are included in the optimization formulation.
C. Results
Table IV summarizes the errors for the execution shown in Figure 1. This execution demonstrates that a LEAP reference can guide the robot through the hopscotch sequence with centimeter-scale RMS position errors.
| Quantity | RMS error | Peak absolute error | Final absolute error |
|---|---|---|---|
| Joint position [rad] | 0.0682 | 0.4455 | 0.1546 |
| Base roll [rad] | 0.0249 | 0.0572 | 0.0435 |
| Base pitch [rad] | 0.0426 | 0.1093 | 0.0670 |
| Base yaw [rad] | 0.0113 | 0.0309 | 0.0107 |
| Base x [m] | 0.0424 | 0.0917 | 0.0309 |
| Base y [m] | 0.0347 | 0.0769 | 0.0093 |
| Base z [m] | 0.0207 | 0.0729 | 0.0065 |
TABLE IV: Tracking errors for hardware execution of the hopscotch trajectory.
REFERENCES
Rollout terminal error max e/ē,

Recorded compute budget [s]
Fig. 3: This figure shows terminal goal error (Table I) of the rollout versus compute budget. The dashed line at one is the success criterion. At each budget value we simulate the solution with the smallest node violation recorded up to that point. A dot marks where the run passed the solver's convergence test or stalled, and the dotted tail carries its final iterate, the reference of Tables II and III, to larger budgets. LEAP (blue), Aligator (orange), Crocoddyl (pink). Counting the budget from which the retained reference stays trackable, LEAP is earliest on seven of ten problems.
VII. Conclusion
This paper presented LEAP, a gradient-flow method for trajectory optimization of robots with prescribed contact sequences. The method combines pseudospectral collocation with a two-time-scale PHR augmented-Lagrangian flow whose equilibria satisfy the KKT conditions of the transcribed problem. Bézier wrench parameterizations certify convex contact-wrench constraints throughout each interval when their control points are feasible. A linearly implicit Gauss–Newton integrator preserves descent at fixed multipliers and penalties, while feasibility initialization and adaptive mesh refinement address initial infeasibility and violations between collocation nodes.
Across ten benchmarks on five robot platforms, LEAP meets the terminal tracking criteria in all ten simulated rollouts, compared with seven for Crocoddyl and eight for Aligator. It achieves substantial solve-time reductions on several benchmarks and lower normalized terminal error over a range of compute budgets. A hopscotch execution on the Unitree Go2 further demonstrates hardware tracking of an optimized reference, with a joint-position RMS error of 0.0682 rad and centimeter-scale RMS position errors. We will release all code upon final acceptance of this paper.
[1] Robot dynamics lecture notes. Lecture notes, ETH Zürich, 2017.
[2] Challen Enninful Adu, César E. Ramos Chuquiure, Bohao Zhang, and Ram Vasudevan. Bring the heat: Rapid trajectory optimization with pseudospectral techniques and the affine geometric heat flow equation. IEEE Robotics and Automation Letters, 10(4):4148–4155, 2025. doi:10.1109/LRA.2025.3547299.
[3] Challen Enninful Adu, César E. Ramos Chuquiure, Yutong Zhou, Pearl Lin, Ruikai Yang, Bohao Zhang, Shubham Singh, and Ram Vasudevan. Phasing through the flames: Rapid motion planning with the aghf pde for arbitrary objective functions and constraints, 2025. URL https://arxiv.org/abs/2505.01589.
[4] Samuel A. Burden, Humberto Gonzalez, Ramanarayan Vasudevan, Ruzena Bajcsy, and S. Shankar Sastry. Metrization and simulation of controlled hybrid systems. IEEE Transactions on Automatic Control, 60(9):2307–2320, 2015. doi: 10.1109/TAC.2015.2404231.
[5] Christopher L. Darby, William W. Hager, and Anil V. Rao. An hp-adaptive pseudospectral method for solving optimal control problems. Optimal Control Applications and Methods, 32(4):476–502, 2011.
[6] Willy Dörfler. A convergent adaptive algorithm for Poisson's equation. SIAM Journal on Numerical Analysis, 33(3):1106–1124, 1996.
[7] Yinai Fan, Shenyu Liu, and Mohamed-Ali Belabbas. Mid-air motion planning of robot using heat flow method with state constraints. Mechatronics, 66:102323, 2020. ISSN 0957-4158. doi: https://doi.org/10.1016/j.mechatronics.2020.102323. URL https://www.sciencedirect.com/science/article/pii/S0957415820300039.
[8] Yinai Fan, Shenyu Liu, and Mohamed-Ali Belabbas. Geometric heat flow method for legged locomotion planning. IEEE Control Systems Letters, 5(3):941–946, 2021. doi: 10.1109/LCSYS.2020.3005619.
[9] Gerald Farin. Curves and Surfaces for CAGD: A Practical Guide. Morgan Kaufmann, San Francisco, CA, 5 edition, 2002.
[10] Ernst Hairer and Gerhard Wanner. Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Problems. Springer, Berlin, 2 edition, 1996.
[11] Magnus R. Hestenes. Multiplier and gradient methods. Journal of Optimization Theory and Applications, 4(5):303–320, 1969.
[12] Wilson Jallet, Antoine Bambade, Etienne Arlaud, Sarah El-Kazdadi, Nicolas Mansard, and Justin Carpentier. Proxddp: Proximal constrained trajectory optimization. IEEE Transactions on Robotics, 41: 2605–2624, 2025. doi: 10.1109/TRO.2025.3554437.
[13] Fabian Jenelten, Junzhe He, Farbod Farshidian, and Marco Hutter. Dtc: Deep tracking control. Science Robotics, 9(86):eadh5401, 2024. doi: 10.1126/scirobotics.adh5401. URL https://www.science.org/doi/abs/10.1126/scirobotics.adh5401.
[14] Sangmin Kim and Hae-Won Park. El-aghf: Extended lagrangian affine geometric heat flow, 2025. URL https://arxiv.org/abs/2505.24751.
[15] Shenyu Liu and Mohamed Ali Belabbas. A homotopy method for motion planning. arXiv preprint arXiv:1901.10094, 2019.
[16] Shenyu Liu, Yinai Fan, and Mohamed-Ali Belabbas. Affine geometric heat flow and motion planning for dynamic systems. IFAC-PapersOnLine, 52(16):168–173, 2019. ISSN 2405-8963. doi: https://doi.org/10.1016/j.ifacol.2019.11.773. URL https://www.sciencedirect.com/science/article/pii/S2405896319317768. 11th IFAC Symposium on Nonlinear Control Systems NOLCOS 2019.
[17] Shenyu Liu, Yinai Fan, and Mohamed-Ali Belabbas. Geometric motion planning for affine control systems with indefinite boundary conditions and free terminal time. arXiv preprint arXiv:2001.04540, 2020.
[18] Carlos Mastalli, Wolfgang Merkt, Josep Marti-Saumell, Henrique Ferrolho, Joan Solà, Nicolas Mansard, and Sethu Vijayakumar. A feasibility-driven approach to control-limited ddp. Autonomous Robots, 46(8):985–1005, 2022. doi: 10.1007/s10514-022-10061-w. URL https://doi.org/10.1007/s10514-022-10061-w.
[19] Jorge Nocedal and Stephen J. Wright. Numerical Optimization. Springer, New York, 2 edition, 2006.
[20] M. J. D. Powell. A method for nonlinear constraints in minimization problems. In R. Fletcher, editor, Optimization, pages 283–298. Academic Press, New York, 1969.
[21] R. Tyrrell Rockafellar. The multiplier method of Hestenes and Powell applied to convex programming. Journal of Optimization Theory and Applications, 12(6):555–562, 1973.
[22] Lloyd N. Trefethen. Spectral Methods in MATLAB. SIAM, Philadelphia, PA, 2000.
[23] Unitree Robotics. unitree_sdk2: Unitree robot sdk version 2. https://github.com/unitreerobotics/unitree_sdk2. GitHub repository, accessed Sep. 16, 2026.
[24] Robin Verschueren, Gianluca Frison, Dimitris Kouzoupis, Jonathan Frey, Niels van Duijkeren, Andrea Zanelli, Branimir Novoselnik, Thivaharan Albin, Rien Quirynen, and Moritz Diehl. acados—a modular open-source framework for fast embedded optimal control. Mathematical Programming Computation, 14(1):147–183, 2022. doi: 10.1007/s12532-021-00208-8. URL https://doi.org/10.1007/s12532-021-00208-8.
[25] Bohao Zhang and Ram Vasudevan. Rapid and robust trajectory optimization for humanoids, 2024. URL https://arxiv.org/abs/2409.00303.
[26] Bohao Zhang, Daniel Haugk, and Ram Vasudevan. System identification for constrained robots. arXiv preprint arXiv:2408.08830, 2024.
[27] Bohao Zhang, Zichang Zhou, and Ram Vasudevan. Provably-safe, online system identification. arXiv preprint arXiv:2504.21486, 2025.