Free Access

Robot Localization: An Introduction

Shoudong Huang

Shoudong Huang

University of Technology Sydney, Sydney, NSW, Australia

Search for more papers by this author
Gamini Dissanayake

Gamini Dissanayake

University of Technology Sydney, Sydney, NSW, Australia

Search for more papers by this author
First published: 15 August 2016
Citations: 16

Abstract

Robot localization is the process of determining where a mobile robot is located with respect to its environment. Localization is one of the most fundamental competencies required by an autonomous robot as the knowledge of the robot's own location is an essential precursor to making decisions about future actions. In a typical robot localization scenario, a map of the environment is available and the robot is equipped with sensors that observe the environment as well as monitor its own motion. The localization problem then becomes one of estimating the robot position and orientation within the map using information gathered from these sensors. Robot localization techniques need to be able to deal with noisy observations and generate not only an estimate of the robot location but also a measure of the uncertainty of the location estimate. This article provides an introduction to estimation of theoretic solutions to the robot localization problem. It begins by discussing the mathematical models used to describe the robot motion and observations from the sensors. Two of the most common probabilistic techniques, the extended Kalman filter and the particle filter, that can be used to combine information from sensors to compute an estimate of the robot location are then discussed in detail and illustrated by simple examples. A brief summary of the large body of literature on robot localization is presented next. Appendices that present the essential mathematical background and alternative techniques are provided. The MATLAB code of the localization algorithms is also available.

1 Introduction

Robot localization provides an answer to the question: Where is the robot now? A reliable solution to this question is required for performing useful tasks, as the knowledge of current location is essential for deciding what to do next (1, 2). This article focuses on the solutions to the robot localization problem when the map of its environment is available. The problem then becomes one of estimating the robot pose (position and orientation) relative to the coordinate frame in which the map is defined. Typically, the information available for computing the robot location is gathered using onboard sensors, while the robot uses these sensors to observe its environment and its own motion. Given the space limitations, alternative scenarios where sensors such as surveillance cameras are placed in the environment to observe the robot or the robot is equipped with a receiver that provides an estimate of its location based on information from an external source (e.g., a Global Positioning System (GPS) that uses satellites orbiting the earth) are excluded from the following discussion.

A mobile robot equipped with sensors to monitor its own motion (e.g., wheel encoders and inertial sensors) can compute an estimate of its location relative to where it started if a mathematical model of the motion is available. This is known as odometry or dead reckoning. The errors present in the sensor measurements and the motion model make robot location estimates obtained from dead reckoning more and more unreliable as the robot navigates in its environment. Errors in dead reckoning estimates can be corrected when the robot can observe its environment using sensors and is able to correlate the information gathered by these sensors with the information contained in a map. How this can be achieved within a probabilistic framework will be discussed in this article.

The formulation of the robot localization problem depends on the type of the map available as well as on the characteristics of the sensors used to observe its environment. In one possible formulation, the map contains locations of some prominent landmarks or features present in the environment and the robot is able to measure the range and/or bearing to these features relative to the robot. Alternatively, the map could be in the form of an occupancy grid that provides the occupied and free regions of an environment and the sensors on board the robot measures the distance to the nearest occupied region in a given direction. As the information from sensors is usually corrupted by noise, it is necessary to estimate not only the robot location but also the measure of the uncertainty associated with the location estimate. Knowledge of the reliability of the location estimate plays an important role in the decision-making processes used in mobile robots as catastrophic consequences may follow if decisions are made assuming that the location estimates are perfect when they are uncertain. Bayesian filtering (3) is a powerful technique that could be applied to obtain an estimate of the robot location and the associated uncertainty. Both extended Kalman filter (EKF) and particle filter provide tractable approximations to Bayesian filtering and they are the focus of this article.

The remainder of this article is structured as follows. Section 2 provides the mathematical models for describing the robot motion and the relationships between the sensor measurements and the robot location for both feature-based and occupancy grip-based maps. Section 2.3 presents an algorithm based on the EKF for robot localization using a feature map. Section 1 presents a particle filter for locating a robot in a grid map. Section 2 presents a brief discussion of alternative localization techniques that have been proposed in the robotics literature. The mathematical background to estimation theory and two alternative robot localization techniques are presented in the appendices. The MATLAB code of the localization algorithms for the simple examples is available at https://github.com/UTS-CAS/Robot-Localization-examples and can also be downloaded here.

2 Vehicle Model and Sensor Models

The mathematical ∼ models describing the behavior of the robot and the sensors mounted on it are the most important components in the formulation of the robot localization problem. The vehicle kinematic model describes the equations governing the robot motion in response to control actions. Figure 1 illustrates a differential drive robot operating on a two-dimensional plane where the forward velocity and the angular velocity of the robot body can be controlled using two motors that drive the two wheels. The differential equation that describes how the robot position and orientation evolve with time as a function of its forward and angular velocity is known as the robot motion model.

