Use the Touch Sensor

Have your robot move, bump into something, then return to the spot it started.