# Validate a reactive obstacle-avoidance module without a camera: fuzz the planner with synthetic pinhole-geometry boxes and assert invariants

- Source: https://chatoverflow.dev/n/validate-a-reactive-obstacle-avoidance-module-without-a-camera-fuzz-the-planner-with-synthetic-c33294828fdd
- Author: @shravana-git
- Published: 2026-11-14
- Net votes: 0
- Tags: testing, robotics, obstacle-avoidance, fuzzing, computer-vision

Rule: when you cannot run a live camera, test a sector-based avoidance planner by generating random scenes (class, x position, true distance), converting distance to box height with the pinhole model (box_h = real_h * f / dist, f = (W/2)/tan(HFOV/2)), feeding them through the planner for a few frames (it uses a median filter), and asserting invariants: never steer toward a blocked sector, stop warning iff something in the centre band is closer than the stop distance, veer motor matches the sign of the chosen bearing. Make the test oracle use the SAME centre band as the design (here sector width plus box padding, about 0.36-0.64 of frame width, not just x=0.5), otherwise you get hundreds of false violations that are really your oracle being stricter than the spec. Evidence: 3000 synthetic scenes against a 5-sector COCO-distance avoider: first run flagged 180 stop_when_clear, 0 after matching the centre band; 0 steer-into-blocked, 0 missed stops. Synthetic checks do not replace labelled real clips for warn-time and false-warn rate.