Details are in the caption following the image
A differential drive robot operating in a two dimensional plane.

The relationship between the observations from the sensors and the location of the robot in the map is known as the sensor model. The sensor model is dependent on the characteristics of the sensor mounted on the robot as well as on the way the map of the environment is represented. As discussed in Section 1, the map of the environment is typically defined either using coordinates of known landmarks or features, or in the form of an occupancy grid where the status of each grid cell defines whether the area represented by the cell is occupied or free space. Figure 2 illustrates a map with four landmarks, while Figure 3 shows an occupancy grid map where the occupied areas are shaded.

Details are in the caption following the image
Localization problem with a landmark-based map. The map is defined by four landmarks (black dots) in the environment located at (2, 5), (2, − 2), (4, 5), (4, − 2), respectively. The robot (the red circle showing the position of robot center, the red arrow showing the orientation) starts from (0, 0, 0)T at time 0. At time steps 1 and 2, it observes landmarks 1 and 2; at time step 3, it observes landmarks 1 and 3, at time step 4, it observes landmarks 3 and 4. Robot to landmark observations are indicated by blue lines.
Details are in the caption following the image
A localization problem with an occupancy grid map: The shaded areas represent occupied cells; the white area represents the free space; the robot moves a few steps (a robot pose is shown as a circle plus an arrow); the readings from the laser range finder at the first pose (red) are depicted as red lines.

In the following sections, a vehicle model and the sensor models typically used for robot localization are described. For simplicity and clarity of notation, it is assumed that the robot has three degrees of freedom and is moving in a two-dimensional plane.

2.1 Vehicle Model

The kinematic equations governing the motion of the differential drive robot illustrated in Figure 1 are given by
x · r ( t ) = ( v ( t ) + δ v ( t ) ) cos ( φ r ( t ) ) y · r ( t ) = ( v ( t ) + δ v ( t ) ) sin ( φ r ( t ) ) φ · r ( t ) = ω ( t ) + δ ω ( t ) (1)
where the coordinates xr(t) and yr(t) describe the position of the center of the mobile robot at time t, the orientation φr(t) is the angle between the heading of the robot and the x-axis of the fixed global coordinate frame. x ˙ r ( t ) denotes the derivative of xr(t) with respect to time t. The forward velocity v ( t ) and angular velocity ω(t) are the control inputs of the robot. δ v ( t ) and δω(t) are the differences between the intended control value and the actual control values (control noises) and are assumed to be zero-mean Gaussian.
Discretizing the continuous-time motion model equation 1 with a sampling time ΔT and the Euler method results in
x k + 1 r = x k r + ( v k + δ v k ) Δ T cos ( φ k r ) y k + 1 r = y k r + ( v k + δ v k ) Δ T sin ( φ k r ) φ k + 1 r = φ k r + ( ω k + δ ω k ) Δ T (2)
where ( x k r , y k r , φ k r ) is the robot location at time step k, v k is the velocity at time k, and ωk is the angular velocity at time k, and δ v k and δωk are the discrete time velocity noises and angular velocity noises, respectively.

2.2 Sensor Model for Landmark-Based Maps

Consider an environment that contains N0 landmarks at known positions ( x L i , y L i ) , i = 1 , , N 0 . For simplicity, the uncertainties associated with landmark locations are assumed to be zero, although it is relatively straightforward to extend the analysis if this is not the case. At each time step while it is in motion, the robot observes the range (distance) and/or the bearing (relative angle) to one or more landmarks. Observation model provides a mechanism for computing the expected values of observations from sensors, given the knowledge of the map and an estimate of the robot location. If the sensor mounted on the robot observes both the range and the bearing to landmark i at time step k + 1, then the observation model is given by
r k + 1 i = ( x L i - x k + 1 r ) 2 + ( y L i - y k + 1 r ) 2 + w r θ k + 1 i = a tan ( y L i - y k + 1 r x L i - x k + 1 r ) - φ k + 1 r + w θ (3)
where w r and w θ are zero-mean Gaussian observation noises.

Laser range finders and ultrasonic sensors are most common sensors used for obtaining range and bearing measurements to landmarks. In case of a sensor that is only able to observe the bearing, for example, a camera, the equation for θ k + 1 i becomes the sensor model. A simple robot localization problem with a landmark-based map is illustrated in Figure 2.

2.3 Sensor Model for Occupancy Grid Maps

