Artificial potential field navigation (Khatib, 1986) treats the robot as a point sliding downhill in a scalar potential U(q) built from two parts: an attractive bowl centred on the goal, and a repulsive wall around every obstacle. The robot's velocity is simply the negative gradient of the total field:
U(q) = U_att(q) + Σᵢ U_rep,i(q)
U_att(q) = ½ k_att · ‖q − q_goal‖²
U_rep,i(q) = ½ k_rep · (1/ρᵢ(q) − 1/ρ₀)² if ρᵢ(q) ≤ ρ₀, else 0
v(q) = −∇U(q) (clamped to v_max)
Here ρᵢ(q) is the clearance from the robot to obstacle i's surface, and ρ₀ is the influence radius beyond which that obstacle exerts no push. The attractive term pulls linearly toward the goal (a paraboloid); each repulsive term blows up to infinity at the obstacle surface and vanishes smoothly at ρ₀, so ∇U is continuous everywhere outside the obstacles.
- k_att / k_rep — relative strength of the pull toward the goal versus the push away from obstacles. Raise k_rep and the robot swings wider around obstacles; raise k_att and it cuts corners more aggressively.
- ρ₀ — how far an obstacle's influence reaches. Larger values make the robot react to obstacles earlier but shrink the safe corridor between two close obstacles.
- Vector field — arrows show −∇U/‖∇U‖ (the direction the robot would move) sampled on a grid, coloured by gradient magnitude.
- Local minima — the field's best-known limitation: when an obstacle sits directly between the robot and the goal, the repulsive and attractive gradients can cancel exactly before the robot arrives, trapping it. The status panel detects this in real time.
Real-world relevance: this exact gradient-descent scheme (or the closely related "vector field histogram") still runs as the reactive, low-latency layer of many mobile-robot and drone navigation stacks, underneath a slower global planner such as A* or RRT that handles the local-minimum cases the field alone cannot.