Infra Red Rangers are a type of sensor that uses infra-red light to detect objects. The IR rangers use infra-red light (frequencies just below red light) to 'ping' at an object, and to detect the echo back. They use the time delay from the ping to the echo to calculate the distance the light has travelled, and so half that distance is the range to the object.
These rangers actually tell the controller the distance (digitally, or analog), but they need to be configured for each controller, and the specific environment.