arXiv:2610.35852cs.ROOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.35852

Differentiable Contact Dynamics for Legged Locomotion: Policy Learning and Contact-Implicit Trajectory Optimization

Gijeong Kim, Seungbin Oh, Dongyun Kang, Hae-Won Park

Gijeong Kim 1^{1}, Seungbin Oh 1^{1}, Dongyun Kang 1^{1}, and Hae-Won Park 1^{1}

Abstract—This paper proposes a smooth analytic gradient for frictional contact and applies it to policy learning and contact-implicit trajectory optimization for legged locomotion. The exact contact sensitivity is available in closed form but describes changes within the current contact mode, providing no first-order information toward neighboring contact modes. The proposed gradient replaces this sensitivity only in the backward pass, leaving the hard-contact forward solve unchanged and the realized rollout feasible. A central-path relaxation of the de Saxé-corrected second-order-cone complementarity problem for Coulomb friction smooths the conditions defining the separating, clamping, and sliding modes. The relaxed sensitivity is evaluated at a point on the central path obtained by a Newton iteration initialized from the hard-contact solution. The sensitivity remains continuous through contact-mode transitions and converges to the exact sensitivity as the relaxation vanishes. Using 100,000 samples and less than 2 min of training on a desktop PC, policy learning with the proposed gradient produces a policy that transfers to hardware without fine-tuning. On hardware, the robot under a trotting policy withstands pushes and traverses debris and slippery ground. In trajectory optimization, the proposed gradient reaches contact-rich solutions missed by exact and Signorini-relaxed gradients. Project page: https://diffcontact.github.io

Index Terms—Differentiable simulation, frictional contact, second-order cone complementarity, contact-implicit trajectory optimization, analytic policy gradient, quadruped locomotion.

I. INTRODUCTION

THE first-order gradient through contact in a differentiable physics simulator provides a common computational primitive for two classes of methods in contact-rich robot control. The first is policy learning, in which model-free reinforcement learning is widely used and policy-gradient estimates are computed from rollouts across thousands of parallel environments [1], [2], [3]. First-order policy learning [4], [5] preserves the same objective but replaces the score-function (REINFORCE) estimate [6], [7] with a typically lower-variance first-order estimate [8]. This estimate can be obtained by differentiating through the simulator, with comparable policies learned from fewer samples [9]. The second is trajectory optimization. Contact-implicit trajectory optimization (CITO) methods determine when and where contacts are made and broken without a prescribed contact-mode sequence [10], [11], [12]. Shooting-based DDP/iLQR methods [13], [14] use the same transition Jacobians as the policy-learning estimator and have been applied online in receding-horizon control for contact-rich locomotion [15].

For legged robots, both tools are limited by the contact sensitivity provided by differentiable simulation. A simulator may be differentiable without providing a useful first-order direction toward a neighboring contact mode [16], [17]. The exact contact sensitivity is available in closed form [18], [19], but it is evaluated with the active set, or contact-mode assignment, held fixed and therefore describes only the response within the current mode. A clamped contact is linearized as remaining clamped, providing no first-order information toward liftoff or slip, and the sensitivity changes discontinuously when the active set changes. In contact-implicit optimization, this mode-restricted sensitivity keeps the local search near the contact sequence of the nominal trajectory [15], [18], [20]. In first-order policy learning, the same Jacobians enter backpropagation through time (BPTT), where they can produce fragile or ineffective optimization in contact-rich systems [16], [17], [21], [22].

Prior work addresses contact sensitivity in policy learning and CITO in different ways. In policy learning, methods shorten the differentiation horizon [9], [22], use a reduced-order model for the backward pass [23], or smooth contact in the forward rollout [24]. Shorter horizons can help with long-horizon gradient instability, but do not change the contact sensitivity within each window. In CITO, transcription methods optimize contact impulses alongside the trajectory [11], [12], [25], whereas shooting methods rely on transition Jacobians from the contact dynamics [13], [14], [15]. Other approaches smooth the forward contact model [26], [20], differentiate relaxed contact solutions [27], [28], or estimate gradients across perturbed solves [29], [30]. For shooting-based CITO with a hard-contact forward solve, however, the exact contact sensitivity remains tied to the current contact mode and offers limited first-order guidance toward a different mode [18]. Relaxing only the Signorini condition during differentiation [15] partly addresses this limitation by providing directions for contact make/break transitions, but leaves sliding and normal-tangential coupling unaddressed.

We therefore propose a contact sensitivity obtained by relaxing the full frictional contact condition only in the backward pass, providing search directions toward neighboring contact modes while retaining the hard-contact forward solve. The de Saxé correction expresses frictional contact as a single second-order-cone complementarity condition [31], [32]. Relaxing this condition along a central path [33] couples normal

1^{1}The authors are with the Department of Mechanical Engineering, Korea Advanced Institute of Science and Technology, Daejeon 34141, South Korea.

and tangential contact sensitivities across separation, clamping, and sliding. These coupled sensitivities are available in every contact mode, allowing the optimizer to change modes through gradient-based updates. We further investigate their role in guiding transitions to sliding, where a normal-only relaxation lacks the required tangential information.

We test the effect of this sensitivity in two optimal-control settings using a quadruped robot: first-order policy learning and contact-implicit trajectory optimization. In each setting, we compare the exact [19], Signorini-relaxed [15], and proposed sensitivities while keeping the forward contact model, objective, and initialization fixed. The policy-learning experiments ask whether single-environment BPTT can produce locomotion policies that transfer directly to hardware. The trajectory-optimization experiments ask whether the proposed sensitivity improves contact-rich motion generation and recovery from unmodeled external pulls by enabling contact-mode changes and foot repositioning.

The main contributions are:

• An analytic backward contact sensitivity that relaxes the complete de Saxcé-corrected frictional contact law along its central path while retaining the hard-contact forward solve. It provides first-order directions toward separation, sliding, and clamping in every contact mode and recovers the exact sensitivity as the relaxation vanishes.

• The proposed gradient in BPTT-based first-order policy learning and contact-implicit trajectory optimization guides contact-mode changes and yields improved policies and lower-cost contact-rich trajectories.

• Hardware demonstration of quadruped policy learning with the proposed gradient for trotting, pacing, and gait-free locomotion. Trotting policies obtained using 100,000 samples in under 2 min are tested on hardware without fine-tuning under pushes, debris, and low-friction surfaces.

The remainder of this paper is structured as follows. Section II reviews related work and Section III the optimal control and contact dynamics background. Section IV states the required contact sensitivity, Section V derives the proposed gradient, and Section VI the implementation details. Sections VII and VIII present the policy-learning and trajectory-optimization demonstrations, and Section IX concludes.

References (75)