Automatic Ping Pong Collector

The sound sent by the ultrasonic sensor is not a narrow beam, it's more like a cone. About 15 degrees. You can't really hope to be able to reconstruct the geometry of your surroundings reliably with it, at least not without using a lot of post processing and perhaps machine learning... This being said, the "radar" technique is usually suficcient for avoiding obstacles in environment consisting of just walls and no narrow poles or silly stuff like that. I remember having done something like this before; I used 2 sensors, one ultrasonic and one light reflective distance sensor. I used the latter with a PID control loop to make it run close to a wall. That was in a controlled maze environment.

Well anyway. For obstacle avoidance, the simplest and best way (in my opinion) is doing this:

  1. have ultrasonic sensors all around you, maybe like 6 of them...
  2. give your robot 2 differential wheels (meaning it steers by running one forward and one backwards)
  3. make the robot perfectly round by giving it a cylindrical bumper with the center right between the 2 wheels
  4. if you're not expecting any thin poles to be around, also preferably put wheels on the cylinder, so when it bumps into the wall, it just continues riding along it.

Now, this will work perfectly until you want your robot to ride under a bridge-like structure. Then it might not recognize it, headbump it and tip over.