Occupancy grid maps provide a discretized representation of an environment where each of the grid cells is classified into two categories: occupied or free. Consider the scenario where a sensor on the robot can determine the distance to the nearest occupied grid cell along a given direction. A laser range finder is such a sensor. These sensors consist of a laser beam that rotates at a relatively high speed on the order of tens of revolutions per second and measures the distance to the obstacle that reflects it. If there is no obstacle within the sensor range, a reflection is not received and the sensor typically reports a nominal maximum distance dmax. Although the range measurements obtained depend on the environment and the robot location, it is not feasible to find an analytical observation model of the form equation 3 in this scenario. However, given an estimate of the robot location and the grid map, the expected value of a range measurement can be numerically obtained using ray casting (4). This makes it possible to evaluate the likelihood of a given pose, which is sufficient in some localization approaches such as a particle filter (see Section 4 for details).

Figure 3 shows a simple example of a robot localization problem where a laser range finder observes an environment described using an occupancy grid. The robot moves a few steps in the environment. The scan provided by the sensor at the first pose is shown in red.

3 Extended Kalman Filter for Localization in Landmark-Based Maps

The localization problem in a landmark-based map is to find the robot pose at time k + 1 as
x k + 1 = ( x k + 1 r , y k + 1 r , φ k + 1 r ) T (4)
given the map, the sequence of robot actions v i , ω i ( i = 0 , , k ), and sensor observations from time 1 to time k + 1.

In its most fundamental form, the problem is to estimate the robot poses xi (i = 0, …, k + 1) that best agree with all robot actions and all sensor observations. This can be formulated as a nonlinear least-squares problem using the motion and observation models derived in Section 2. The solution to the resulting optimization problem can then be calculated using an iterative scheme such as Gauss–Newton to obtain the robot trajectory and as a consequence the current robot pose. Appendix Appendix and Appendix Appendix provide the details on how both linear and nonlinear least-squares problems can be solved, and how the localization problem can be formulated as a nonlinear least-squares problem. The dimensionality of the problem is 3(k + 1) for two-dimensional motion, and given the sampling rate of modern sensors are on the order of tens of hertz, this strategy quickly becomes computationally intractable.

If the noises associated with the sensor measurements can be approximated using Gaussian distributions, and an initial estimate for the robot location at time 0, described using a Gaussian distribution x0 N ( x ˆ 0 , P 0 ) with known x ˆ 0 , P 0 is available (in this article, x ˆ is used to denote the estimated value of x), an approximate solution to this nonlinear least-squares problem can be obtained using an EKF. EKF effectively summarizes all the measurements obtained in the past in the estimate of the current robot location and its covariance matrix. When a new observation from the sensor becomes available, the current robot location estimate and its covariance are updated to reflect the new information gathered. Essential steps of the EKF-based localization algorithm are described in the following:

Let us denote
u k = ( v k , ω k ) T , w k = ( δ v , δ ω ) T . (5)
Then the nonlinear process model (from time k to time k + 1) as stated in equation 2 can be written in a compact form as
x k + 1 = f ( x k , u k , w k ) (6)
where f is the system transition function, uk is the control, and wk is the zero-mean Gaussian process noise wkN(0, Q).
Consider the general case where more than one landmark is observed. Representing all the observations r k + 1 i , θ k + 1 i together as a single vector zk+1, and all the noises w r , w θ together as a single vector vk+1, the observation model at time k + 1 as stated in equation 3 can also be written in a compact form as
z k + 1 = h ( x k + 1 ) + v k + 1 (7)
where h is the observation function obtained from equation 3 and vk+1 is the zero-mean Gaussian observation noise vk+1N(0, R).
Let the best estimate of xk at time k be
x k N ( x ˆ k , P k ) . (8)
Then the localization problem becomes one of estimating xk+1 at time k + 1:
x k + 1 N ( x ˆ k + 1 , P k + 1 ) (9)
where x ˆ k + 1 , P k + 1 are updated using the information gathered using the sensors. EKF framework achieves this as follows. To maintain clarity, only the basic equations are presented in the following, while Appendix Appendix provides a more detailed explanation.
Predict using process model:
x k + 1 = f ( x ˆ k , u k , 0 ) (10)
P k + 1 = J f x ( x ˆ k , u k , 0 ) P k J f x T ( x ˆ k , u k , 0 ) + J f w ( x ˆ k , u k , 0 ) QJ f w T ( x ˆ k , u k , 0 ) (11)
where J f x ( x ˆ k , u k , 0 ) is the Jacobian of function f with respect to x, J f w ( x ˆ k , u k , 0 ) is the Jacobian of function f with respect to w, both evaluated at ( x ˆ k , u k , 0 ).
Update using observation:
x ˆ k + 1 = x k + 1 + K ( z k + 1 h ( x k + 1 ) ) (12)
P k + 1 = P k + 1 KSK T (13)
where the innovation covariance S (here z k + 1 h ( x k + 1 ) is called innovation) and the Kalman gain K are given by
S = J h ( x k + 1 ) P k + 1 J h T ( x k + 1 ) + R (14)
K = P k + 1 J h T ( x k + 1 ) S 1 (15)
where J h ( x k + 1 ) is the Jacobian of function h with respect to x evaluated at x k + 1 .

