Fast, On-Line Learning of Globally Consistent Maps
Fast, On-Line Learning of Globally Consistent Maps
Fast, On-Line Learning of Globally Consistent Maps
c 2002 Kluwer Academic Publishers. Manufactured in The Netherlands.
TOM DUCKETT
Department of Technology, University of Örebro S-70182 Örebro, Sweden
[email protected]
Abstract. To navigate in unknown environments, mobile robots require the ability to build their own maps. A
major problem for robot map building is that odometry-based dead reckoning cannot be used to assign accurate
global position information to a map because of cumulative drift errors. This paper introduces a fast, on-line
algorithm for learning geometrically consistent maps using only local metric information. The algorithm works
by using a relaxation technique to minimize an energy function over many small steps. The approach differs from
previous work in that it is computationally cheap, easy to implement and is proven to converge to a globally optimal
solution. Experiments are presented in which large, complex environments were successfully mapped by a real
robot.
Keywords: simultaneous localization and mapping, concurrent map-building and self-localization, relaxation
algorithm, Gibbs sampling, learning and adaptation
T
where δ ji = ( t ji δt )/T ji , that is the average distance
between updates, the δδ , etc. are global noise esti-
Figure 2. Example of how the robot travels between two map nodes, mates of the subscripted variables, and φ ji is the rota-
constantly updating its heading. In reality the number of update steps tional error between the two nodes, where R(φ) is the
is higher. rotation matrix
cos φ sin φ
R(φ) ≡ . (6)
at the tth step. Then − sin φ cos φ
d ji = δt cos αt + δt sin αt , (1) is invariant to global rotations and depends only on the
t t direction of travel. The noise parameters δδ , etc. are
T calculated by maximum likelihood estimation as part
−1 t
ji
δt sin αt
θ ji = tan T ji , (2) of the relaxation algorithm (Eqs. (12)–(14)).
t δt cos αt
3.2. The Algorithm
where T ji is the number of steps, i.e., the number of
updates the robot performs along a path. The map can be considered as a set of free nodes that are
Assuming that the number of updates made while held together by springs, where each spring connects
traveling between two map places is large and that the two adjacent places i and j (this analogy can also be
statistical properties of each step are independent, the found in (Lu and Milios, 1997a; Golfarelli et al., 1998;
Central Limit Theorem (Reif, 1982) implies that mea- and Shatkay, 1998)). Each spring reaches minimum
surements of d ji and θ ji will be normally distributed energy when the relative displacement between the co-
around their true values. ordinates of node i and node j is equal to the vector
Suppose that the noise properties are the same along (di j , θi j ) measured by the robot. Equilibrium is reached
a path between two map places (but not necessarily in the whole map when the total energy over all of the
between paths) and that successive measurements are springs reaches a global minimum. Thus, global con-
independent. That is, the measurement of the path from sistency is maintained in the map by minimizing the
place i to place j is independent of the measurement following energy function, which corresponds to the
from place j to place k (this means that the model log likelihood:
cannot deal with cumulative phenomena such as battery
drain). Then we can write the estimates of the distance
δt = δt∗ + δt
(3) where
j refers to the sum over the neighbors of
θ ji
αt = αt∗ + αt (4) node i, ri = (xi , yi )T , and D ji = d ji ( cos
sin θ ji
).
290 Duckett, Marsland and Shapiro
Since each C ji is symmetric, Since E is bounded below, the algorithm must converge
and any legitimate stopping criterion must be reached.
The energy function is quadratic and therefore has a
∇ Ei = 2 C −1
ji (ri − r j − D ji ), (8) unique minimum, so the algorithm can only converge
j
to a global minimum. The fact that the energy function
is quadratic also means that the updates could be com-
when the position of node i is updated. Therefore, the puted in a single step by inverting the (N × N ) matrix
algorithm that finds the maximum likelihood solution showing connections between all of the nodes in the
is the one that finds the ri
that minimizes E, that is, map. Our system performs an iterative update instead,
−1 which is computationally simple and fast, and therefore
more suitable for robotics applications.
ri
= C −1
ji C −1
ji (r j + D ji ). (9)
j j
3.4. Complexity Analysis
This can be considered as a form of Gibbs sampling
at zero temperature (Reif, 1982). One component is The computational cost of the new algorithm is lin-
optimized by keeping all of the others fixed. ear in the number of places in the map. Because the
The algorithm derived from Eq. (9) is given in Fig. 3. algorithm makes an iterative refinement to the existing
The basic principle of the algorithm is to “move each solution, rather than recalculating the entire coordinate
node to where its neighbors think it should be”. By it- system from scratch, only one iteration is typically re-
eration, the coordinates in the map converge towards quired whenever new information is added to the map.
a global minimum in the energy function (Eq. (7)). The complexity of the algorithm is thus bounded by
For on-line map learning, steps 2 and 3 in Fig. 3 are O(N M), where M is the maximum number of neigh-
inter-leaved with the rest of the navigation control soft- bors per node. For a topological map, the number of
ware so that the map is adapted continually during links per node will not grow with the size of the map,
exploration. so M is constant and the overall complexity is approxi-
An example illustrating the convergence of the re- mately O(N ). This compares favorably with the worst
laxation algorithm is given in Figs. 4 and 5. In this ex- case O(N 3 ) complexity of matrix inversion methods
periment, the coordinates of the self-acquired map in such as Lu and Milios (1997a) and Golfarelli et al.
Fig. 4 were randomly reinitialized to arbitrary values, (1998) (though that can be reduced to O(N 2 ) by using
then the algorithm was iterated until the map returned a sparse matrix solver if the covariance matrix is not
to its globally consistent solution. (Note that this differs required (Frese and Hirzinger, 2001)).
from the normal, on-line use of the algorithm, where
the coordinates are not reinitialized; rather, the existing
coordinates are adapted continually over time.) 4. Robotic Implementation
ji (ri − r j − D ji )
j
described in Duckett and Nehmzow (2001). In this ap-
proach, a separate behavior is used to rotate the robot’s
− (ri − r j − D ji )T C −1
ji (ri − r j − D ji ) (15) turret at small speeds in the direction of an arbitrary
≤ 0. (16) ‘North’, as indicated by the compass. Then the angular
Fast, On-Line Learning of Globally Consistent Maps 291
estimates are obtained by measuring the relative tation around the average value of ‘North’. We have
displacement of the turret against the direction of travel. found that the performance of this method degrades
The effect of this behavior is to smooth out any fluc- gracefully with respect to the magnetic variations in
tuations in the compass readings caused by electro- the environment. It also has the advantage of keeping
magnetic disturbances, maintaining a constant orien- the robot’s range-finder sensors at a steady orientation,
292 Duckett, Marsland and Shapiro
Figure 4. Left: floor plan of a corridor environment at Manchester University (size 34 m × 33 m). Right: the corresponding map acquired by
the robot.
Figure 5. Convergence of the relaxation algorithm. In the first picture, the coordinates of the self-acquired map shown in Fig. 4 have been
randomly reinitialized. The remaining pictures show the map after 10, 25, 50, 100, 250, 500 and 1000 iterations respectively of the relaxation
algorithm.
which can help to reduce the noise on the ultrasonic – Predicted. Places presumed to exist but not yet vis-
sensor readings. This compass sense was also used for ited by the robot.
the on-line dead reckoning, as illustrated in Fig. 6. – Confirmed. Places actually visited by the robot.
Figure 6. Left: raw odometry. Right: compass-based odometry. The accumulated rotational drift in the robot’s raw odometry was removed
on-line using the compass sense. In this example, the robot repeatedly traversed the environment of Fig. 4 by wall-following.
ci
j = (1 − λ)ci j . (18)
k 5. Experimental Results
σx2 = , (20)
(Mx∗
− M̄ x )2
k The system was tested in the office environment shown
σ y2 = ∗
, (21) in Figs.10 and 11. The map acquired by the robot in
(M y − M̄ y )2
Fig. 12 shows the position of the places in global co-
where σx2 refers to the error estimate for the ordinates calculated by the new algorithm. To illus-
x-histograms, Mx∗ refers to the value of Match( ) pro- trate the accuracy of the acquired map, we have also
duced by the best-matching alignment of x histograms combined the relaxed coordinates with the recorded
for the current place, M̄ x refers to the mean value of sonar data to produce a global occupancy grid model
Match( ) in the convolution of x histograms, and the of the environment, using the standard technique de-
constant k = 1.0 m2 in these experiments. veloped by Moravec and Elfes (1985). The derived
To minimize the overall error due to scan matching, gridmap is shown in Fig. 13. The map has a resolution
all of the estimates of the offset from the place center of 0.15 meters, and should be accurate enough for safe
that are made by the robot as it travels through the navigation and planning. This can be compared to the
current place are combined together using an iterative gridmap constructed from the robot’s compass-based
filtering technique, which is specified by the following odometry in Fig. 14.
equations: The entire process requires minimal computational
resources. Maximum likelihood estimation with the
σx2
r x = r x
+ (r ∗ − r x
), (22) new algorithm was performed on-line as part of the
σx2
+ σx2∗ x
1 1 1
= 2 + 2, (23)
σx2 σx
σx ∗
where r x is the new x-offset relative to the place cen-
tre, r x∗ is the x-offset from the latest observation, and r x
Figure 11. A semi-structured office environment at Örebro University, with an approximate size of 46 × 12 meters.
Figure 12. The map acquired with the new map learning algorithm. The links actually traversed by the robot are shown in bold, and the inferred
links are shown by dotted lines (only the traversed links were used to estimate the node coordinates).
Figure 13. The global gridmap constructed with the new algorithm, by combining the recorded sonar data with the global coordinates generated
by the algorithm.
Figure 14. The global gridmap constructed without the new algorithm, by combining the recorded sonar data with the global coordinates
calculated using the compass and odometry. Without the algorithm, the robot fails to build a consistent map.
constructed using laser range-finder sensors without ter data) to avoid local maxima and hence build topo-
a compass. Their approach maintained a history of all logically correct maps. The approach would not scale
the local frames of sensor data used to construct the well to larger environments due to the large amount of
map and the network of spatial relations between the data needed and the high computational cost of the EM
frames. The spatial relations were obtained either by algorithm.
odometry or pairwise matching of the range-finder data A similar approach is described by Thrun et al.
in adjacent frames, using the scan matching algorithm (1998), where an EM algorithm was used to learn an
described in Lu and Milios (1997b). A maximum like- occupancy grid model of a large environment (90 m ×
lihood algorithm was then used to derive a position 90 m). Again, this method is extremely expensive, re-
estimate for each of the frames, by minimizing the quiring up to two hours of computation to generate a
Mahalanobis distance between the actual and derived grid map with a spatial resolution of 1 meter, and it
relations over the whole network of frames. A draw- depends on a manually labeled set of landmarks. This
back of this method is that it requires the inversion of approach was later extended by Burgard et al. (1999) to
a 3n × 3n matrix, where n is the number of frames, so use a network of local gridmaps constructed from sonar
the approach is likely to be computationally expensive data, as in our approach, instead of the pre-defined
in large environments. This approach was extended by landmarks.
Gutmann and Konolige (1999) to build maps in envi-
ronments containing large cycles. 7. Discussion
A similar approach is described by Golfarelli et al.
(1998), using a graph-based model of the robot’s envi- In this paper, we have presented a relaxation algorithm
ronment. Their algorithm operates under the assump- for maintaining geometric consistency in a robot’s map.
tion of no topological errors, so that the robot recog- The algorithm is computationally very cheap, enabling
nises a place when it visits it for a second time. Their globally consistent map learning in real-time. Its O(N )
system was based on the analogy of a mechanical spring complexity compares favorably to that of matrix in-
system, in which each link in the graph is modeled version methods such as Lu and Milios (1997a). The
by a pair of springs, a linear axial spring and a ro- method is particularly efficient because it does not
tational one. The elasticity parameters of the springs throw any useful information away; instead of recalcu-
were used to represent the uncertainty in the robot’s lating the entire map from scratch every time, the exist-
odometry measurements, and the equilibrium position ing solution is refined. As a result, only small changes
for the whole structure was then calculated, generating to the map are typically required when new informa-
a 4n × 4n matrix that requires inverting. The algorithm tion is added. In the experiments conducted, we found
can be applied with or without a compass, although all it was only necessary to run the relaxation algorithm for
of their experiments appear to use a compass. Their a single iteration at each cycle of the map acquisition
results seem qualitatively similar to ours (at least by process.
visual inspection) despite the added complexity of the The method works by minimizing an energy func-
mechanical spring system model. tion in lots of small steps, rather like a Hopfield network
Shatkay and Kaelbling (1997) and Shatkay (1998) (Hopfield, 1982). Because this energy function corre-
addressed the problem of incorporating metric infor- sponds to the log likelihood, minimizing this function
mation from odometry into robot maps based on Par- provides us with the maximum likelihood solution to
tially Observable Markov Decision Process (POMDP) the map learning problem, provided that the map is
models and enforcing geometric consistency in these topologically correct. We have proved that the relax-
maps, both with and without a compass. The sensor ation algorithm always converges to a globally optimal
data from which the models were acquired were first solution, in contrast to EM algorithms, which are sub-
collected by the robot under manual control, then an ject to local optima. We should, of course, point out
expectation-maximization (EM) algorithm was used that our method assumes a place recognition system
to find the map which best fitted the recorded data. (in other words, no topological errors) before maxi-
While this algorithm does not explicitly make the as- mum likelihood estimation takes place, an assumption
sumption of an initial topological map, in practice it that is not made by Shatkay and Kaelbling (1997) and
depends heavily on a sufficiently good initial model Burgard et al. (1999). However, all of our experiments
(obtained in Shatkay (1998) from the recorded odome- were conducted on a real, self-navigating robot using a
298 Duckett, Marsland and Shapiro
real self-localization system (Duckett and Nehmzow, Appendix A: A Simplification of the Algorithm
2001), without requiring any pre-installed environ-
ment model, thus demonstrating the efficacy of our In the derivation of the algorithm in Section 3, various
approach. assumptions were made, e.g., that small angle approxi-
Through our experiments, we have demonstrated mations could be made, and that the covariance matrix
a complete solution to the problem of simultaneous C ji was symmetric. In fact, the most common noise
localization and mapping (SLAM) for indoor, office model estimate for a mobile robot’s position is an el-
environments. This solution agrees favorably with lipse, with the major axis lying perpendicular to the
the theoretical requirements for an ideal SLAM so- direction of travel, as in Smith and Cheeseman (1986).
lution outlined by Frese and Hirzinger (2001), as However, when a compass is used, the noise on the dis-
follows: tance measurement (odometry) could be greater than
the noise on the rotation measurement, so that the ma-
1. The hybrid metric-topological representation pre- jor axis lies along the direction of travel. Both of these
serves the “certainty of relations despite the uncer- models assume that the robot is perfectly symmetrical,
tainty of positions”. which is not necessarily the case. For instance, the robot
2. This representation also means that the memory re- may measure turns more accurately anticlockwise than
quired for storage grows only linearly with the num- clockwise, or one of the wheels could slip more than
ber of nodes in the map. the other, so that the robot does not follow a straight
3. The new map learning algorithm is computationally line.
cheap, having a cost that is linear in the number of In previous experiments (Duckett et al., 2000), we
places stored in the map. found that surprisingly good results can be obtained by
making one further simplifying assumption: that the
There is one possible situation where the new algo- noise in the robot’s position estimates is distributed
rithm may be significantly slower than usual—that is equally in all directions around points in Cartesian
if the robot closes a very large cycle and the accumu- space according to a Gaussian distribution, i.e., a cir-
lated odometric error is very high. Here it might be cle rather than an ellipse in used to represent the area
faster to use a simultaneous equation solver, as in Lu in which the robot may be located with non-negligible
and Milios (1997a) and Gutmann and Konolige (1999), probability. Thus, the uncertainty in any point to point
depending on the magnitude of the initial error in the measurement can be represented by a single variance
map (cf. Fig. 5). However, while theoretically possible, measure (this makes the covariance matrix C ji propor-
this situation tends to be very rare in practice, and re- tional to the identity matrix). For dead reckoning, this
laxation should be faster in the vast majority of cases. can be taken as some small proportion, e.g., 5%, of the
The relatively large loops in the test environment of distance travelled by the robot. The algorithm can then
Fig. 11 did not pose a problem in any of the experi- be described in two steps, as given in Fig. 15. While
ments conducted. less accurate than the algorithm in Fig. 3, this variant
A further benefit of the new algorithm is that all of the is much easier to implement, and is useful when only
global noise parameters are continually re-estimated by approximate geometric information is required in the
the algorithm itself, so we do not need to compute the robot’s map.
values of these parameters ourselves. This is a distinct
advantage for building autonomous robots, since re-
ducing the number of pre-installed parameter values Appendix B: Relaxation without a Compass
reduces the dependence of the robot on a priori knowl-
edge provided by the system designer. Although in this paper we have used a compass to
Future work will investigate more intelligent strate- provide a global ‘North’ from which all angular mea-
gies for selecting the landmarks or place signatures surements are taken, this should not be necessary if
in the topological map (see Marsland et al. (2001) the robot is equipped with some other means of mea-
for some first results). The current strategy of adding suring the angles that it turns through. Suppose that
new places at 1 meter intervals is clearly inefficient, the robot has the ability to measure the change in its
and could be greatly improved. We will also con- pose when moving between two adjacent places, e.g.,
sider building maps in environments containing large by matching laser range-finder scans, as in Weiss and
cycles. von Puttkamer (1995), Lu and Milios (1997a), and
Fast, On-Line Learning of Globally Consistent Maps 299
a) For each of the neighbors j of node i , i.e., the places that are topologically connected
to i , obtain an estimate r
ji of the coordinates of node i using
r
ji = r j + D ji , (28)
ji r ji , (29)
j j
where
j refers to the sum over the neighbours of node i , and v ji is the variance for
the link from node i to node j .
2. Repeat from step 1 untill the change in energy falls below some pre-defined threshold, or
some other stopping criterion is reached.
Figure 15. A simplification of the map learning algorithm, based on the assumption of circular noise in the robot’s odometry.
Lu, F. and Milios, E. 1997a. Globally consistent range scan alignment his B.Sc. from Warwick University in Computer and Management
for environment mapping. Autonomous Robots, 4:333–349. Sciences, M.Sc. from Heriot-Watt University in Knowledge Based
Lu, F. and Milios, E. 1997b. Robot pose estimation in unknown en- Systems, and Ph.D. from Manchester University on simultaneous
vironments by matching 2D range scans. Intelligent and Robotics localisation and map-building for mobile robot navigation. His re-
Systems, 18:249–275. search interests include autonomous robots, machine learning and
Marsland, S., Nehmzow, U., and Duckett, T. 2001. Learning to select neural networks, artificial intelligence, and biology inspired sensor
distinctive landmarks for mobile robot navigation. Robotics and systems.
Autonomous Systems, 37(4):241–260.
Moravec, H. and Elfes, A. 1985. High resolution maps from wide
angle sonar. In Proceedings of the IEEE International Confer-
ence on Robotics and Automation (ICRA’85), St. Louis, Missouri,
pp. 116–121.
Reif, F. 1982. Fundamentals of Statistical and Thermal Physics.
McGraw-Hill: New York.
Shatkay, H. 1998. Learning models for robot navigation. Ph.D. The-
sis, Department of Computer Science, Brown University.
Shatkay, H. and Kaelbling, L.P. 1997. Learning topological maps
with weak local odometric information. In Proceedings of the 15th
International Joint Conference on Artificial Intelligence.
Smith, R. and Cheeseman, P. 1986. On the representation and es- Stephen Marsland recently completed his Ph.D. on unsupervised
timation of spatial uncertainty. International Journal of Robotics novelty detection and is currently a lecturer of machine learning at
Research, 5(4):56–68. the University of Manchester. Prior to that he completed a degree
Thrun, S., Burgard, W., and Fox, D. 1998. A probabilistic approach to in Mathematics and Computation at Somerville College, University
concurrent mapping and localisation for mobile robots. Machine of Oxford. His research interests include many aspects of theoreti-
Learning, 31(5):1–25. cal machine and statistical learning, such as neural networks, self-
Weiss, G. and von Puttkamer, E. 1995. A map based on laserscans organisation and topology preservation, and Gaussian processes. He
without geometric interpretation. In Proceedings of Intelligent is interested in many applications of machine learning techniques
Autonomous Systems 4 (IAS-4), Karlsruhe, Germany, pp. 403– to real world domains, such as robotics, medical informatics and
407. bioinformatics.
Yamauchi, B. and Beer, R. 1996. Spatial learning for navigation in
dynamic environments. IEEE Transactions on Systems, Man and
Cybernetics Section B, 26(3).