Home▸Robotics & Kinematics▸Optical-Flow Obstacle Avoidance (2D)

Optical-Flow Obstacle Avoidance (2D)

A camera-only drone flies through a pillar field with no lidar and no stereo rig — it steers away from whichever side of its (simulated) onboard view shows obstacles sweeping past fastest, the same optical-flow trick flying insects use.

Robotics & Kinematics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-optical-flow-obstacle-avoidance ↗ Open standalone

This 2D companion runs the identical optical-flow steering law as the 3D version — flow proportional to forward speed over distance, steering bias equal to the right-half minus left-half average flow — but renders it as an overhead flight-path view next to a reconstructed onboard camera panel instead of a full WebGL perspective camera, so the same left/right flow imbalance that steers the drone is directly visible as colour-coded circles sweeping across the bottom panel.

⚙ Under the hood

Top-down 2D optical-flow obstacle avoidance: a camera-only drone steers away from whichever side of its simulated onboard view shows obstacles sweeping past fastest, with forward speed, obstacle density and steering gain as live controls.

optical flowcomputer visionobstacle avoidancebio-inspireddroneroboticsno depth sensor

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)