Recursive application of the above equations every instant a new observation is gathered yields an updated estimate for the current robot location and its uncertainty. This recursive nature makes EKF the most computationally efficient algorithm available for robot localization.

An important prerequisite for EKF-based localization is the ability to associate measurements obtained with specific landmarks present in the environment. Landmarks may be artificial, for example, laser reflectors, or natural geometric features present in the environment such as line segments, corners, or planes (5, 6). In many cases, the observation itself does not contain any information as to which particular landmark is being observed. Data association is the process in which a decision is made as to the correspondence between an observation from the sensor and a particular landmark. Data association is critical to the operation of an EKF-based localizer, as catastrophic failure may result if data association decisions are incorrect.

EKF relies on approximating the nonlinear motion and observation models using linear equations and that the sensor noises can be approximated using Gaussian distributions. These are reasonable assumptions under many practical conditions and therefore EKF is the obvious choice for solving the robot localization problem when the map of the environment consists of clearly identifiable landmarks.

Figure 4 shows the result of EKF localization for the simple problem given in Figure 2. The ground truth of the robot poses and the estimated robot poses are shown in red and blue, respectively. The 95% confidence ellipses obtained from the covariance matrices in the EKF estimation process are also shown in the figure.

Details are in the caption following the image
Result of EKF localization for the simple problem given in Figure 2. The ground truth of the robot poses and the estimated robot poses by EKF are shown in red and blue, respectively. The ellipses are the 95% confidence ellipses obtained from the covariance matrices in the EKF estimation result.

4 Particle Filter for Localization in Grid Maps

There are two important situations where EKF is not the method of choice for robot localization. The first is when the environment is represented by an occupancy grid. Sensor model for occupancy grid maps described in Section 2.3 is not an analytic model but based on the numerical process of ray casting and as such is unsuitable for use with an EKF. The other situation is when initial robot location is completely unknown, usually known as the global localization problem. In this case, the location of the robot needs to be described using an arbitrary probability distribution; thus, the Gaussian assumption that is the basis of the EKF formulation is violated. In general, manipulating arbitrary probability distributions is computationally intractable. One possible strategy is to discretize the space of possible robot locations and thus deal with manipulating discrete probability distribution. This method is known as Markov localization. The computation burden associated with Markov localization is proportional to the size of the environment and the resolution of the discretization, making this strategy unsuitable in many situations. Markov localization is described in Appendix Appendix .

In the particle filter localization (also known as Monte Carlo localization) (7), rather than discretizing the space of robot locations, a weighted set of robot location estimates, termed as particles, is used to describe the probability distribution of the robot location. As the computations are focused on particles and more particles are placed at more probable robot locations, the particle filters provide a more efficient alternative to Markov localization. Number of particles used determines the accuracy of the representation. However, increasing the number of particles to obtain a higher accuracy leads to a more costly estimation process.

In the particle filter, each particle in effect provides a guess as to the location of the robot. Thus, each particle is represented by three variables (x, y (position), φ (orientation)) for a robot operating in a two-dimensional plane. Each particle i has a weight w i that indicates the contribution of that particular particle to the probability distribution. The sum of the weights of all particles is set to 1, that is, i = 1 n w i = 1, where n is the total number of particles used. A collection of such guesses describes the best knowledge available, usually termed the belief, as to the true location of the robot. In the case of global localization, the initial robot location is completely unknown; therefore, all locations of the environment are equally likely to contain the robot. Thus, a set of equally weighted particles uniformly distributed in the environment is used to represent the belief of the robot location. During the localization process, this belief is updated as more and more information is acquired from the sensors.

