In this work an obstacle avoidance method is proposed for mobile robot autonomous navigation using a stereo camera as unique sensor. For each point of the world the disparity is computed from left and right images. With this approach, it is possible to determine the distance of nearby objects. Moreover, an elevation map is also computed for each pair of images. This map is used to remove the floor information in order to consider only the distances to the objects. Finally, using the depth and elevation maps an heuristic is defined to guide the robot avoiding obstacles. The method was successfully tested on indoor and outdoor environments.