Hey! I have experience here!
Our 2008
(international rockwell automation award winning (couldn't help it)) control system had this feature until the sensors caught fire at the Midwest regional. It worked great, but we never replaced the sensors.
I took it a little further than just stopping though. Our control system allowed for distance/bearing waypoints and arc commands, so the distance data from an array of 2 ultrasonic sensors on the front of the robot (after being washed through a continuous averager and rejection filter to get rid of individual sample point noise characteristic of vibrating ultrasonic sensors) was used as a 'floating' waypoint. This allowed the lower level acceleration/deceleration/velocity control layer to handle a smooth deceleration to a stop at a specified minimum distance from an object ahead (I had it at 36" since the sensor might be looking at something inside the robot ahead). The cool (unexpected) bonus? If the object approached the robot... the robot backed up to hold it's distance. And, though it never occured in competition, since the waypoint handling layer sat where it was in the control structure, the robot could keep track of it's position and reverse-interpolate an arc if that was the command it was currently executing.
Great feature to add. I highly suggest you add at least a little bang bang control loop to hold distance from an object as you approach... since then you can badge your robot as having adaptive cruise control! (ooooh!

)
-q
p.s. to get back on topic, use ultrasonic sensors