In the particle filter, every time information from the sensors is gathered, the current belief is updated. The process is as follows (8, 9):
  1. Prediction:When the robot is commanded to move, the new belief is obtained by moving each particle according to the motion model equation 2 with randomly generated δ v k , δ ω k .
  2. Update:When a new sensor observation is received, the belief is updated using an observation model. In this step, the weights of the particles are changed to reflect the likelihood that the true robot location coincides with the corresponding particle. In the case of jth observation from a laser range finder, ray casting from each particle is used to obtain an expected measurement d ˆ j . If the actual measurement is given by dj and if the sensor noise is assumed to be zero mean with a variance σ d 2 , the likelihood can be computed using a Gaussian distribution based on
    1 σ d 2 π exp { ( d ˆ j d j ) 2 2 σ d 2 } . (16)
    As at a given instance multiple independent range observations are acquired from the sensor, likelihood of obtaining a sequence of observations is computed by multiplying together all the likelihood. Once likelihoods of all the particles are computed, these are normalized to obtain the weight of each of the particles.
  3. Resampling:This is performed to avoid the situation where a small number of particles with large weights dominate the representation of the belief. One common strategy used for resampling (10) is as follows:
    1. Compute an estimate of the effective number of particles as
      n eff = 1 i = 1 n w i 2 . (17)
    2. If neff is less than a threshold, then draw n particles from the current particle set with probabilities proportional to their weights. Replace the current particle set with this new one. Set the weights of each particle to be 1/n.
  4. Resulting set of particles represents the updated belief of the robot location.

This process is repeated as new control actions are taken and new observations become available. The mean or the mode of the corresponding probability distribution can be used if a numerical value for the best estimate of the robot location is desired.

Figure 5 shows the result of particle filter localization for the simple problem given in Figure 3. The particles, the best estimate of the robot location, and the ground truth robot location at the last step are shown in green, blue, and red, respectively.

Details are in the caption following the image
The result of particle filter localization: the particles in the last step are shown in green, the ground truth of the last robot pose is in red, the best estimate of the last robot pose is in blue.

5 Alternative Localization Techniques

When a map of the environment is not available, the robot localization problem becomes significantly more challenging. In this case, the problem becomes one of estimating both the robot location and landmark locations simultaneously. In the past 15 years, robust and efficient methods to dealing with robot localization in unknown environments, also known as the simultaneous localization and mapping (SLAM) problem (3), have emerged. SLAM in a feature-based environment has been well studied and it has been shown that both EKF and least-squares optimization could be used to reliably solve SLAM in most cases (11, 12). Presence of efficient solvers for very large-scale nonlinear least-squares optimization problems (13) has resulted in real-time solutions to the robot location estimation in unknown environments. Due to their low cost and presence of algorithms that extract rich information, cameras have become an important sensor in many robot navigation applications. A comprehensive survey on vision-based navigation is reported in Reference (14), while a recent strategy for SLAM using information from a camera is reported in Reference (15). Combining information from monocular cameras with inertial sensors makes it possible to obtain reliable localization in real time with a high level of accuracy (16).

An alternative method for localization in unknown environments is to simply use the information from a sensor such as a laser range finder to obtain the translation and rotation relating two robot poses from which two laser scans are taken. This is done through scan matching that aligns the two scans. Collection of such relative pose estimates can be used to formulate a nonlinear least-squares problem that can be solved to estimate all the robot poses (17). A modern solver such as g2o (13) could be used to efficiently obtain the location estimates. A representation of the environment (map) is not estimated. This strategy is called pose-graph SLAM (18). For a feature-based or pose-graph SLAM technique to be effective, a strategy to recognize the fact that the robot has returned to areas it has visited before, known as loop closure, is required. The reliable detection of loop closure is one of the remaining challenges for both feature-based SLAM and pose-graph SLAM (19).

Many other interesting robot localization problems and alternative solutions have been reported in the literature. Typical examples are localization using signal strengths from wireless infrastructure (20) and RFIDs (21), fusion of information from GPS and inertial navigation units (22), and an optimization technique for localization in grid maps (23) based on chamfer distance (24) that does not rely on many tuning parameters as is usually the case with particle filters.

The problem of estimating robot location given a map is now considered a solved problem, although highly dynamic environments populated with people pose significant challenges in practical deployments. The more complex problem of continuously estimating robot location within an unknown environment over a long period is still the subject of much research.

Appendix A: Least Squares Problem and Gauss–Newton Iteration

1 Linear Least Squares Problem and Solution

