Ultrasonic and Sonar Range Sensors
An ultrasonic sensor sends a chirp of sound and times the echo. It is cheap and works on glass and in the dark, but its beam is wide, and sound bounces off slanted walls like light off a mirror. Both cause readings that a robot must treat with care.
Range from time of flight
Sound travels at about \(c = 343\) m/s in air. The sensor measures the round trip time \(t\) of the echo:
What to notice
Each reading is drawn as an arc, not a point, because the sensor only knows that something lies somewhere in its beam at that distance. A wide beam spots objects reliably but smears them sideways, so a doorway can look closed.
When the beam hits a wall at a shallow angle, the sound bounces away and no echo comes back, or it bounces off a second wall first. Then the reading is too long, shown in amber, or missing, shown in gray. This is called specular reflection, and the bounced case is multipath. Robots that use sonar combine many readings with probability, which is where occupancy grid mapping began.