← Autonomy lab

06 / 06 · Riemannian geometry · closed form, no solver

WARP

APF pushes the drone away from obstacles. WARP curves the space it lives in instead, so that every obstacle surface is infinitely far away. Hitting one would take an infinitely long path.

Trap pocket start
reached, 22 s
Gazebo, fixed obstacles
0.59 m clearance
Theorem checks, offline
6 / 6 hold
Unit tests
24
Live: the metric Φ around the default course, and wavefronts of geodesic distance from the goal

What the controller computes

Newton pushes. Einstein curves.

01 · Curve the space

A metric that diverges at walls

Obstacles enter a conformal metric g = Φ(h)² I, where h is the distance to the nearest inflated surface. Within 1.2 m of a surface Φ = 1 + β(h_s − h)³ / (h_s² h); beyond it Φ = 1 and space is flat.

Near a surface Φ grows like 1/h, so every surface sits at infinite geodesic distance, like the edge of a Poincaré disk. Safety becomes topology, not force balance.

02 · Distance in the curved space

Wavefronts from the goal

The guidance needs the geodesic distance to the goal, which solves |∇d| = Φ. A fast-sweeping eikonal solver in plain numpy does it on a grid, about 0.2 s for 50k cells, and always terminates. No CasADi, no IPOPT, no sampling.

Watch the fronts slow down where Φ is large and flow around the pillars.

03 · Fly downhill

Four closed-form terms

a = −2(v·∇u)v + |v|²∇u − (k·d_g/Φ)·ĝ − c·v, with u = ln Φ. The first two brake and bend near surfaces, the third pulls along the geodesic, and damping is the only energy sink. A fourth, magnetic term v × B handles moving obstacles and can never do work.

The orange arrow is the command. It shrinks near pillars: the opposite of APF.

04 · Nothing to get stuck in

No spurious equilibria

Obstacles contribute no equilibria at all, so there is no balance point to stall in. Started inside the trap pocket, the closed loop still reaches the goal: offline it took 22 s, where APF stays stuck forever.

The price: it is expensive, conservative, and converges softly at the end.

metric Φ · commandgeodesic distanceflown

Try it

Bend it yourself

Click or tap to move the goal; the eikonal field is re-solved on the spot. Raise β to warp harder and give the pillars a wider berth. A 2D slice of warp_core.py at the 2 m cruise height, same defaults, ideal closed loop.

The controller, written out

Closed form, evaluated every tick. Numbers are the defaults in warp_core.py; h is the distance to the nearest surface inflated by 0.5 m, dg the geodesic distance to the goal, ĝ its gradient direction.

command

a = −2(v · ∇u) v + |v|2 ∇u − (k dg / Φ) ĝ − c v + v × B,  |a| ≤ 2.5

with

Φ(h) = 1 + β (hs − h)+3 / (hs2 h),  β = 3, hs = 1.2 m
metricg = Φ² I; flat beyond 1.2 m, ∝ 1/h at a surface
u = ln Φ,  ∇u = (Φ′(h) / Φ) ∇h
metricthe first two terms are its geodesic equation
|∇dg| = Φ,  dg(goal) = 0
eikonalfast sweeping on a 0.25 m grid, at most 8 passes
k = 0.15 s−2,  c = 1.0 s−1,  γ = 1.5 s−1
gainsγ scales B, which only moving obstacles switch on

what it guarantees

E = ½ Φ2 |v|2 + ½ k dg2,  dE/dt = −c Φ2 |v|2 ≤ 0
energydamping is the only sink; v × B does no work
h ≥ hmin = hs exp(−11/6 − (R + hs) / (β hs)),  R = √(2E0 / k)
Theorem 1a margin known before take-off, from the starting energy

What was verified

The repo validates a theory document, core.md. Offline, on the exact closed loop with RK4 integration:

theorempredictionobserved
T1 forward invarianceh(t) ≥ h_min > 0, no exceptionsmin h 1.04 m (bound 2.2e-3 m), no collision in any scenario
Cor. 1.1 geometric speed limitΦ(h)·|v| ≤ √(2E₀)1.74 against 5.78, never approached
(E) energy monotonedE/dt = −c|v|²_g ≤ 0max dE per step −5e-5, strictly decreasing
Thm 4 bounded control|a| ≤ ā, |a| → 0 at surfacesmax 2.24 < 2.5; mean |a| near walls smaller than in free space
Prop 2 no deadlockno spurious equilibriatrap pocket start: reached in 22 s (APF: stuck forever)
Thm 5 dynamic safetyno finite-time collisionhead-on pedestrian: 1.38 m clearance; crossing: 2.70 m
Gazebo SITL, PX4 v1.14, x500 with 2D lidar, real closed loop.
flightresultclearancetheorem checks
fixed obstaclesreached, 112 s0.59 m, no margin penetrationall pass
2D lidar pillarsreached, 124 s0.82 mpass except Cor. 1.1 +6% (field-discovery bookkeeping)
moving pedestrian, 1.2 m/s head-onreached, 50 s0.38 m to the movermagnetic steering active in the encounter

It took five fixed-mode flights to get there; each exposed a mechanism the ideal loop cannot show (grid escape, an unanchored z-channel, anchor positive feedback, a boundary slingshot through tracking lag, a mirage sink onto the low cylinder). All fixes live at the velocity-command interface; the control law never changed. The T1 margin is exponentially conservative: non-zero, so collision is topologically ruled out, but real clearances are about three orders of magnitude larger.

Python · numpy · ROS 2 Humble · PX4 v1.14 · Gazebo Garden · Ambient Riemannian sources ↗