A linear least squares problem is to find X that minimizes
| | b A X | | 2 = Δ = ( b A X ) T ( b A X )
for given b, A, where
b = b 1 b 2 b m , { X = x 1 x 2 x n , m n
and
A = a 11 a 12 a 1 n a 21 a 22 a 2 n a m 1 a m 2 a mn .
Assuming that the matrix A is full column rank, the above problem has a closed-form solution:
X X * = ( A T A ) - 1 A T b . (18)
This can be obtained by expanding the objective function
E ( X ) = | | b A X | | 2 = ( b A X ) T ( b A X ) = b T b 2 b T A X + X T A T A X
and finding stationary points by letting
d E d X = 2 A T A X 2 A T b = 0
which leads to the solution equation 18.

2 Weighted Linear Least Squares Problem and Solution

A weighted linear least squares problem is to find X that minimizes
( b A X ) T P 1 ( b A X )
where P is a positive definite matrix.
The closed-form solution to the weighted linear least-squares problem is
X * = ( A T P - 1 A ) - 1 A T P - 1 b . (19)

3 Nonlinear Least Squares and Gauss–Newton Iteration

A nonlinear least squares problem is to find X that minimizes
| | Z F ( X ) | | 2 = [ Z F ( X ) ] T [ Z F ( X ) ]
where Z = [z1, z2, …, zm]T, X = [x1, x2, …, xn]T,
F ( X ) = f 1 ( X ) f 2 ( X ) f m ( X ) = f 1 ( x 1 , x 2 , , x n ) f 2 ( x 1 , x 2 , , x n ) f m ( x 1 , x 2 , , x n )
with mn.

In general, closed-form solution for a nonlinear least squares problem cannot be obtained. Many techniques for solving nonlinear least squares problems are based on iteration.

Suppose X is close to X0, by linearization,
F ( X ) F ( X 0 ) + J F ( X 0 ) ( X X 0 )
where JF(X0) is the Jacobian matrix given by
J F ( X ) = [ f 1 x 1 f 1 x 2 f 1 x n f 2 x 1 f 2 x 2 f 2 x n : : : : f m x 1 f m x 2 f m x n ]
evaluated at X0.
Thus,
Z F ( X ) Z F ( X 0 ) + J F ( X 0 ) X 0 J F ( X 0 ) X .
Let
A = J F ( X 0 ) , b = Z F ( X 0 ) + J F ( X 0 ) X 0 .
Assuming that the matrix JF(X0) is full column rank, using the linear least square solution equation 18, we get
X 1 = [ J F T ( X 0 ) J F ( X 0 ) ] - 1 J F T ( X 0 ) [ Z - F ( X 0 ) + J F ( X 0 ) X 0 ] . (20)
In general, the iteration step is
X k + 1 = [ J F T ( X k ) J F ( X k ) ] - 1 J F T ( X k ) [ Z - F ( X k ) + J F ( X k ) X k ] . (21)

Iterating until convergence leads to the optimum solution, provided that the initial guess X0 is sufficiently close to the solution. This is known as the Gauss–Newton iteration.

4 Weighted Nonlinear Least Squares Problem

The weighted nonlinear least squares problem is to find X that minimize
[ Z - F ( X ) ] T P - 1 [ Z - F ( X ) ] (22)
where P is the covariance matrix of the noises contained in the measurement (data) Z.
Given the initial value X0, Gauss–Newton iteration step is
X k + 1 = [ J F T ( X k ) P - 1 J F ( X k ) ] - 1 J F T ( X k ) P - 1 [ Z - F ( X k ) + J F ( X k ) X k ] . (23)

Appendix B: Least Squares Method for Landmark Based Localization

Least squares method provides a way to optimally estimate the robot trajectory using all the available robot motion and observation information up to time k + 1. In least squares method, we estimate all the robot poses together instead of only the last pose as in the case of both the EKF and the particle filter based robot localization.

The state vector in least squares method is
X = ( x 0 , x 1 , , x k , x k + 1 ) T . (24)
Note that the initial state mean value can be expressed as an observation of x0:
x ˆ 0 = x 0 + v x 0 (25)
where v x 0 N ( 0 , P 0 ) is the “observation noise”.
The motion model equation 2 can be rewritten as
v k = ( x k + 1 r - x k r ) 2 + ( y k + 1 r - y k r ) 2 Δ T - δ v k ω k = φ k + 1 r - φ k r Δ T - δ ω k . (26)
Now all the information available from time 0 to time k + 1 is summarized in
Z = ( x 0 T , v 0 , w 0 , , r 1 i , θ 1 i , , v k , w k , , r k + 1 i , θ k + 1 i , ) T . (27)
The relation between Z and X is given by
Z = F ( X ) + V (28)
where F(X) is the nonlinear function combining equations 3-25, and 26. VN(0, P) is the vector of all the noises where P is constructed by P0, Q, R.

Now the localization problem can be formulated as a nonlinear least squares problem as in equation 22 and could be solved using Gauss–Newton iteration by equation 23.

Appendix C: Intuitive Explanations of the Kalman Filter

1 Kalman Filter Equations

When both the process model and the observation model are linear, they can be expressed by
x k + 1 = F x k + G u k + w k (29)
and
z k + 1 = H x k + 1 + v k + 1 (30)
where xk, xk+1 are the system state at time k, k + 1, F is the system transition matrix, G is the gain of control uk, and wk is the zero-mean Gaussian process noise wkN(0, Q), H is the observation matrix, and vk+1 is the zero-mean Gaussian observation noise vk+1N(0, R).

In this case, the state estimation can be obtained using the following Kalman filter equations assuming the initial state x0 follows a known Gaussian distribution x 0 N ( x ˆ 0 , P 0 ).

Predict using process model:
x k + 1 = F x ˆ k + G u k (31)
P k + 1 = FP k F T + Q (32)
where x k + 1 is the state estimate at time k + 1 before using the observation information at time k + 1, and P k + 1 is its corresponding covariance matrix.
Update using observation:
x ˆ k + 1 = x k + 1 + K ( z k + 1 H x k + 1 ) (33)
P k + 1 = P k + 1 KSK T (34)
where the innovation covariance S (here z k + 1 H x k + 1 is called innovation) and the Kalman gain K are given by
S = H P k + 1 H T + R (35)
K = P k + 1 H T S 1 . (36)

In the following, we will provide some intuitive explanations of the Kalman filter equations for the one-dimensional case.

2 One-Dimensional Gaussian Distribution and Its Information

If a random variable x follows a Gaussian distribution, it is denoted as
x ~ N ( m , σ 2 ) (37)
where m is the mean and σ2 is the variance.
(Fisher) information of a Gaussian distribution N(m, σ2) is the inverse of the variance,
I = 1 σ 2 . (38)

Intuitively speaking, the larger the uncertainty, the smaller the information.

3 Important Properties of 1D Gaussian Distributions

The following are a few properties of 1D Gaussian distributions that are useful in deriving the Kalman filter equations:
  • For any constant a,
    x ~ N ( m , σ 2 ) a x ~ N ( a m , a 2 σ 2 ) . (39)
  • For any constant u,
    x ~ N ( m , σ 2 ) x + u ~ N ( m + u , σ 2 ) . (40)
  • For two independent random variables x and y,
    x ~ N ( m x , σ x 2 ) , y ~ N ( m y , σ y 2 ) x + y ~ N ( m x + m y , σ x 2 + σ y 2 ) . (41)

4 One-Dimensional Kalman Filter Prediction

This section shows that the Kalman filter prediction equation can be obtained easily from the properties of 1D Gaussian distributions listed in Section 3.

Suppose the process model is
x k + 1 = x k + u k + w k (42)
where uk is the control and w k is the zero-mean Gaussian process noise with variance σ u 2 . That is, w k N ( 0 , σ u 2 ). It is also assumed that w k is independent of xk.
At time k, the estimate of xk follows a Gaussian distribution x k N ( x ˆ k , σ k 2 ) (see equation 8), thus, by equation 40,
x k + u k ~ N ( x k + u k , σ k 2 ) . (43)
Further by equation 41,
x k + 1 = ( x k + u k ) + w k ~ N ( x k + u k , σ k 2 + σ u 2 ) . (44)
Thus, if we denote the estimate of xk+1 (after the process but before the observation) as
x k + 1 ~ N ( x k + 1 , σ k + 1 2 ) (45)
then the prediction equations are
x k + 1 = x k + u k σ k + 1 2 = σ k 2 + σ u 2 . (46)
Similarly, if the process model is
x k + 1 = a x k + b u k + w k (47)
where a, b are constants and w k N ( 0 , σ u 2 ), then the prediction equations become
x k + 1 = a x k + b u k σ k + 1 2 = a 2 σ k 2 + σ u 2 (48)
which are equations 31 and 32 when all variables are scalars.

5 One-Dimensional Kalman Filter Update

Suppose the observation model is
z k + 1 = x k + 1 + v k + 1 (49)
where zk+1 is the observation value at time k + 1 and v k + 1 is the zero-mean Gaussian observation noise with variance σ z 2 . That is, v k + 1 N ( 0 , σ z 2 ). It is also assumed that v k + 1 is independent of xk+1. By equation 39 (choosing a = − 1),
- v k + 1 ~ N ( 0 , σ z 2 ) . (50)
By the observation model equation 49,
x k + 1 = - v k + 1 + z k + 1 . (51)
Thus, by equation 40,
x k + 1 ~ N ( z k + 1 , σ z 2 ) . (52)

The prior information about xk+1 is given by equation 45 (after the prediction but before the update). So we have two pieces of information about xk+1: one from observation equation 52 and one from prior equation 45.

According to the definition of information contained in a Gaussian distribution (see equation 38), the information (about xk+1) contained in equation 45 is
I prior = 1 σ k + 1 2 (53)
while the information (about xk+1) contained in equation 52 is
I obs = 1 σ z 2 . (54)
The total information (about xk+1) after the observation should be the sum of the two, namely,
I total = I prior + I obs = 1 σ k + 1 2 + 1 σ z 2 . (55)
The new mean value is the weighted sum of the mean values of the two Gaussian distributions equations 45 and 52. The weights are decided by the proportion of information contained in each of the Gaussian distributions (as compared with the total information). That is,
x k + 1 = I prior I total x k + 1 + I obs I total z k + 1 = σ z 2 σ k + 1 2 + σ z 2 x k + 1 + σ k + 1 2 σ k + 1 2 + σ z 2 z k + 1 . (56)

Note that the sum of the two weights is 1, that is, I prior I total + I obs I total = 1.

The variance can be obtained by (see equation 38)
σ k + 1 2 = 1 I total = 1 1 / σ k + 1 2 + 1 / σ z 2 = σ k + 1 2 σ z 2 σ k + 1 2 + σ z 2 . (57)
So, the final estimate on xk+1 (after the prediction and update) is
x k + 1 ~ N ( x k + 1 , σ k + 1 2 ) (58)
where x ˆ k + 1 and σ k + 1 2 are given in equations 56 and 57, respectively.

Figure 6 illustrates the update step of Kalman filter.

Details are in the caption following the image
One-dimensional Kalman filter update (dot line is the prior, dashed line is the observation, solid line is the posterior). Iprior = 1/25, Iobs = 1/100, Itotal = Iprior+ Iobs = 1/20 ; posterior variance = 1 I total = 20; posterior mean = I prior I total × 16 + I obs I total × 11 = 15 .
The update formulas, equations 56 and 57, can also be expressed as
x k + 1 = x k + 1 + σ k + 1 2 σ k + 1 2 + σ z 2 ( z k + 1 - x k + 1 ) σ k + 1 2 = σ k + 1 2 ( 1 - σ k + 1 2 σ k + 1 2 + σ z 2 ) = σ k + 1 2 - σ k + 1 2 σ k + 1 2 σ k + 1 2 + σ z 2 = σ k + 1 2 - σ k + 1 2 σ k + 1 2 + σ z 2 ( σ k + 1 2 + σ z 2 ) σ k + 1 2 σ k + 1 2 + σ z 2 . (59)

These are equations 33 and 34 (when all variables are scalars), where z k + 1 x k + 1 is the innovation, σ k + 1 2 + σ z 2 is the innovation variance S, and σ k + 1 2 σ k + 1 2 + σ z 2 is the Kalman gain K.

Appendix D: Markov Localization

In Makov localization, rather than relying on a set of particles to represent a probability distribution, the state space is discretized into a grid and the probability that the robot is present in a particular grid cell is used to describe the estimate of the robot location. In a two-dimensional scenario, the discretization is over three–dimensional space incorporating the robot position and orientation.

At time k, the probability that the robot is present in each of the grid cells is represented by
p i ( k ) = Δ P ( x k = i ) , i = 1 , , M (60)
where P(xk = i) means the probability of robot pose xk is in grid cell i, M is the total number of grid cells, and
0 p i ( k ) 1 , i = 1 M p i ( k ) = 1 .
This probability distribution is called belief bel(k).
Initial belief bel(0) is the prior distribution. When there is no prior knowledge about the robot location, the probability distribution is a uniform one. That is,
p i ( 0 ) = 1 M , i = 1 , , M .
Given a belief bel(k) at time k and a new control input uk and a new observation zk+1, the belief needs to be updated to find bel(k + 1) using Bayes filter. There are two essential steps used to update the belief:
  1. Prediction:In this step the new control input uk and the previous belief bel(k) are used to compute the predicted belief bel ( k + 1 ) . Here bel ( k + 1 ) is the prediction, which for any possible location j can be computed using
    p j ( k + 1 ) = i = 1 M p i ( k ) P ( x k + 1 = j | x k = i , u k ) . < / p > < / item 1 > < item 1 > < p > (61)
    This equation is obtained using the law of total probabiliy. Here P(xk+1 = j|xk = i, uk) is the conditional probability that can be obtained from the motion model.
  2. Update:In this step, using Bayes' theorem, information in the new observation zk+1 is fused with the prediction to obtain the new belief at time k + 1 as follows:
    p j ( k + 1 ) = Δ P ( x k + 1 = j | z k + 1 ) = P ( z k + 1 | x k + 1 = j ) p j ( k + 1 ) ̲ i = 1 M P ( z k + 1 | x k + 1 = i ) p i ( k + 1 ) ̲ (62)
    where the conditional probability P(zk+1|xk+1 = i) can be obtained from the sensor model.

    The full text of this article hosted at iucr.org is unavailable due to technical difficulties.