I was thinking medium range (5-40 meters) which is why the infrared and ultrasonic wont cut it.
The timing would probably be a problem... As not sure the Pi would be up to the nanosecond time gaps! So I am guessing the only way to do this would be to build a special bit of hardware?
rotwang wrote:Given that the speed of light is just under 300 million meters per second, you need to be thinking in terms of nanoseconds, not milliseconds, at which level your timings are going to be swamped by the response time of your detector. What range do you expect to cover, and what resolution do you want to achieve? Also do you wish this system to be eye-safe and legal?
In any case, you have no chance at all of measuring time-of-flight using any video system. You may however be able to use triangulation methods to detect the position of the laser spot, Try googling "laser range finding", there's a lot of stuff out there.
Triangulation is something ive looked at with a laser line (like that of a barcode scanner). The benefit of this is I could detect distances of larger areas at once. The draw back is it probably wont work well over longer distances, especially in bright light/outside.
Although a robot with a scanner that looks like its out of Prometheus or the Matrix would be cool!
PiGraham wrote: An alternative is triangulation. Project a laser spot or line, or other pattern, and use a camera to detect the pattern. From displacement of the pattern in the image you can calculate distance.