I've been making plan for an obstacle-avoiding robot, and was originally planning to use a Sharp IR range finder for it (10 - 80cm), but after seeing other sonar range finders, and other people's projects (the majority of the ones I see seem to use sonar), I was wondering:
Which is better: IR or sonar?
'Cos IR recievers can be affected by ambient IR light, and the best i;ve seen goes up to 150cm, whereas I;ve seen sonar ones up to 7.4m, roundabout, and they can't be affected by ambient sound (I think).