Chap8 Kalman Mapping Howie
Chap8 Kalman Mapping Howie
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
The Problem
sense
relate sensor readings to a world model
compute location relative to model
assumes a perfect world model
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Localization
SLAM
Challenges
Sensor processing
Position estimation
Control Scheme
Exploration Scheme
Cycle Closure
Autonomy
Tractability
Scalability
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
AI
Gaussians
approximately linear models
position tracking
Robotics
Multi-hypothesis (00)
multiple Kalman filters
global localization, recovery
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Grid-Based:
Feature-Based:
Topological:
Collection of discretized
obstacle/free-space pixels
Collection of landmark
locations and correlated
uncertainty
Elfes, Moravec,
Thrun, Burgard, Fox,
Simmons, Koenig,
Konolige, etc.
Smith/Self/Cheeseman,
DurrantWhyte, Leonard,
Nebot, Christensen, etc.
Kuipers/Byun,
Chong/Kleeman,
Dudek, Choset,
Howard, Mataric, etc.
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Grid-Based
Resolution vs. Scale
Computational
Complexity
Exploration
Strategies
Feature-Based
Topological
Discrete localization
Arbitrary localization
Localize to nodes
Minimal complexity
Frontier-based
exploration
No inherent exploration
Graph exploration
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Atlas Framework
Hybrid Solution:
Local features extracted from local grid map.
Local map frames created at complexity limit.
Topology consists of connected local map frames.
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
H-SLAM
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
x ( k + 1) = F ( k ) x ( k ) + G ( k )u( k ) + v ( k )
y ( k ) = H ( k ) x ( k ) + w( k )
x ( k ) is the n - dimensional state vector (unknown)
u( k ) is the m - dimensional input vector (known)
y ( k ) is the p - dimensional output vector (known, measured)
F ( k ), G ( k ), H ( k ) are appropriately dimensioned system matrices (known)
v ( k ), w( k ) are zero - mean, white Gaussian noise with (known)
covariance matrices Q( k ), R ( k )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
x ( k + 1 | k ) = F (k ) x (k | k ) + G (k )u (k )
y (k ) = H (k ) x (k + 1 | k )
2. calculate correction based on prediction and current measurement:
x = f ( y (k + 1), x (k + 1 | k ) )
3. update prediction:
x ( k + 1 | k + 1) = x (k + 1 | k ) + x
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x (k + 1 | k ) and output y, find x so that x = x (k + 1 | k ) + x
is the " best" estimate of x.
Want the best estimate to be consistent
with sensor readings
x (k+1|k)
= {x | Hx = y}
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x (k + 1 | 1) and output y, find x so that x = x (k + 1 | 1) + x
is the " best" estimate of x.
best estimate comes from shortest x
shortest x is perpendicular to
x (k + 1 | k )
= {x | Hx = y}
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Null ( H ) = {a 0 | Ha = 0}
= {x | Hx = y}
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x (k + 1 | k ) and output y, find x so that x = x (k + 1 | k ) + x
is the " best" estimate of x.
best estimate comes from shortest x
shortest x is perpendicular to
x (k + 1 | k )
x null(H ) x column(H )
= {x | Hx = y}
x = H T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x (k + 1 | k ) and output y, find x so that x = x (k + 1 | k ) + x
is the " best" estimate of x.
x (k + 1 | k )
x null(H ) x column(H )
= {x | Hx = y}
x = H T
= y H ( x (k + 1 | k )) = H ( x x (k + 1 | k ))
innovation
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x (k + 1 | k ) and output y, find x so that x = x (k + 1 | k ) + x
is the " best" estimate of x.
x (k + 1 | k )
x null(H ) x column(H )
= {x | Hx = y}
x = H T
assume is a linear function of
x = H T K
Guess, hope, lets face it, it has to be some
function of the innovation
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x and output y, find x so that x = x (k + 1 | k ) + x
H ( x (k + 1 | k ) + x) = y
x (k + 1 | k )
= {x | Hx = y}
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x and output y, find x so that x = x (k + 1 | k ) + x
H ( x (k + 1 | k ) + x) = y
x (k + 1 | k )
Hx = y Hx (k + 1 | k ) = H ( x x (k + 1 | k )) =
= {x | Hx = y}
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x and output y, find x so that x = x (k + 1 | k ) + x
H ( x (k + 1 | k ) + x) = y
x (k + 1 | k )
Hx = y Hx (k + 1 | k ) = H ( x x (k + 1 | k )) =
= {x | Hx = y}
substituting x = H T K yields
HH T K =
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x and output y, find x so that x = x (k + 1 | k ) + x
H ( x (k + 1 | k ) + x) = y
x (k + 1 | k )
Hx = y Hx (k + 1 | k ) = H ( x x (k + 1 | k )) =
= {x | Hx = y}
substituting x = H T K yields
HH T K =
K = HH T
The fact that the linear solution solves the equation makes assuming K is linear a kosher guess
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx
Given prediction x and output y, find x so that x = x (k + 1 | k ) + x
H ( x (k + 1 | k ) + x) = y
x (k + 1 | k )
Hx = y Hx (k + 1 | k ) = H ( x x (k + 1 | k )) =
= {x | Hx = y}
substituting x = H T K yields
HH T K =
K = HH T
x = H
(HH )
T 1
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
A Geometric Interpretation
= {x | Hx = y}
x (k + 1 | k )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
System:
x(k + 1) = Fx(k ) + Gu (k )
y (k ) = Hx(k )
1. prediction:
x (k + 1 | k ) = Fx (k | k ) + Gu (k )
Observer:
2. compute correction:
x = H
(HH )
T 1
( y (k + 1) Hx (k + 1 | k ))
3. update:
x ( k + 1 | k + 1) = x (k + 1 | k ) + x
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Caveat #1
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
p( x) =
1
(2 ) n / 2 P
where P = E ( x x )( x x ) T
1/ 2
1
( x x )T P 1 ( x x )
e2
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
= {x | Hx = y}
x(k + 1 | k )
p( x) =
1
(2 ) n / 2 P
1/ 2
1
( x x )T P 1 ( x x )
e2
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
x1 , x2 = x1T P 1 x 2
= x , x = x T P 1 x
, x = 0 for in T = null ( H )
, x = T P 1x = 0 iff x column ( PH T )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
The condition y = H ( x (k + 1 | k ) + x ) Hx = y Hx (k + 1 | k ) =
Substituti on yields :
Hx = = HPH T K
K = HPH
x = PH
(HPH )
T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
We can create a better state observer following the same 3. steps, but now we
must also estimate the covariance matrix P.
We start with x(k|k) and P(k|k)
Where did noise go?
Expected value
Step 1: Prediction
x (k + 1 | k ) = Fx (k | k ) + Gu (k )
What about P? From the definition:
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Continuing Step 1
(
= E ((F (x x ) + v )(F (x x ) + v ) )
= E (F (x x )(x x ) F + 2 F (x x )v
= FE ((x x )(x x ) )F + E (v v )
= E (Fx k + Gu k + vk ( Fx k + Gu k ) )(Fx k + Gu k + vk ( Fx k + Gu k ) )T
T
T
k
+ v k v Tk
= FPk F T + Q
P (k + 1 | k ) = FP (k | k ) F T + Q
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
x = P ( k + 1 | k ) H HP ( k + 1 | k ) H
( y (k + 1) Hx (k + 1 | k ) )
x = W
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Step 3: Update
x ( k + 1 | k + 1) = x ( k + 1 | k ) + W
(
= E (( x
Pk +1 = E ( x k +1 x k +1 )( x k +1 x k +1 )T
)(
x
)
k +1
k +1
k +1
k +1
P (k + 1 | k + 1) = P (k + 1 | k ) WHP (k + 1 | k ) H T W T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Pk +1 = E ( x k +1 x k +1 )( x k +1 x k +1 )T
k +1
)
)
) W )
x k+1 W )( xk +1 x k+1 W )T
)(
k+1 ) W ( xk +1 x k+1
k +1 x
(
(HP
) HP
) (HP
1
T 1
H
k +1
k +1
+ WHPk+1 H T W T
T
k +1 H
)(HP
T 1
H
HPk+1
k +1
+ WHPk+1 H T W T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
System:
1. Predict
x (k + 1 | k ) = Fx (k | k ) + Gu (k )
Observer
P (k + 1 | k ) = FP (k | k ) F T + Q
2. Correction
3. Update
W = P (k + 1 | k ) H HP (k + 1 | k ) H T
x = W ( y ( k + 1) Hx (k + 1 | k ) )
x ( k + 1 | k + 1) = x ( k + 1 | k ) + W
P (k + 1 | k + 1) = P (k + 1 | k ) WHP (k + 1 | k ) H T W T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Note: there is a problem with the previous slide, namely the covariance matrix of
the estimate P will be singular. This makes sense because with perfect sensor
measurements the uncertainty in some directions will be zero. There is no
uncertainty in the directions perpendicular to
P lives in the state space and directions associated with sensor noise are zero. In
the step when you do the update, if you have a zero noise measurement, you end
up squeezing P down.
In most cases, when you do the next prediction step, the process covariance matrix
Q gets added to the P(k|k), the result will be nonsingular, and everything is ok again.
Theres actually not anything wrong with this, except that you cant really call the
result a covariance matrix because sometimes it is not a covariance matrix
Plus, lets not be ridiculous, all sensors have noise.
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = Hx + w
= {x | Hx = y}
x (k + 1 | k )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
x (k + 1 | k ) y = Hx (k + 1 | k )
P (k + 1 | k ) R = HP(k + 1 | k ) H T
P(k + 1 | k )
x (k + 1 | k )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
x3 = x1 + K ( x2 x1 )
and covariance
where
C3 = C1 KC1
K = C1 (C1 + C2 )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
y = y + R R + R
( y y )
= Hx (k + 1 | k ) + HPH HPH + R
T
)(Hx(k + 1 | k ) y)
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Now we can compute the correction as we did in the noiseless case, this time
using y* instead of y. In other words, y* tells us which hyperplane to aim for.
= x | Hx = y *
}
The result is:
x = PH HPH
T
) (y
1
Hx ( k + 1 | k )
ot going all the way to y, but splitting the difference between how confident you are with your
Sensor and process noise
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
) (y Hx (k + 1 | k ))
) (Hx + HPH (HPH + R ) ( y Hx (k + 1 | k )) Hx (k + 1 | k ))
x = PH HPH
T
= PH T HPH T
= PH HPH + R
T
) ( y Hx (k + 1 | k ))
1
W = PH HPH + R
T
So that
x = W ( y Hx ( k + 1 | k ) )
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
P (k + 1 | k + 1) = P (k + 1 | k ) W HP (k + 1 | k ) H W
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
System:
Kalman Filter
1. Predict
x (k + 1 | k ) = Fx (k | k ) + Gu (k )
P (k + 1 | k ) = FP (k | k ) F T + Q
S = HP ( k + 1 | k ) H T + R
2. Correction
3. Update
W = P ( k + 1 | k ) H T S 1
x = W ( y ( k + 1) Hx (k + 1 | k ) )
x ( k + 1 | k + 1) = x ( k + 1 | k ) + W
P (k + 1 | k + 1) = P (k + 1 | k ) WSW T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Kalman Filters
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Newton tells us
or
Process noise
from a zero
mean
Gaussian V
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Set up
Assume
At some time k
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Observability
Recall from last time
Actually, previous example is not observable but still nice to use Kalman filter
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Predict
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Update
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
State
Input
Process Model
nl landmarks
can only see p(k) of them at k
Association map
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Data Association
BIG PROBLEM
Ith measurement corresponds to the jth landmark
innovation
where
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Range Bearing
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Kalman Filters
Bel ( xt ) = N ( t , t2 )
t +1 = t + But
Bel(xt +1 ) = 2
2 2
2
=
A
t
act
t +1
t +1 = t+1 + K t +1 ( zt +1 t+1 )
Bel(xt +1 ) =
t2+1 = (1 K t +1 ) t2+1
t + 2 = t +1 + But +1
Bel(xt + 2 ) = 2
2 2
2
=
A
t +1
act
t +2
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
2.
3.
4.
5.
6.
7.
8.
9.
Return <,>
K = C CC + obs
= + K ( z C )
T
= ( I KC )
= AAT + act
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Limitations
Z t = CX t + obs
X t+1 = f ( X t , ut , act )
Z t = c( X t , obs )
Linearize it!
Determine Jacobians of dynamics f and observation
function c w.r.t the current state x and the noise.
Aij =
c
f i
ci
f i
( xt , ut ,0) Cij = i ( xt ,0) Wij =
( xt , ut ,0) Vij =
( xt ,0)
x j
x j
act j
obs j
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
2.
3.
4.
5.
6.
7.
8.
9.
Return <,>
K = C CC + V obsV
= + K (z c( ,0) )
= ( I KC )
T
= AAT + W actW T
T 1
K = C CC + obs
= + K ( z C )
T
= ( I KC )
= AAT + act
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Courtesy of RI
K. 16-735,
Arras Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
Instead of linearizing, pass several points from the Gaussian through the nonlinear transformation and re-compute a new Gaussian.
Better performance (theory and practice).
' = f ( , u ,0)
= AAT + W actW T
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox
RI 16-735, Howie Choset, with slides from George Kantor, G.D. Hager, and D. Fox