arXiv:2610.19627cs.ROOct 2026

Manuscript Offprint

arXiv:2610.19627

E2DRL: End-to-End Differentiable Reinforcement Learning for 3D Obstacle Avoidance in Quadruped Robots

Cheng Fan, Bingyang Zhou, Gang Yang, Zixuan Zhuang, Aoqian Zhang, Pengzhi Yang, Xin Liu, Chunzheng Wang, Yan Rui Tan, Fan Shi

Cheng Fan 1,∗^{1,*}, Bingyang Zhou 1,∗^{1,*}, Gang Yang 1^{1}, Zixuan Zhuang 1^{1}, Aoqian Zhang 1^{1}, Pengzhi Yang 1^{1}, Xin Liu 1^{1}, Chunzheng Wang 1^{1}, Yan Rui Tan 1^{1}, and Fan Shi 1,†^{1,\dagger}

Abstract—Differentiable reinforcement learning shows strong promise for robot policy learning, but its application to legged locomotion has remained limited to blind walking or simulated 2D tasks. Extending it to end-to-end visual obstacle avoidance is challenging because hard collision constraints and early termination upon contact corrupt first-order gradients, trapping optimizers in local minima. We present E2DRL, which addresses this with a soft differentiable obstacle-interaction formulation: penetration penalties across multiple body keypoints with velocity-conditioned stop-gradient shaping to provide the first-order training signals for 3D obstacle avoidance. To realize a deployable perception-control system, a privileged teacher trained via Soft Analytic Policy Optimization (SAPO) in a differentiable simulator is distilled into a recurrent depth-based student via DAgger, then blended with a base locomotion policy using a terrain-aware gating module for deployment. In simulation, E2DRL achieves higher sample efficiency than PPO and demonstrates superior velocity-tracking performance and 3D obstacle-avoidance capability compared with both PPO and Duality-based DCBF NMPC. We present the first sim-to-real validation of end-to-end differentiable RL for 3D obstacle avoidance on a Unitree Go2 in static and dynamic environments.

I. INTRODUCTION

Quadruped robots have shown strong potential for operation in human-centered environments [1, 2], where obstacle avoidance often extends beyond planar navigation. In cluttered scenes, a velocity-commanded robot may encounter obstacles with diverse heights and geometries, such as tables, shelves, chairs, and suspended boards. To navigate such environments effectively, the robot must not only track commanded motion, but also adapt its body posture and locomotion strategy in three dimensions, e.g., bypassing obstacles laterally or lowering its body to crawl underneath them. Enabling such command-conditioned 3D obstacle avoidance is therefore important for the practical deployment of quadruped robots [3–7].

Recent studies have explored quadrupedal locomotion in complex environments through both optimization-based and learning-based approaches [3, 4, 7–11]. Traditional optimization-based methods, such as Duality-based DCBF NMPC [7], incorporate safety constraints into online trajectory optimization for safe quadrupedal locomotion in narrow spaces. However, their reliance on online constrained optimization and simplified model representations makes it difficult to simultaneously avoid challenging obstacles while maintaining responsive velocity tracking. Model-free reinforcement learning offers an alternative, but typically treats the simulator as a black box and estimates gradients only from sampled returns [12], requiring large amounts of interaction data in contact-rich obstacle-avoidance tasks.

Differentiable simulation has recently emerged as a promising alternative for more efficient policy learning [12–14]. Prior work has also shown that differentiable physics can improve motion performance. Notably, Zhang et al. [15] demonstrate high-speed drone navigation through complex environments with both static and dynamic obstacles, achieving substantial gains in speed and success rate. In addition, Schwarke et al. [16] achieve robust proprioceptive quadrupedal locomotion by proposing a novel differentiable contact model, enabling seamless sim-to-real transfer with remarkable sample efficiency. These results suggest that differentiable physics can improve both optimization efficiency and control performance. We therefore seek to bring these advantages to quadrupedal 3D obstacle avoidance.

Nevertheless, applying differentiable RL to quadrupedal obstacle avoidance remains challenging. Intermittent contacts, hard collision constraints, and early termination induce severe non-smoothness and gradient discontinuities. Consequently, first-order optimization methods become highly susceptible to suboptimal local minima. Existing differentiable RL methods for quadruped robots mainly address blind locomotion or simulated 2D tasks [17, 18], leaving the integration of differentiable learning into deployable visuomotor policies for 3D obstacle avoidance unexplored. In this setting, the central challenge is not simply to add an obstacle-avoidance cost, but to design a training surrogate that keeps obstacle interactions informative for first-order policy optimization while discouraging nonphysical penetration.

In this letter, we present E2DRL, an end-to-end differentiable reinforcement learning framework for quadrupedal 3D obstacle avoidance under velocity commands. The framework trains a privileged teacher with SAPO in a differentiable simulator, distills it into a recurrent depth-based student via DAgger, and blends the student with a proprioception-based locomotion policy through a terrain-aware gating module. A key innovation of this work is a soft differentiable obstacle-interaction formulation, used as a training-time surrogate rather than a physical contact model, which allows simulated penetration and applies differentiable multi-keypoint penalties with velocity-conditioned stop-gradient shaping. The gating module preserves nominal locomotion in free space while triggering active avoidance near obstacles. Experiments show that E2DRL achieves higher sample efficiency than PPO during training, while outperforming both Duality-based DCBF NMPC and PPO in velocity tracking and traversal of challenging 3D obstacles.

The main contributions of this paper are summarized as follows:

∗^{*}Equal contribution. †\daggerCorresponding author.

  1. We propose a soft differentiable obstacle-interaction formulation for contact-rich quadrupedal obstacle avoid-

1^{1}Department of Electrical and Computer Engineering, National University of Singapore, Singapore.

ance, which addresses the local-optima and gradient-truncation issues of hard obstacle formulations by penalizing continuous penetration of multiple body keypoints with velocity-conditioned stop-gradient shaping, enabling stable first-order optimization across overhanging and ground obstacle configurations.

  1. We propose a deployment-oriented differentiable end-to-end obstacle avoidance framework that transfers differentiable RL skills for crawling and bypassing to a recurrent depth-based student policy. Furthermore, to improve velocity tracking in obstacle-free regions, we introduce a gating module that seamlessly integrates the student policy with a nominal locomotion policy.

  2. We present the first sim-to-real validation of an end-to-end differentiable RL policy for overhanging and ground obstacle avoidance on a physical quadruped robot in both static and dynamic real-world environments.

References (29)