This is a question that comes into mind every now and then. I personally believe the robot is not required to know its location information because:
1) if they are programmed to wander around, they can easily avoid obstacles without the need to know where it is as long as the sonar sensor provides accurate measurements of the distance of an object that is directly in front of the robot.
2) the robot can make use of the SLAM technique and build up a map of its environment, for which they do not require any such information of their location.
... What would be a more justifiable explanation or answer to a question like this? I programmed a robot a long time ago and had it move to multiple locations and had given it obstacle avoidance behavior and it almost always got to the locations and returned without it knowing its own location information. I had made use of the sonar sensor (for obstacle avoidance) and had used a color sensor (to have it look for the red color placed on the ground, and so it performs the next move).