arXiv:2610.37557cs.ROOct 2026

Manuscript Offprint

arXiv:2610.37557

Learning Visuomotor Quadrotor Flight Through Dynamic Narrow Gaps via Differentiable Simulation

Riccardo Bianco, Yunfan Ren, Jiaxu Xing, Davide Scaramuzza

Riccardo Bianco ∗^{*} Yunfan Ren ∗^{*} Jiaxu Xing Davide Scaramuzza

Robotics and Perception Group, University of Zurich

Figure

Real World Deployment

Figure 1: Traversal of a narrow moving gap using onboard sensing and inertial measurements. The policy is trained with differentiable simulation and transferred zero-shot in the real world.

Abstract: Threading a quadrotor through a moving narrow gap is a demanding test of agile flight, requiring centimeter-level spatial alignment and precise temporal execution. We address this challenge using a control policy that operates directly on onboard visual and inertial measurements to output collective thrust and body-rate commands. The task is difficult because success lies on a thin feasible manifold: small errors in timing, position, attitude, or visual observability cause collision. Prior planning and learning methods rely on privileged state, teachers, planners, or distillation; learning dynamic narrow-gap traversal directly, from scratch, remains open. We introduce a differentiable moving-gap formulation that gates centering, alignment, and smooth collision terms by signed distance to a time-varying gap plane, turning a sparse traversal event into a dense pathwise objective. We integrate this formulation into a visual-feature-to-command policy trained in one stage from random initialization, without a teacher, planner, or distillation. We validate our approach in both synthetic and real-world experiments. In controlled benchmarks, we demonstrate that pathwise gradients significantly outperform score-function gradients for precision-critical tasks, yielding a 99.3% success rate in simulation after only a few minutes of training on a single GPU. Furthermore, the policy transfers directly to a real quadrotor, successfully crossing a dynamic narrow gap from varied initial conditions using onboard sensing and inertial measurements, achieving an 80% success rate over 10 physical trials.

Video: https://youtu.be/z-txORkhnrg

Code: https://github.com/uzh-rpg/agile_narrow_gap_diffsim

Keywords: Visuomotor Policy, Differentiable Simulation, Agile Quadrotor Flight

∗^{*}These authors contributed equally. Correspondence to: yunfan@ifi.uzh.ch, rbianco@ethz.ch.

10th Conference on Robot Learning (CoRL 2026), Austin, Texas, USA.

1 Introduction

Agile quadrotors can move quickly through confined spaces, but useful motion is often constrained by windows, frames, shelves, machinery, debris, and other structures that leave only narrow passages. Narrow-gap traversal is therefore a representative primitive for agile flight, requiring the vehicle to coordinate speed with whole-body geometric precision. Dynamic gaps make the primitive harder: the quadrotor must fit through the aperture and arrive when it is traversable. We study the onboard visual-inertial version of this problem, learning policies that use vision and inertial measurements to output collective-thrust-and-body-rate (CTBR) commands for static and moving gap traversal.

This setting combines thin spatio-temporal feasibility, partial onboard observations near crossing, and aggressive low-level control. Prior work has made strong progress on agile quadrotor planning and narrow-gap traversal through model-based trajectory optimization [1, 2, 3, 4, 5, 6], learning-based control [7, 8, 9, 10, 11, 12], and differentiable simulation [13, 14, 15, 16]. Yet most of these methods rely on static apertures, privileged geometry, or teacher/planner pipelines. This leaves open whether precision-critical moving-gap traversal can be learned end-to-end from random initialization, without a planner, teacher, or distillation. A moving aperture changes the problem qualitatively: the policy must decide not only how to cross, but also when to commit to the crossing.

We argue that a central bottleneck is the quality of the learning signal. Model-free RL methods such as PPO [17] estimate score-function (SF) gradients by treating the simulator as a black box, which can be too noisy on thin-manifold tasks. Pathwise (PW) gradients differentiate through closed-loop rollouts [18, 19], but can become unreliable under stiffness, discontinuities, contacts, or chaotic dynamics [20, 21, 22]. Our key observation is that narrow-gap flight is unforgiving but still smooth: with differentiable quadrotor dynamics and smooth task costs, even failed rollouts indicate how to adjust centering, attitude, and timing.

We build on this observation with a differentiable moving-gap formulation that gates centering, alignment, and smooth collision terms by signed distance to a time-varying gap plane. Integrated into a visual-feature-to-CTBR policy trained in one stage from random initialization, this formulation turns a sparse traversal event into a dense pathwise objective. The framework supports privileged-state and onboard visual-inertial observations and requires no demonstrations, trajectory labels, privileged teacher, planner, or distillation.

We validate our approach in simulation and real-world flight. In simulation, policies train in 0.4–5.6 minutes on a single GPU and reach ≥ 98.9% success with centimeter-level crossing accuracy. In matched 1,000-environment, five-seed state-task runs, tuned PPO used 19× more transitions and 45.5× more training time than BPTT on moving gaps when averaging its four converged seeds. Controlled benchmarks show that PW optimization succeeds with a single rollout per update, whereas SF optimization fails even with one thousand times more samples. Deployed in the real world, a 10×38 cm quadrotor traverses a 25×80 cm moving gap using onboard sensing and inertial measurements, achieving an 80% success rate over 10 trials.

Contributions: In summary, the contributions of this work are:

• We demonstrate precision-critical vision-based static and moving traversal can be learned end-to-end through differentiable simulation without demonstrations, a teacher, a planner, or distillation.

• We release an open-source differentiable-simulation framework for learning observation-to-CTBR policies under both privileged-state and onboard visual-inertial observations, converging in minutes on a single GPU.

• We show that pathwise gradients provide useful learning signals on thin-manifold tasks where score-function gradients fail even with orders of magnitude more samples.

• We deploy the visual-inertial moving-gap policy on a real quadrotor, closing the loop from differentiable training to physical agile flight.

Figure

Static gap randomization

Moving gap randomization

Figure

φ∼U(−45∘,45∘)\varphi \sim \mathcal{U}(-45^\circ, 45^\circ)

Figure

θ∼U(−45∘,45∘)\theta \sim \mathcal{U}(-45^\circ, 45^\circ)

L∈[0.5,1.5]L \in [0.5, 1.5] m

Real-world

(a)

(b)

Figure

(c)

Figure 2: Task geometry. (a) dimensions, (b) static and moving gap randomization, (c) drone camera view (left) and projected gap on image plane (right).

References (34)