In traditional approaches to spatial learning, mobile robots in unstructured unknown environments try to build metrically accurate maps in an absolute coordinate system, and therefore have to cope with device errors. We use a qualitative method which can be robust in the face of various possible errors in the real world. Our method uses a multi-layered map which consists of procedural knowledge for movement, topological model for the structure of the environment, and metrical information for geometrical accuracy. The topological model consists of distinctive places and local travel edges linking nearby distinctive places. A distinctive place is defined as the local maximum of some measure of distinctiveness appropriate to its immediate neighborhood, and is found by a hill-climbing search. Local travel edges are defined in terms of local control strategies required for travel. The identification of distinctive places and travel edges and the use of local control strategies make it possible to largely eliminate cumulative error, resulting in an accurate topological map even in the face of sensory or motor errors. How to find distinctive places and follow edges is the procedural knowledge in the map, and the distinctive places and the travel edges have metrical descriptions for local geometry on the top of the topological map. The metrical descriptions are integrated gradually for global geometry by using local coordinate frames and a best-fit method to connect them. With a working simulation in which a robot, NX, with range sensors explores a variety of 2-D environments, we show its successful results in the face of random and simple systematic device errors.