Académique Documents
Professionnel Documents
Culture Documents
Mobile Robotics
Welcome
Wolfram Burgard
Organization
§ Web page:
§ www.informatik.uni-freiburg.de/~ais/
§ http://ais.informatik.uni-freiburg.de/teaching/
ss18/robotics/
People
Teaching:
Wolfram Burgard
Teaching assistants:
Marina Kollmitz
Chau Do
Lukas Luft
3
Goal of this course
Hands-on experience
AI View on Mobile Robotics
Sensor data
Control system
World model
Actions
Robotics Yesterday
Current Trends in Robotics
Robots are moving away from factory floors
to
Entertainment, toys
Personal services
Medical, surgery
Industrial automation
(mining, harvesting, …)
Hazardous environments
(space, underwater)
Robotics Today
Shakey the Robot
Shakey the Robot
The Helpmate System
DARPA Grand Challenge
pr2-drawing.m4v
General Background
Autonomous, automaton
self-willed (Greek, auto+matos)
Robot
Karel Capek in 1923 play R.U.R.
(Rossum’s Universal Robots)
labor (Czech or Polish, robota)
workman (Czech or Polish, robotnik)
Asimov’s Three Laws of Robotics
1. A robot may not injure a human being, or,
through inaction, allow a human being to come to
harm.
[Runaround, 1942]
Wiener, Cybernetics
Studied regulatory systems and their application to
control (antiaircraft gun)
[Electronics, 1949]
Trends in Robotics Research
Classical Robotics (mid-70’s)
• exact models
• no sensing necessary
cameras
sensors
sonars
laser
base actuators
25
26
Architecture of a Typical Control
System
Foundations of Artificial Intelligence
Mobile robots
Multi-robot systems
Probabilistic robotics
Machine Learning Lab
Reinforcement Learning
Supervised Learning
Self-learning robots
Neural Controllers
Industrial Applications
Humanoid Robots
Development of techniques for robots with
human-like body plan
human-like senses
Navigation in complex indoor environments
3D environment modeling
Path planning
Classification and learning
Natural human-robot interaction
State estimation and modeling of people
Speech, gestures, facial expression, etc.
Social Robotics Lab
Towards socially compatible robots
Motion planning
Robot navigation
Spatio-temporal models of
human social behavior
Human–robot interaction
If , the
two vectors are
orthogonal
Vectors: Linear (In)Dependence
rows columns
column vectors
Matrix Matrix Product
Can be defined through
the dot product of row and column vectors
the linear combination of the columns of A
scaled by the coefficients of the columns of B
column vectors
Matrix Matrix Product
If we consider the second interpretation,
we see that the columns of C are the
“transformations” of the columns of B
through A
All the interpretations made for the matrix
vector product hold
column vectors
Rank
Maximum number of linearly independent rows (columns)
Dimension of the image of the transformation
When is we have
and the equality holds iff is the null matrix
Transpose:
Multiplication:
( is i-th row)
Orthogonal Matrix
A matrix is orthogonal iff its column (row)
vectors represent an orthonormal basis
Some properties:
The transpose is the inverse
Determinant has unity norm (±1)
Rotation Matrix
A Rotation matrix is an orthonormal matrix with det =+1
2D Rotations
Rotation Matrix
p
Combining Transformations
A simple interpretation: chaining of transformations
(represented as homogeneous matrices)
Matrix A represents the pose of a robot in the space
Matrix B represents the position of a sensor on the robot
The sensor perceives an object at a given location p, in
its own frame [the sensor has no clue on where it is in the
world]
Where is the object in the global frame?
Bp gives the pose of the
object wrt the robot
B
Combining Transformations
A simple interpretation: chaining of transformations
(represented as homogeneous matrices)
Matrix A represents the pose of a robot in the space
Matrix B represents the position of a sensor on the robot
The sensor perceives an object at a given location p, in
its own frame [the sensor has no clue on where it is in the
world]
Where is the object in the global frame?
A
Positive Definite Matrix
The analogous of positive number
Definition
Example
Positive Definite Matrix
Properties
Invertible, with positive definite inverse
All real eigenvalues > 0
Trace is > 0
Cholesky decomposition
Linear Systems (1)
Interpretations:
A set of linear equations
A way to find the coordinates x in the
reference system of A such that b is the
result of the transformation of Ax
Solvable by Gaussian elimination
Gaussian Elimination
A method to solve systems of linear equations.
Notes:
Many efficient solvers exist, e.g., conjugate
gradients, sparse Cholesky decomposition
One can obtain a reduced system (A’, b’) by
considering the matrix (A, b) and suppressing all
the rows which are linearly dependent
Let A'x=b' the reduced system with A':n'xm and
b':n'x1 and rank A' = min(n',m) rows columns
The system might be either over-constrained
(n’>m) or under-constrained (n’<m)
Over-Constrained Systems
“More (ind.) equations than variables”
An over-constrained system does not
admit an exact solution
However, if rank A’ = cols(A) one often
computes a minimum norm solution
1
Classical / Hierarchical Paradigm
70s
Focus on automated reasoning and knowledge
representation
STRIPS (Stanford Research Institute Problem
Solver): Perfect world model, closed world
assumption
Find boxes and move them to the designated
position
2
Stanford CART 1973
3
Classical Paradigm
Stanford Cart
Motor Control
Perception
Execute
Model
Plan
Sense Plan Act
Sensing Action
Environment
5
Reactive / Behavior-based Paradigm
Sense Act
6
Reactive Paradigm as
Vertical Decomposition
Explore
Wander
Avoid obstacles
Sensing Action
Environment
7
Characteristics of Reactive Paradigm
Situated agent, robot is integral part of its
environment.
No memory, controlled by what is
happening in the world.
Tight coupling between perception and
action via behaviors.
Only local, behavior-specific sensing is
permitted (ego-centric representation).
8
Behaviors
… are a direct mapping of sensory
inputs to a pattern of motor actions
that are then used to achieve a task.
… serve as the basic building blocks
for robot actions, and the overall
behavior of the robot is emergent.
… support good software design
principles due to modularity.
9
Subsumption Architecture
Introduced by Rodney Brooks ‘86.
Behaviors are networks of sensing and
acting modules (augmented finite
state machines AFSM).
Modules are grouped into layers of
competence.
Layers can subsume lower layers.
No internal state!
10
Level 0: Avoid
polar heading
Sonar
plot encoders
Collide Forward
halt
11
Level 1: Wander
heading
Wander Avoid
force modified
heading
Collide Forward
halt
12
Level 2: Follow Corridor
Stay in distance, direction traveled
Integrate
Look middle heading
corridor to middle
s
Wander Avoid
force modified
heading
Feel force
force
Run away s Turn
heading
polar heading
Sonar
plot encoders
Collide Forward
halt
13
Potential Field Methods
Treat robot as particle acting under the
influence of a potential field
Robot travels along the derivative of the
potential
Field depends on obstacles, desired travel
directions and targets
Resulting field (vector) is given by the
summation of primitive fields
Strength of field may change with distance
to obstacle/target
14
Primitive Potential Fields
Uniform Perpendicular
15
Corridor Following with
Potential Fields
Level 0 (collision avoidance)
is done by the repulsive fields of detected
obstacles.
Level 1 (wander)
adds a uniform field.
Level 2 (corridor following)
replaces the wander field by three fields
(two perpendicular, one uniform).
16
Characteristics of Potential Fields
Goal
Backtracking
Random motion to escape local minimum
Procedural planner s.a. wall following
Increase potential of visited regions
Avoid local minima by harmonic functions
17
Characteristics of Potential Fields
18
Reactive Paradigm
Representations?
Good software engineering principles?
Easy to program?
Robustness?
Scalability?
19
Hybrid Deliberative/Reactive
Paradigm
Plan
Sense Act
20
Discussion
Imagine you want your robot to perform
navigation tasks, which approach would you
choose?
What are the benefits and drawbacks of the
behavior based paradigm?
What are drawbacks of the subsumption
architecture?
21
Introduction to
Mobile Robotics
Wheeled Locomotion
Wolfram Burgard
1
Locomotion of Wheeled Robots
Locomotion (Oxford Dict.): Power of motion from
place to place
roll
x
y y
z m otion
ICC
3
Differential Drive
R q
(x,y) x
vr
l/2
Differential Drive: Forward Kinematics
t
R x (t ) v (t ' ) cos[ q ( t ' )] dt '
P(t+dt) 0
t
5
Differential Drive: Forward Kinematics
R 1
t
x (t )
2
[ v ( t ' ) v ( t ' )]
r l cos[ q ( t ' )] dt '
P(t+dt) 0
t
1
y (t )
2
[ v ( t ' ) v ( t ' )]
r l sin[ q ( t ' )] dt '
0
t
1
P(t)
q (t )
l
[ v ( t ' ) v ( t ' )] dt '
r l
6
Ackermann Drive
ICC [ x R sin q , y R cos q ]
d
R
y tan
w
ICC w ( R l / 2) vr
vl
w ( R l / 2) vl
l (vl vr )
d R
R q 2 (vr vl)
(x,y) x
vr vl
w
vr l
l/2
7
Synchronous Drive
y t
v(t)
y (t ) v (t ' ) sin[ q ( t ' )] dt '
0
q t
x
q ( t ) w ( t ' ) dt '
w(t ) 0
8
t
XR4000 Drive x (t ) v (t ' ) cos[ q ( t ' )] dt '
0
t
y
y (t ) v (t ' ) sin[ q ( t ' )] dt '
0
t
q ( t ) w ( t ' ) dt '
0
vi(t)
q
wi(t) x
ICC
9
Mecanum Wheels
v y ( v 0 v1 v 2 v 3 ) / 4
v x ( v 0 v1 v 2 v 3 ) / 4
v q ( v 0 v1 v 2 v 3 ) / 4
v error ( v 0 v1 v 2 v 3 ) / 4
11
The Kuka OmniRob Platform
Example: KUKA youBot
15
Tracked Vehicles
17
Other Robots: OmniTread
18
Non-Holonomic Constraints
Non-holonomic constraints limit the possible
incremental movements within the
configuration space of the robot.
Robots with differential drive or synchro-
drive move on a circular trajectory and
cannot move sideways.
Mecanum-wheeled robots can move
sideways (they have no non-holonomic
constraints).
20
Holonomic vs. Non-Holonomic
Non-holonomic constraints reduce the
control space with respect to the current
configuration
E.g., moving sideways is impossible.
21
Drives with Non-Holonomic
Constraints
Synchro-drive
Differential drive
Ackermann drive
22
Drives without Non-Holonomic
Constraints
Mecanum wheels
23
Dead Reckoning and Odometry
Estimating the motion based on the issued
controls/wheel encoder readings
Integrated over time
24
Summary
Introduced different types of drives for
wheeled robots
Math to describe the motion of the basic
drives given the speed of the wheels
Non-holonomic constraints
Odometry and dead reckoning
25
Introduction to
Mobile Robotics
Proximity Sensors
Wolfram Burgard
1
Sensors of Wheeled Robots
Perception of the environment
Intensity-based
Passive:
Cameras
Tactiles
2
Tactile Sensors
Measure contact with objects
Touch sensor
Spring
Bumper sensor
Contact
3
Ultrasound Sensors
Emit an ultrasound signal
Wait until they receive
the echo
Time of flight sensor
Polaroyd 6500
4
Time of Flight Sensors
emitter
object
d vt /2
5
Properties of Ultrasounds
Signal profile [Polaroid]
6
Sources of Error
Opening angle
Crosstalk
Specular reflection
7
Typical Ultrasound Scan
8
Parallel Operation
Given a 15 degrees opening angle, 24 sensors are
needed to cover the whole 360 degrees area
around the robot.
Let the maximum range we are interested in be
10m.
The time of flight then is 2*10m divided by the
speed of sound (330m/sec) which leads to 0.06sec
A complete scan thus requires 24*0.06=1.45sec
To allow frequent updates (necessary for high
speed) the sensors have to be fired in parallel.
This increases the risk of crosstalk
9
Laser Range Scanner
10
Properties
High precision
Wide field of view
Some laser scanners are security approved
for emergency stops (collision detection)
11
Computing the End Points
Laser data comes as an array or range
readings, e.g. [1; 1.2; 1.5; 0.1; 81.9; …]
Assume an field of view of 180 deg
First beams starts at -½ of the fov
Maximum range: ~80 m (SICK LMS)
12
Computing the End Points
Laser data comes as an array or range
readings, e.g. [1; 1.2; 1.5; 0.1; 91.9; …]
Assume an field of view of 180 deg
First beams starts at -½ of the fov
13
Robots Equipped with Laser
Scanners
14
Typical Scans
15
Another Range Sensor (Kinect)
16
Wolfram in 3D
17
Introduction to
Mobile Robotics
Probabilistic Robotics
Wolfram Burgard
1
Probabilistic Robotics
Key idea:
2
Axioms of Probability Theory
P(A) denotes probability that proposition A is true.
3
A Closer Look at Axiom 3
True
A A∧ B B
4
Using the Axioms
5
Discrete Random Variables
E.g.
6
Continuous Random Variables
E.g. p(x)
7
“Probability Sums up to One”
8
Joint and Conditional Probability
P(X=x and Y=y) = P(x,y)
9
Law of Total Probability
10
Marginalization
11
Bayes Formula
12
Normalization
Algorithm:
13
Bayes Rule
with Background Knowledge
14
Conditional Independence
P ( x, y z ) = P ( x | z ) P ( y | z )
Equivalent to P ( x z ) = P ( x | z , y )
and P( y z ) = P( y | z , x)
P ( x, y ) = P ( x ) P ( y )
(independence/marginal independence)
15
Simple Example of State Estimation
16
Causal vs. Diagnostic Reasoning
P(open|z) is diagnostic
P(z|open) is causal
In some situations, causal knowledge
is easier to obtain count frequencies!
Bayes rule allows us to use causal
knowledge:
P( z | open) P(open)
P(open | z ) =
P( z )
17
Example
P(z|open) = 0.6 P(z|¬open) = 0.3
P(open) = P(¬open) = 0.5
P( z | open) P(open)
P(open | z ) =
P( z | open) p (open) + P( z | ¬open) p (¬open)
0.6 ⋅ 0.5 0 .3
P(open | z ) = = = 0.67
0.6 ⋅ 0.5 + 0.3 ⋅ 0.5 0.3 + 0.15
18
Combining Evidence
Suppose our robot obtains another
observation z2
19
Recursive Bayesian Updating
Markov assumption:
zn is independent of z1,...,zn-1 if we know x
20
Example: Second Measurement
23
Typical Actions
The robot turns its wheels to move
The robot uses its manipulator to grasp
an object
Plants grow over time …
24
Modeling Actions
To incorporate the outcome of an
action u into the current “belief”, we
use the conditional pdf
P(x | u, x’)
25
Example: Closing the door
26
State Transitions
P(x | u, x’) for u = “close door”:
0.9
0.1 open closed 1
0
If the door is open, the action “close door”
succeeds in 90% of all cases
27
Integrating the Outcome of Actions
Continuous case:
Discrete case:
29
Bayes Filters: Framework
Given:
Stream of observations z and action data u:
30
Markov Assumption
Underlying Assumptions
Static world
Independent noise
Perfect model, no approximation errors
31
z = observation
u = action
Bayes Filters x = state
Bayes
Markov
Total prob.
Markov
Markov
32
Bayes
Bel ( xt ) = ηFilter
P( zt | xt ) ∫Algorithm
P( xt | ut , xt −1 )Bel ( xt −1 )dxt −1
33
Bayes Filters are Familiar!
Bel ( xt ) = η P ( zt | xt ) ∫ P( xt | ut , xt −1 )Bel ( xt −1 )dxt −1
Kalman filters
Particle filters
Hidden Markov models
Dynamic Bayesian networks
Partially Observable Markov Decision
Processes (POMDPs)
34
Probabilistic Localization
Probabilistic Localization
Summary
Bayes rule allows us to compute
probabilities that are hard to assess
otherwise.
Under the Markov assumption,
recursive Bayesian updating can be
used to efficiently combine evidence.
Bayes filters are a probabilistic tool
for estimating the state of dynamic
systems.
37
Introduction to
Mobile Robotics
1
Robot Motion
Robot motion is inherently uncertain.
How can we model this uncertainty?
2
Dynamic Bayesian Network for
Controls, States, and Sensations
3
Probabilistic Motion Models
To implement the Bayes Filter, we need the
transition model .
4
Coordinate Systems
The configuration of a typical wheeled robot in 3D
can be described by six parameters.
This are the three-dimensional Cartesian
coordinates plus the three Euler angles for roll,
pitch, and yaw.
For simplicity, throughout this section we consider
robots operating on a planar surface.
5
Typical Motion Models
In practice, one often finds two types of
motion models:
Odometry-based
Velocity-based (dead reckoning)
Odometry-based models are used when
systems are equipped with wheel encoders.
Velocity-based models have to be applied
when no wheel encoders are given.
They calculate the new pose based on the
velocities and the time elapsed.
6
Example Wheel Encoders
These modules provide
+5V output when they
"see" white, and a 0V
output when they "see"
black.
Source: http://www.active-robots.com/ 7
Dead Reckoning
Derived from “deduced reckoning.”
Mathematical procedure for determining the
present location of a vehicle.
Achieved by calculating the current pose of
the vehicle based on its velocities and the
time elapsed.
Historically used to log the position of ships.
[Image source:
Wikipedia, LoKiLeCh] 8
Reasons for Motion Errors of
Wheeled Robots
bump
carpet
and many more …
9
Odometry Model
• Robot moves from x , y , to x ' , y ' , ' .
• Odometry information u rot 1 , rot 2 , trans .
x , y , trans
rot 1
10
The atan2 Function
Extends the inverse tangent and correctly
copes with the signs of x and y.
11
Noise Model for Odometry
The measured motion is given by the true
motion corrupted with noise.
12
Typical Distributions for
Probabilistic Motion Models
Normal distribution Triangular distribution
2 0 if | x | 6 2
1 x
1
(x) 2
2 (x)
2
6 | x |
2
2 e
2
2
6
2
13
Calculating the Probability
Density (zero-centered)
For a normal distribution query point
1. Algorithm prob_normal_distribution(a,b):
std. deviation
2. return
1. Algorithm prob_triangular_distribution(a,b):
2. return
14
Calculating the Posterior
Given x, x’, and Odometry
hypotheses odometry
1. Algorithm motion_model_odometry(x, x’,u)
2. trans ( x ' x ) ( y ' y )
2 2
15
Application
Repeated application of the motion model
for short movements.
Typical banana-shaped distributions
obtained for the 2d-projection of the 3d
posterior.
x x
u
u
16
Sample-Based Density Representation
17
Sample-Based Density Representation
18
How to Sample from a Normal
Distribution?
Sampling from a normal distribution
1. Algorithm sample_normal_distribution(b):
2. return
19
Normally Distributed Samples
106 samples
20
How to Sample from Normal or
Triangular Distributions?
Sampling from a normal distribution
1. Algorithm sample_normal_distribution(b):
2. return
1. Algorithm sample_triangular_distribution(b):
2. return
21
For Triangular Distribution
23
Rejection Sampling
Sampling from arbitrary distributions
Sample x from a uniform distribution from [-b,b]
Sample y from [0, max f]
if f(x) > y keep the sample x
otherwise reject it
f(x’)
y y’
OK
f(x)
x x’
24
Rejection Sampling
1. Algorithm sample_distribution(f,b):
2. repeat
3.
4.
5. until ( )
6. return
25
Example
Sampling from
26
Sample Odometry Motion Model
1. Algorithm sample_motion_model(u, x):
u rot 1 , rot 2 , trans , x x , y ,
1. ˆrot 1 rot 1 sample( 1 | rot 1 | 2 trans )
2. ˆtrans trans sample( 3 trans 4 (| rot 1 | | rot 2 |))
3. ˆrot 2 rot 2 sample( 1 | rot 2 | 2 trans )
27
Examples (Odometry-Based)
28
Sampling from Our Motion
Model
Start
29
Velocity-Based Model
-90
30
Noise Model for the Velocity-
Based Model
The measured motion is given by the true
motion corrupted with noise.
vˆ v 1 |v | 2 | |
ˆ 3 | v | 4 | |
vˆ v 1 |v | 2 | |
ˆ 3 | v | 4 | |
ˆ 5 | v | 6 | |
33
Equation for the Velocity Model
Center of circle:
34
Equation for the Velocity Model
some constant
Center of circle:
some constant
Center of circle:
36
Equation for the Velocity Model
and
37
Equation for the Velocity Model
The parameters of the circle:
38
Posterior Probability for
Velocity Model
39
Sampling from Velocity Model
40
Examples (Velocity-Based)
41
Map-Consistent Motion Model
p ( x '| u , x ) p ( x '| u , x, m )
43
Introduction to
Mobile Robotics
1
Bayes Filters are Familiar!
Bel ( x t ) P ( z t | x t ) P ( x t | u t , x t 1 ) Bel ( x t 1 ) dx t 1
Kalman filters
Particle filters
Hidden Markov models
Dynamic Bayesian networks
Partially Observable Markov Decision
Processes (POMDPs)
2
Sensors for Mobile Robots
Contact sensors: Bumpers
Proprioceptive sensors
Accelerometers (spring-mounted masses)
Gyroscopes (spinning mass, laser light)
Compasses, inclinometers (earth magnetic field, gravity)
Proximity sensors
Sonar (time of flight)
Radar (phase and frequency)
Laser range-finders (triangulation, tof, phase)
Infrared (intensity)
Visual sensors: Cameras
Satellite-based sensors: GPS
3
Proximity Sensors
4
Beam-based Sensor Model
Scan z consists of K measurements.
z { z 1 , z 2 ,..., z K }
P ( z | x, m ) P ( zk | x, m )
k 1
5
Beam-based Sensor Model
P ( z | x, m ) P ( zk | x, m )
k 1
6
Typical Measurement Errors of
an Range Measurements
1. Beams reflected by
obstacles
2. Beams reflected by
persons / caused
by crosstalk
3. Random
measurements
4. Maximum range
measurements
7
Proximity Measurement
Measurement can be caused by …
a known obstacle.
cross-talk.
an unexpected obstacle (people, furniture, …).
missing all obstacles (total reflection, glass, …).
Noise is due to uncertainty …
in measuring distance to known obstacle.
in position of known obstacles.
in position of additional obstacles.
whether obstacle is missed.
8
Beam-based Proximity Model
Measurement noise Unexpected obstacles
e z z z exp
2
1 ( z z exp )
1
Phit ( z | x , m ) e 2 b Punexp ( z | x, m )
2 b 0 otherwise
9
Beam-based Proximity Model
Random measurement Max range
1 1 𝑧 = 𝑧max
Prand ( z | x , m ) 𝑃max 𝑧 𝑥, 𝑚 =
z max 0 otherwise
10
Resulting Mixture Density
T
hit Phit ( z | x , m )
unexp Punexp ( z | x , m )
P ( z | x, m ) P ( z | x, m )
max max
P ( z | x, m )
rand rand
11
Raw Sensor Data
Measured distances for expected distance of 300 cm.
Sonar Laser
12
Approximation
Maximize log likelihood of the data
P ( z | z exp )
Laser
Sonar
300cm 400cm
Approximation Results
Laser
Sonar
15
Example
z P(z|x,m)
16
Influence of Angle to Obstacle
"sonar-0"
0.25
0.2
0.15
0.1
0.05
0
70
60
50
0 40
10 20 30
30 40 20
50 10
60 70 0
19
Influence of Angle to Obstacle
"sonar-1"
0.3
0.25
0.2
0.15
0.1
0.05
0
70
60
50
0 40
10 20 30
30 40 20
50 10
60 70 0
20
Influence of Angle to Obstacle
"sonar-2"
0.3
0.25
0.2
0.15
0.1
0.05
0
70
60
50
0 40
10 20 30
30 40 20
50 10
60 70 0
21
Influence of Angle to Obstacle
"sonar-3"
0.25
0.2
0.15
0.1
0.05
0
70
60
50
0 40
10 20 30
30 40 20
50 10
60 70 0
22
Summary Beam-based Model
Assumes independence between beams.
Justification?
Overconfident!
Models physical causes for measurements.
Mixture of densities for these causes.
Assumes independence between causes. Problem?
Implementation
Learn parameters based on real data.
Different models should be learned for different angles at
which the sensor beam hits the obstacle.
Determine expected distances by ray-tracing.
Expected distances can be pre-processed.
23
Scan-based Model
Beam-based model is …
not smooth for small obstacles and at edges.
not very efficient.
24
Scan-based Model
Probability is a mixture of …
a Gaussian distribution with mean at distance to
closest obstacle,
a uniform distribution for random
measurements, and
a small uniform distribution for max range
measurements.
Again, independence between different
components is assumed.
25
Example
Likelihood field
Map m
P(z|x,m)
26
San Jose Tech Museum
27
Scan Matching
Extract likelihood field from scan and use it
to match different scan.
28
Properties of Scan-based Model
Highly efficient, uses 2D tables only.
Distance grid is smooth w.r.t. to small
changes in robot position.
Allows gradient descent, scan matching.
Ignores physical properties of beams.
30
Additional Models of Proximity
Sensors
Map matching (sonar, laser): generate
small, local maps from sensor data and
match local maps against global model.
Scan matching (laser): map is represented
by scan endpoints, match scan into this
map.
Features (sonar, laser, vision): Extract
features such as doors, hallways from
sensor data.
31
Landmarks
Active beacons (e.g., radio, GPS)
Passive (e.g., visual, retro-reflective)
Standard approach is triangulation
Sensor provides
distance, or
bearing, or
distance and bearing.
32
Vision-Based Localization
33
Distance and Bearing
34
Probabilistic Model
1. Algorithm landmark_detection_model(z,x,m):
z i, d , , x x, y ,
2. dˆ ( m x (i ) x ) ( m y (i ) y )
2 2
3. ˆ atan2( m y ( i ) y , m x ( i ) x )
5. Return p det
35
Distributions
36
Distances Only x (a d1 d 2 ) / 2a
2 2 2
No Uncertainty y (d x )
1
2 2
X’
a
P1 P2
d1 d2
x P1=(0,0)
P2=(a,0)
37
Bearings Only
P3
No Uncertainty
D z3
2 b
P2 P2 D
z2 3
D1
D1
z2
z1
P1 P1
z1
D 1 z 1 z 2 2 z 1 z 2 cos( )
2 2 2
Law of cosine
D 2 z 2 z 3 2 z 1 z 2 cos( b )
2 2 2
D 1 z 1 z 2 2 z 1 z 2 cos
2 2 2
D 3 z 1 z 3 2 z 1 z 2 cos( b )
2 2 2
38
Bearings Only With Uncertainty
P3
P2
P2
P1
P1
1
Probabilistic Localization
2
Piecewise
Constant
3
Discrete Bayes Filter Algorithm
1. Algorithm Discrete_Bayes_filter( Bel(x),d ):
2. h=0
3. If d is a perceptual data item z then
4. For all x do
5. Bel ' ( x ) = P ( z | x ) Bel ( x )
6. h = h Bel ' ( x )
7. For all x do
1
8. Bel ' ( x ) = h Bel ' ( x )
9. Else if d is an action data item u then
10. For all x do
11. Bel ' ( x ) = P ( x | u , x ' ) Bel ( x ' )
12. Return Bel’(x)
x'
4
Piecewise Constant
Representation
Bel ( x t = x , y , )
5
Implementation (1)
To update the belief upon sensory input and to
carry out the normalization one has to iterate
over all cells of the grid.
Especially when the belief is peaked (which is
generally the case during position tracking), one
wants to avoid updating irrelevant aspects of the
state space.
One approach is not to update entire sub-spaces
of the state space.
This, however, requires to monitor whether the
robot is de-localized or not.
To achieve this, one can consider the likelihood
of the observations given the active components
of the state space. 6
Implementation (2)
To efficiently update the belief upon robot motions, one typically
assumes a bounded Gaussian model for the motion uncertainty.
This reduces the update cost from O(n2) to O(n), where n is the
number of states.
The update can also be realized by shifting the data in the grid
according to the measured motion.
In a second step, the grid is then convolved using a separable
Gaussian Kernel.
Two-dimensional example:
8
Sonars and
Occupancy Grid Map
9
Tree-based Representation
10
Tree-based Representations
11
Summary
Discrete filters are an alternative way for
implementing Bayes Filters
They are based on histograms for representing
the density.
They have huge memory and processing
requirements
Can easily recover from localization errors
Their accuracy depends on the resolution of
the grid.
Special approximations need to be made to
make this approach having dynamic memory
and computational requirements.
12
Introduction to
Mobile Robotics
Bayes Filter – Particle Filter
and Monte Carlo Localization
Wolfram Burgard
1
Motivation
Recall: Discrete filter
Discretize the continuous state space
High memory complexity
Fixed resolution (does not adapt to the belief)
Basic principle
Set of state hypotheses (“particles”)
Survival-of-the-fittest
2
Sample-based Localization (sonar)
Mathematical Description
4
Function Approximation
f(x’)
c c
OK
f(x)
x x’
6
Importance Sampling Principle
10
This is Easy!
We can draw samples from p(x|zl) by adding
noise to the detection parameters.
Importance Sampling
Importance Sampling with
Resampling
19
Particle Filter Algorithm
20
Particle Filter Algorithm
Resampling
Given: Set S of weighted samples.
w3 w3
2. S ' , c1 w1
3. For i 2n Generate cdf
4. ci ci 1 w i
11. Return S’
Also called stochastic universal sampling
Mobile Robot Localization
start pose
rotation
translation
rotation
Start
Proximity Sensor Model Reminder
31
Mobile Robot Localization Using
Particle Filters (2)
Particles are drawn from the motion model
(proposal distribution)
Particles are weighted according to the
observation model (sensor model)
Particles are resampled according to the
particle weights
32
Mobile Robot Localization Using
Particle Filters (3)
Why is resampling needed?
We only have a finite number of particles
Without resampling: The filter is likely to
loose track of the “good” hypotheses
Resampling ensures that particles stay in
the meaningful area of the state space
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Sample-based Localization (sonar)
51
Initial Distribution
52
After Incorporating Ten
Ultrasound Scans
53
After Incorporating 65 Ultrasound
Scans
54
Estimated Path
55
Using Ceiling Maps for Localization
P(z|x)
z
h(x)
Under a Light
Measurement z: P(z|x):
Next to a Light
Measurement z: P(z|x):
Elsewhere
Measurement z: P(z|x):
Global Localization Using Vision
Vision-based Localization
Limitations
The approach described so far is able
to track the pose of a mobile robot and
to globally localize the robot
64
Approaches
Randomly insert a fixed number of
samples with randomly chosen poses
This corresponds to the assumption that
the robot can be teleported at any point in
time to an arbitrary location
Alternatively, insert such samples inverse
proportional to the average likelihood of
the observations (the lower this likelihood
the higher the probability that the current
estimate is wrong).
65
Summary – Particle Filters
Particle filters are an implementation of
recursive Bayesian filtering
They represent the posterior by a set of
weighted samples
They can model arbitrary and thus also
non-Gaussian distributions
Proposal to draw new samples
Weights are computed to account for the
difference between the proposal and the
target
Monte Carlo filter, Survival of the fittest,
Condensation, Bootstrap filter
66
Summary – PF Localization
Prediction
Bel(xt ) p(x | u , x
t t t1 ) Bel(xt1 ) dxt1
Correction
Prediction
bel(xt ) p(x | u , x
t t t1 ) bel(xt1 ) dxt1
Correction
5
Gaussians
p( x) ~ N ( , 2 ) :
2
1 ( x )
1
p( x) e2 2
2
Univariate -
1
1 (x )t 1 (x )
p(x) 1/2
e 2
(2 ) d/2
Multivariate
Properties of Gaussians
Univariate case
X ~ N ( , 2 )
Y ~ N (a b, a2 2 )
Y aX b
X1 ~ N ( 1 , 1 )
2 2 2
1
2
p( X ) p( X ) ~ N 2
1
,
1 2 1 2 2 2
1 2 1 2 1 2
2 2 2 2
X 2 ~ N ( 2 , 2 )
Properties of Gaussians
Multivariate case
X ~ N ( , )
Y ~ N ( A B, AAT )
Y AX B
X1 ~ N ( 1 , 1 ) 2 1 1
p( X1 ) p( X 2 ) ~ N 1 2 , 1
X 2 ~ N ( 2 , 2 ) 1 2 1 2 1
1 2
(where division "–" denotes matrix inversion)
xt At xt1 Btut t
with a measurement
zt Ct xt t
10
Components of a Kalman Filter
t t K t (zt t ) t2
bel(xt ) with K t 2
t2 (1 K t ) t2 t obs,t
2
prediction
measurement correction
Linear Gaussian Systems: Initialization
bel ( x0 ) Nx0 ; 0 , 0
Linear Gaussian Systems: Dynamics
xt At xt1 Btut t
p(xt | ut, xt1 ) N xt; At xt1 Btut,Qt
bel(xt ) p(x | u , x
t t t1 ) bel(xt1 ) dxt1
~ N xt; At xt1 Btut,Qt ~ N xt1; t1, t1
Linear Gaussian Systems: Dynamics
bel(xt ) p(x | u , x
t t t1 ) bel(xt1 ) dxt1
~ N xt;At xt1 Btut,Qt ~ N xt1;t1, t1
1
bel(xt ) exp T 1
(xt At xt1 Btut ) Qt (xt At xt1 Btut )
2
1
exp (xt1 t1 ) t1 (xt1 t1 ) dxt1
T 1
2
t Att1 Btut
bel(xt )
t A t t1 t Qt
AT
Linear Gaussian Systems: Observations
zt Ct xt t
p(zt | xt ) N zt;Ct xt,Rt
2 2
2. Prediction:
3. t Att1 Btut
4. t Att1 AtT Qt
5. Correction:
K t tCtT (Ct tCtT Rt )1
6.
7. t t K t (zt Ct t )
8. t (I K tCt ) t
9. Return t, t
The Prediction-Correction-Cycle
Prediction
25
The Prediction-Correction-Cycle
K t (zt Ctt )
bel(xt ) t t ,K t tCtT (Ct tCtT Rt )1
t (I K tCt ) t
Correction
26
The Prediction-Correction-Cycle
Prediction
Correction
27
Kalman Filter Summary
Only two parameters describe belief about
the state of the system
Highly efficient: Polynomial in the
measurement dimensionality k and
state dimensionality n:
O(k2.376 + n2)
Prediction
bel(xt ) p(x | u , x
t t t1 ) bel(xt1 ) dxt1
Correction
bel ( xt ) p( zt | xt ) bel ( xt )
Discrete Kalman Filter
Estimates the state x of a discrete-time
controlled process
xt At xt1 Btut t
with a measurement
zt Ct xt t
3
Components of a Kalman Filter
Matrix (nxn) that describes how the state
At evolves from t-1 to t without controls or
noise.
prediction
measurement correction
Kalman Filter Algorithm
1. Algorithm Kalman_filter( t-1, t-1, ut, zt):
2. Prediction:
3. t Att1 Btut
4. t At t1 AtT Qt
5. Correction:
6. K t tCtT (Ct tCtT Rt )1
7. t t K t (zt Ct t )
8. t (I K tCt ) t
9. Return t, t
Nonlinear Dynamic Systems
Most realistic robotic problems involve
nonlinear functions
xt At xt1 Btut t zt Ct xt t
xt g(ut , xt1 ) zt h( xt )
Linearity Assumption Revisited
Non-Linear Function
Non-Gaussian!
Non-Gaussian Distributions
The non-linear functions lead to non-
Gaussian distributions
Kalman filter is not applicable anymore!
Local linearization!
EKF Linearization: First Order
Taylor Expansion
Prediction:
g(ut , t1 )
g(ut , xt1 ) g(ut , t1 ) ( xt1 t1 )
xt1
g(ut , xt1 ) g(ut , t1 ) Gt ( xt1 t1 )
Correction:
h( t ) Jacobian matrices
h( xt ) h( t ) ( xt t )
xt
h( xt ) h( t ) H t ( xt t )
Reminder: Jacobian Matrix
It is a non-square matrix in general
Correction:
h( t ) Linear function!
h( xt ) h( t ) ( xt t )
xt
h( xt ) h( t ) H t ( xt t )
Linearity Assumption Revisited
Non-Linear Function
EKF Linearization (1)
EKF Linearization (2)
EKF Linearization (3)
EKF Algorithm
1. Extended_Kalman_filter( t-1, t-1, ut, zt):
2. Prediction:
3. t g(ut, t1 ) t Att1 Btut
4. t Gtt1GtT Qt t Att1 AtT Qt
5. Correction:
6. K t tHtT (H t tH tT Rt )1 K t tCtT (Ct tCtT Rt )1
7. t t K t (zt h(t )) t t K t (zt Ctt )
8. t (I K tHt )t t (I K tCt )t
9. Return t, t g(ut, t1 )
h(t ) Gt
Ht
xt xt1
Example: EKF Localization
EKF localization with landmarks (point features)
1. EKF_localization ( t-1, t-1, ut, zt, m):
Prediction: x' x' x'
t1, x t1,y t1,
g(ut, t1 ) y' y' y'
Gt
t1
t1, x t1,y Jacobian
t1,
of g w.r.t location
' ' '
t1, x t1,y t1,
x' x'
vt t
g(ut, t1 ) y' y'
Vt
ut vt t Jacobian of g w.r.t control
' '
vt t
| v | | | 2
0
2. Qt 1 t 2 t
Motion noise
2
0 3 | vt | 4 | t |
3. t g(ut , t1 ) Predicted mean
4. t Gtt1GtT VtQtVtT Predicted covariance (V
maps Q into state space)
1. EKF_localization ( t-1, t-1, ut, zt, m):
Correction:
mx t,x my t,y
2 2
ẑt Predicted measurement mean
atan 2 my t, y, mx t,x t,
(depends on observation type)
rt rt rt
h(t, m) t,x t,y t,
Jacobian of h w.r.t location
Ht
xt t t t
t,x t,y t,
2
r 0
Rt
2. 0 r2
3. St HttHt Rt
T
Innovation covariance
VtQtVtT VtQtVtT
EKF Observation Prediction Step
Rt Rt
Rt
Rt
EKF Correction Step
Rt
Rt
Estimation Sequence (1)
Estimation Sequence (2)
Extended Kalman Filter
Summary
The EKF is an ad-hoc solution to deal with non-
linearities
It performs local linearization in each step
It works well in practice for moderate non-linearities
(example: landmark localization)
There exist better ways for dealing with non-linearities
such as the unscented Kalman filter, called UKF
Unlike the KF, the EKF in general is not an optimal
estimator
It is optimal if the measurement and the motion
model are both linear, in which case the EKF reduces
to the KF.
31
Introduction to
Mobile Robotics
SLAM: Simultaneous
Localization and Mapping
Lukas Luft, Wolfram Burgard
What is SLAM?
Estimate the pose of a robot and the map of
the environment at the same time
SLAM is hard, because
a map is needed for localization and
a good pose estimate is needed for mapping
3
SLAM Applications
SLAM is central to a range of indoor,
outdoor, in-air and underwater applications
for both manned and autonomous vehicles.
Examples:
At home: vacuum cleaner, lawn mower
Air: surveillance with unmanned air vehicles
Underwater: reef monitoring
Underground: exploration of mines
Space: terrain mapping for localization
Every application that requires a map
4
SLAM Applications
Indoors Undersea
Space Underground
5
Map Representations
Examples: Subway map, city map,
landmark-based map
[Lu & Milios, 97; Gutmann, 98: Thrun 98; Burgard, 99; Konolige & Gutmann, 00; Thrun, 00; Arras, 99;
Haehnel, 01; Grisetti et al., 05; …]
Landmark-based
[Leonard et al., 98; Castelanos et al., 99: Dissanayake et al., 2001; Montemerlo et al., 2002;…
7
The SLAM Problem
SLAM is considered a fundamental
problem for robots to become truly
autonomous
Large variety of different SLAM
approaches have been developed
The majority uses probabilistic
concepts
History of SLAM dates back to the
mid-eighties
8
Feature-Based SLAM
Given:
The robot’s controls
Relative observations
Wanted:
Map of features
9
Feature-Based SLAM
Absolute
robot poses
Absolute
landmark
positions
But only
relative
measurements
of landmarks
10
Why is SLAM a Hard Problem?
1. Robot path and map are both unknown
Robot pose
uncertainty
12
SLAM: Simultaneous
Localization And Mapping
Full SLAM:
p ( x 0 :t , m | z 1:t , u 1:t )
Online SLAM:
p ( x t , m | z 1:t , u 1:t ) p(x 1:t
, m | z 1:t , u 1:t ) dx 1 dx 2 ... dx t 1
"Motion model"
"Observation model"
16
Remember the KF Algorithm
1. Algorithm Kalman_filter(mt-1, St-1, ut, zt):
2. Prediction:
3.
4.
5. Correction:
6.
7.
8.
9. Return mt, St
17
EKF SLAM: State representation
Localization
3x1 pose vector
3x3 cov. matrix
SLAM
Landmarks simply extend the state.
Growing state vector and covariance matrix!
18
EKF SLAM: State representation
Map with n landmarks: (3+2n)-dimensional
Gaussian
19
EKF SLAM: Filter Cycle
1. State prediction (odometry)
2. Measurement prediction
3. Measurement
4. Data association
5. Update
6. Integration of new landmarks
EKF SLAM: Filter Cycle
1. State prediction (odometry)
2. Measurement prediction
3. Measurement
4. Data association
5. Update
6. Integration of new landmarks
EKF SLAM: State Prediction
Odometry:
Robot-landmark cross-
covariance prediction:
EKF SLAM: Measurement
Prediction
Global-to-local
frame transform h
EKF SLAM: Obtained
Measurement
(x,y)-point landmarks
EKF SLAM: Data Association
Associates predicted
measurements
with observation
?
EKF SLAM: Update Step
State augmented by
Cross-covariances:
EKF SLAM
31
EKF SLAM: Correlations Matter
What if we neglected cross-correlations?
32
SLAM: Loop Closure
Recognizing an already mapped area,
typically after a long exploration path (the
robot “closes a loop”)
Structurally identical to data association,
but
high levels of ambiguity
possibly useless validation gates
environment symmetries
Uncertainties collapse after a loop closure
(whether the closure was correct or not)
37
SLAM: Loop Closure
Before loop closure
38
SLAM: Loop Closure
After loop closure
39
SLAM: Loop Closure
By revisiting already mapped areas,
uncertainties in robot and landmark
estimates can be reduced
Landmark
uncertainty
decreases
monotonically
with each new
observation
[Dissanayake et al., 2001] 41
KF-SLAM Properties
(Linear Case)
In the limit, the landmark estimates
become fully correlated
44
Victoria Park: Data Acquisition
[courtesy by E. Nebot] 45
Victoria Park: Estimated
Trajectory
[courtesy by E. Nebot] 46
Victoria Park: Landmarks
[courtesy by E. Nebot] 47
EKF SLAM Example: Tennis
Court
[courtesy by J. Leonard] 48
EKF SLAM Example: Tennis
Court
1
The SLAM Problem
Given:
The robot’s
controls
Observations of
nearby features
Estimate:
Map of features
Path of the robot
3
Map Representations
Typical models are:
Feature maps
Grid maps (occupancy or reflection
probability maps)
4
Why is SLAM a Hard Problem?
Robot pose
uncertainty
1. initialize particles
2. apply motion
model
3. weight particles
(sensor model)
4. resample
according to
weight
11
Recap: Particle Filter Localization
1. initialize particles
2. apply motion
model
3. weight particles
(sensor model)
4. resample
according to
weight
12
Recap: Particle Filter Localization
1. initialize particles
2. apply motion
model
3. weight particles
(sensor model)
4. resample
according to
weight
13
Recap: Particle Filter Localization
1. initialize particles
2. apply motion
model
3. weight particles
(sensor model)
4. resample
according to
weight
Actual measurement:
14
Recap: Particle Filter Localization
2
1 1. initialize particles
2. apply motion
model
1 1
3. weight particles
(sensor model)
2 4. resample
according to
weight
15
Recap: Particle Filter Localization
2
1 1. initialize particles
2. apply motion
model
1 1
3. weight particles
(sensor model)
2 4. resample
according to
weight
16
Localization vs. SLAM
A particle filter can be used to solve both
problems
Localization: state space <x, y, θ>
SLAM: state space <x, y, θ, map>
for landmark maps = <l1, l2, …, lm>
for grid maps = <c11, c12, …, c1n, c21, …, cnm>
17
Dependencies
Is there a dependency between certain
dimensions of the state space?
If so, can we use the dependency to solve
the problem more efficiently?
18
Rao-Blackwellization
Factorization to exploit dependencies
between variables:
SLAM posterior
Robot path posterior
landmark positions
Does this help to solve the problem?
Factorization first introduced by Murphy in 1999 22
Revisit the Graphical Model
32
FastSLAM
Rao-Blackwellized particle filtering based on
landmarks [Montemerlo et al., 2002]
Each landmark is represented by a 2x2
Extended Kalman Filter (EKF)
Each particle therefore has to maintain M EKFs
Particle
#1
x, y, θ Landmark 1 Landmark 2 … Landmark M
Particle
#2
x, y, θ Landmark 1 Landmark 2 … Landmark M
…
Particle
N
x, y, θ Landmark 1 Landmark 2 … Landmark M
33
FastSLAM – Action Update
Landmark #1
Filter
Particle #1
Landmark #2
Filter
Particle #2
Particle #3
34
FastSLAM – Sensor Update
Landmark #1
Filter
Particle #1
Landmark #2
Filter
Particle #2
Particle #3
35
FastSLAM – Sensor Update
36
FastSLAM – Sensor Update
Update map
Particle #1
of particle #1
Update map
Particle #2
of particle #2
37
FastSLAM - Video
38
FastSLAM Complexity – Naive
Update robot particles O(N)
based on the control
N = Number of particles
M = Number of map features
A Better Data Structure for
FastSLAM
Courtesy: M. Montemerlo
A Better Data Structure for
FastSLAM
5 7
FastSLAM Complexity
Update robot particles
based on the control
Incorporate an observation
into the Kalman filters
(given the data association)
N = Number of particles
M = Number of map features
O(N log(M))
Data Association Problem
Which observation belongs to which
landmark?
44
Per-Particle Data Association
4 km traverse
< 5 m RMS
position error
100 particles
Blue = GPS
Yellow = FastSLAM
Dataset courtesy of University of Sydney 46
Results – Victoria Park (Video)
48
FastSLAM Summary
FastSLAM factors the SLAM posterior into
low-dimensional estimation problems
Scales to problems with over 1 million features
FastSLAM factors robot pose uncertainty
out of the data association problem
Robust to significant ambiguity in data
association
Allows data association decisions to be delayed
until unambiguous evidence is collected
Advantages compared to the classical EKF
approach (especially with non-linearities)
Complexity of O(N log M)
49
Introduction to
Mobile Robotics
SLAM – Grid-based
FastSLAM
Lukas Luft, Wolfram Burgard
1
The SLAM Problem
SLAM stands for simultaneous localization
and mapping
The task of building a map while estimating
the pose of the robot relative to this map
2
Mapping using Raw Odometry
3
Grid-based SLAM
4
Rao-Blackwellization
poses map observations & movements
SLAM posterior
u0 u1 ut-1
x0 x1 x2 ... xt
z1 z2 zt
8
Mapping with Rao-
Blackwellized Particle Filters
Each particle represents a possible
trajectory of the robot
Each particle
maintains its own map and
updates it upon “mapping with known
poses”
3 particles
map of particle 2 10
Problem
Each map is quite big in case of grid
maps
Each particle maintains its own map,
therefore, one needs to keep the
number of particles small
Solution:
Compute better proposal
distributions!
Idea:
Improve the pose estimate before
applying the particle filter 11
Pose Correction Using Scan
Matching
Maximize the likelihood of the i-th pose and
map relative to the (i-1)-th pose and map
14
Motion Model for Scan Matching
Raw Odometry
Scan Matching
15
Mapping using Scan Matching
16
FastSLAM with Improved
Odometry
Scan-matching provides a locally
consistent pose correction
17
Graphical Model for Mapping
with Improved Odometry
u0 ... uk-1 uk ... u2k-1 un·k ... u(n+1)·k-1
z1 ... z k-1 zk+1...z2k-1 ... z n·k+1... z(n+1)·k-1
19
FastSLAM with Scan-Matching
Loop Closure
20
FastSLAM with Scan-Matching
21
22
Conclusion (thus far …)
23
What’s Next?
24
The Optimal Proposal
Distribution
observation motion
Probability for pose model model
given collected data
normalization
25
The Optimal Proposal
Distribution
maximum reported
by a scan matcher
Gaussian
approximation
Draw next
generation of
Sampled points around samples
the maximum 29
Estimating the Parameters of
the Gaussian for each Particle
32
Resampling
Sampling from an improved proposal reduces the
effects of resampling
However, resampling at each step limits the
“memory” of our filter
Supposed we loose at each frame 25% of the
particles, in the worst case we have a memory of
only 4 steps.
33
Selective Re-sampling
Re-sampling is dangerous, since important
samples might get lost
(particle depletion problem)
34
Number of Effective Particles
35
Resampling with neff
If our approximation is close to the
proposal, no resampling is needed
36
Typical Evolution of neff
visiting new
areas closing the
first loop
visiting
known areas
38
Intel Lab
15 particles
Compared to
FastSLAM with
Scan-Matching,
the particles are
propagated
closer to the true
distribution
39
Outdoor Campus Map
30 particles
250x250m2
1.75
1.088km
miles
(odometry)
20cm resolution
during scan
matching
30cm resolution
in final map
40
Outdoor Campus Map - Video
41
MIT Killian Court
42
MIT Killian Court
43
MIT Killian Court - Video
44
Conclusion
The ideas of FastSLAM can also be applied in the
context of grid maps
Utilizing accurate sensor observation leads to good
proposals and highly efficient filters
It is similar to scan-matching on a per-particle base
The number of necessary particles and
re-sampling steps can seriously be reduced
Improved versions of grid-based FastSLAM can
handle larger environments than naïve
implementations in “real time” since they need one
order of magnitude fewer samples
45
More Details on FastSLAM
M. Montemerlo, S. Thrun, D. Koller, and B. Wegbreit. FastSLAM:
A factored solution to simultaneous localization and mapping, AAAI02
(The classic FastSLAM paper with landmarks)
46
Introduction to
Mobile Robotics
Graph-Based SLAM
Wolfram Burgard
1
Particle Filter: Campus Map
30 particles
250x250m2
1.75 km
(odometry)
20cm resolution
during scan
matching
30cm resolution
in final map
2
Graph-Based SLAM
Constraints connect the poses of the
robot while it is moving
Constraints are inherently uncertain
11
Graph-Based SLAM in a Nutshell
Once we have the
graph, we determine
the most likely map
by correcting the
nodes
… like this
12
Graph-Based SLAM in a Nutshell
Once we have the
graph, we determine
the most likely map
by correcting the
nodes
… like this
Then, we can render a
map based on the
known poses
13
The Overall SLAM System
Interplay of front-end and back-end
A consistent map helps to determine new
constraints by reducing the search space
This lecture focuses only on the optimization
node positions
Graph Graph
raw Construction Optimization
data
(Front-End) graph (Back-End)
(nodes & edges)
today 14
Least Squares in General
Approach for computing a solution for
an overdetermined system
“More equations than unknowns”
Minimizes the sum of the squared
errors in the equations
Standard approach to a large set of
problems
15
Problem
Given a system described by a set of n
observation functions
Let
be the state vector
be a measurement of the state x
be a function which maps to a
predicted measurement
Given n noisy measurements about
the state
Goal: Estimate the state which bests
explains the measurements
16
Graphical Explanation
17
Error Function
Error is typically the difference between
the predicted and actual measurement
18
Least Squares for SLAM
Overdetermined system for estimating
the robot’s poses given observations
“More observations than states”
Minimizes the sum of the squared
errors
19
The Graph
It consists of n nodes
Each is a 2D or 3D transformation
(the pose of the robot at time ti)
A constraint/edge exists between the
nodes and if…
20
Create an Edge If… (1)
…the robot moves from to
Edge corresponds to odometry
21
Create an Edge If… (2)
…the robot observes the same part of
the environment from and from
Construct a virtual measurement
about the position of seen from
xi
xj
observation edge
of from
error
nodes
according to
the graph
24
Pose Graph
observation edge
of from
error
nodes
according to
the graph
Goal:
25
Gauss-Newton: The Overall
Error Minimization Procedure
Define the error function
Linearize the error function
Compute its derivative
Set the derivative to zero
Solve the linear system
Iterate this procedure until
convergence
26
Sparse Pose Adjustment
27
Example: CS Campus Freiburg
28
There are Variants for 3D
Highly connected
graph
Poor initial guess
LU & variants fail
2200 nodes
8600 constraints
29
Hanover2: 3D SLAM Map
31
Campus : Scan Matching Map
32
Campus : Graph Optimization
34
Campus : SLAM Map
35
Freiburg Campus Octomap
36
Example: Stanford Garage
38
3D Map of the Stanford Parking
Garage
approx. 260MB 39
Application: Navigation with
the Autonomous Car Junior
Task: reach a parking spot on the
upper level of the garage.
40
Autonomous Parking
42
Graph-SLAM with more Sensors
44
Introduction to
Mobile Robotics
Path and Motion Planning
Wolfram Burgard
1
Motion Planning
Latombe (1991):
Goals:
Collision-free trajectories.
Robot should reach the goal location as
quickly as possible.
2
… in Dynamic Environments
How to react to unforeseen obstacles?
efficiency
reliability
Grid-map-based planning
[Konolige, 00]
Nearness-Diagram-Navigation
[Minguez at al., 2001, 2002]
Vector-Field-Histogram+
[Ulrich & Borenstein, 98]
4
Classic Two-layered Architecture
map sub-goal
Collision
high frequency
Avoidance
motion command
sensor data
robot
5
Dynamic Window Approach
6
Admissible Velocities
Speeds are admissible if the robot would be
able to stop before reaching the obstacle
7
Reachable Velocities
Speeds that are reachable by acceleration
8
DWA Search Space
9
Dynamic Window Approach
10
Dynamic Window Approach
Heuristic navigation function.
Planning restricted to <x,y>-space.
No planning in the velocity space.
16
Problems of DWAs
17
Robot’s
Problems of DWAs velocity.
18
Robot’s
Problems of DWAs velocity.
Preferred
direction of NF.
19
Problems of DWAs
20
Problems of DWAs
21
Problems of DWAs
23
Problems of DWAs
24
Problems of DWAs
25
Problems of DWAs
Typical problem in a real world situation:
28
Configuration Space
Free space and obstacle region
With being the work space,
the set of obstacles, the robot in
configuration
We further define
: start configuration
: goal configuration
29
Configuration Space
Then, motion planning amounts to
Finding a continuous path
with
30
C-Space Discretizations
Continuous terrain needs to be discretized
for path planning
There are two general approaches to
discretize C-spaces:
Combinatorial planning
Characterizes Cfree explicitly by capturing the
connectivity of Cfree into a graph and finds
solutions using search
Sampling-based planning
Uses collision-detection to probe and
incrementally search the C-space for a solution
31
Search
The problem of search: finding a sequence
of actions (a path) that leads to desirable
states (a goal)
32
Search
The problem of search: finding a sequence
of actions (a path) that leads to desirable
states (a goal)
33
Search
The performance of a search algorithm is
measured in four different ways:
35
Uninformed Search
Breadth-first
Complete
Optimal if action costs equal
Time and space: O(bd)
Depth-first
Not complete in infinite spaces
Not optimal
Time: O(bm)
Space: O(bm) (can forget
explored subtrees)
(b: branching factor, d: goal depth, m: max. tree depth)
36
Informed Search: A*
What about using A* to plan
the path of a robot?
Finds the shortest path
Requires a graph structure
Limited number of edges
In robotics: planning on a 2d
occupancy grid map
37
A*: Minimize the Estimated
Path Costs
g(n) = actual cost from the initial state to n.
h(n) = estimated cost from n to the next goal.
f(n) = g(n) + h(n), the estimated cost of the
cheapest solution through n.
Let h*(n) be the actual cost of the optimal path
from n to the next goal.
h is admissible if the following holds for all n :
h(n) ≤ h*(n)
We require that for A*, h is admissible (the
straight-line distance is admissible in the
Euclidean Space).
38
Example: PathPlanning for
Robots in a Grid-World
39
Deterministic Value Iteration
To compute the shortest path from
every state to one goal state, use
(deterministic) value iteration.
Very similar to Dijkstra’s Algorithm.
Such a cost distribution is the optimal
heuristic for A*.
40
Typical Assumption in Robotics
for A* Path Planning
1. The robot is assumed to be localized.
2. The robot computes its path based on
an occupancy grid.
3. The correct motion commands are
executed.
41
Problems
42
Convolution of the Grid Map
43
Example: Map Convolution
one-dimensional environment, cells
c0, …, c5
44
Convolution
Consider an occupancy map. Than the
convolution is defined as:
45
A* in Convolved Maps
The costs are a product of path length
and occupancy probability of the cells.
46
5D-Planning – an Alternative to
the Two-layered Architecture
Plans in the full <x,y,θ,v,ω>-configuration
space using A*.
Considers the robot's kinematic constraints.
47
The Search Space (1)
What is a state in this space?
<x,y,θ,v,ω> = current position and
speed of the robot
48
The Search Space (2)
Idea: search in the discretized
<x,y,θ,v,ω>-space.
49
The Main Steps of the Algorithm
1. Update (static) grid map based on sensory
input.
50
Updating the Grid Map
The environment is represented as a 2d-
occupency grid map.
Convolution of the map increases security
distance.
Detected obstacles are added.
Cells discovered free are cleared.
update 51
Find a Path in the 2d-Space
Use A* to search for the optimal path in
the 2d-grid map.
52
Restricting the Search Space
53
Space Restriction
Resulting search space =
<x, y, θ, v, ω> with (x,y) Є channel.
Choose a sub-goal lying on the 2d-path
within the channel.
54
Find a Path in the 5d-Space
55
Examples
56
Timeouts
Steering a robot online requires to set new
steering commands frequently.
E.g., every 0.2 secs.
57
Alternative Steering Command
Previous trajectory still admissible?
OK
58
Timeout Avoidance
60
Comparison to the DWA (1)
DWAs often have problems entering narrow
passages.
61
Comparison to the DWA (2)
62
Comparison to the Optimum
45 2,345
iterations iterations 64
RRTs
The algorithm: Given C and q0
Sample from a
bounded region
centered around q0
E.g. an axis-aligned
relative random
translation or random
rotation
65
RRTs
The algorithm
formally a metric
defined on C
66
RRTs
The algorithm
67
RRTs
The algorithm
• No collision: add
edge
68
RRTs
The algorithm
• No collision: add
edge
• Collision: new vertex
is qs, as close as
possible to Cobs
69
RRTs
How to perform path planning with RRTs?
1. Start RRT at qI
2. At every, say, 100th iteration, force qrand = qG
3. If qG is reached, problem is solved
70
RRTs
However, some problems require more
effective methods: bidirectional search
Grow two RRTs, one from qI, one from qG
In every other
step, try to
extend each
tree towards
the newest
vertex of the
other tree
Filling a A bug
well trap 71
RRTs
RRTs are popular, many extensions exist:
real-time RRTs, anytime
RRTs, for dynamic
environments etc.
Pros:
Balance between greedy
search and exploration
Easy to implement
Alpha 1.0
Cons:
puzzle.
Metric sensivity Solved with
Unknown rate of convergence bidirectional
RRT
72
Road Map Planning
A road map is a graph in Cfree in which each
vertex is a configuration in Cfree and each
edge is a collision-free path through Cfree
73
Road Map Planning
A road map is a graph in Cfree in which each
vertex is a configuration in Cfree and each
edge is a collision-free path through Cfree
74
Generalized Voronoi Diagram
Defined to be the set of points q whose
cardinality of the set of boundary points of
Cobs with the same distance to q is greater
than 1
Let us decipher
qI'
this definition... qI
qG'
qG
Informally:
the place with the
same maximal
clearance from
all nearest obstacles
75
Generalized Voronoi Diagram
Formally:
Let be the boundary of Cfree, and d(p,q)
the Euclidian distance between p and q. Then, for
all q in Cfree, let
76
Generalized Voronoi Diagram
Geometrically:
Needs extensions 78
Randomized Road Maps
Also called Probabilistic Road Maps
specified
radius
What does “nearby” mean
Example local on a manifold? Defining a
planner good metric on C is crucial 80
Randomized Road Maps
Pros:
Probabilistically complete
qG
Do not construct C-space
Cobs
Apply easily to high
dimensional C-spaces Cobs
Randomized road maps have Cobs
solved previously unsolved qI
problems qG
Cons: Cobs Cobs
Do not work well for some
problems, narrow passages
Cobs Cobs
Not optimal, not complete qI
81
Randomized Road Maps
How to uniformly sample C ? This is not at all
trivial given its topology
For example over spaces of rotations: Sampling
Euler angles gives more samples near poles, not
uniform over SO(3). Use quaternions!
However, Randomized Road Maps are powerful,
popular and many extensions exist: advanced
sampling strategies (e.g. near obstacles), PRMs
for deformable objects, closed-chain systems,
etc.
82
From Road Maps to Paths
All methods discussed so far construct a
road map (without considering the query
pair qI and qG)
p=0.8
p=0.1 p=0.1
89
MDP Example
Executing the A* plan in this environment
Markov Property:
The transition probabilities from s to s'
depend only on the current state s
and not on the history of earlier states
93
Reward
In each state s, the agent receives a
reward R(s)
94
Reward
In our example, the reward is -0.04 in all
states (e.g. the cost of motion) except the
terminal states (that have rewards +1/-1)
A negative reward
gives agents an in-
centive to reach
the goal quickly
96
Policy
An MDP solution is called policy π
A policy is a mapping from states to actions
Conservative choice
Take long way around
as the cost per step of
-0.04 is small compared
with the penality to fall
down the stairs and
receive a -1 reward
98
Policy
When the balance of risk and reward
changes, other policies are optimal
R = -2 R = -0.2
R = -0.01 R>0
101
Utility of a State
With this definition, we can express Uπ(s)
as a function of its next state s'
102
Optimal Policy
The utility of a state allows us to apply the
Maximum Expected Utility principle to
define the optimal policy π*
105
Utility of a State
This result is noteworthy:
Optimal utility:
Abort, if change in utility is below a
threshold
111
Value Iteration Example
Calculate utility of the center cell
p=0.8
u=5 r=1 u=-8
p=0.1 p=0.1
u=1
p=0.8
p=0.1 p=0.1
u=10
u=1
115
Value Iteration Example
In our example
120
Summary
Robust navigation requires combined path
planning & collision avoidance.
Approaches need to consider robot's kinematic
constraints and plans in the velocity space.
Combination of search and reactive techniques
show better results than the pure DWA in a
variety of situations.
Using the 5D-approach the quality of the
trajectory scales with the performance of the
underlying hardware.
The resulting paths are often close to the
optimal ones.
121
Summary
Planning is a complex problem.
Focus on subset of the configuration space:
road maps,
grids.
Sampling algorithms are faster and have a
trade-off between optimality and speed.
Uncertainty in motion leads to the need of
Markov Decision Problems.
122
What’s Missing?
123
Exploration
reward cost
(expected information gain) (path length)
Single Robot Exploration
Frontiers between free space and unknown
areas are potential target locations
Going to frontiers will gain information
Exploration
Path planning
Action planning …
6
Exploration: The Problem
Given:
Unknown environment
Team of robots
Task:
Coordinate the robots to
efficiently learn a complete
map of the environment
Complexity:
Exponential in the number of robots
7
Example
Robot 1: Robot 2:
8
Levels of Coordination
No exchange of information
9
Realizing Explicit Coordination
for Multi-Robot Exploration
Robots share a common map
Frontiers between free space and unknown
areas are potential target locations
Find a good assignment of frontier locations
to robots to minimize exploration time and
maximize information gain
Key Ideas
1. Choose target locations at the frontier to
the unexplored area by trading off the
expected information gain and travel
costs.
2. Reduce utility of target locations whenever
they are expected to be covered by
another robot.
3. Use on-line mapping and localization to
compute the joint map.
11
The Coordination Algorithm
(informal)
12
The Coordination Algorithm
13
Estimating the Visible Area
Distances measured
during exploration:
Resulting probability
of measuring at least
distance d:
14
Application Example
15
Multi-Robot Exploration and
Mapping of Large Environments
16
Resulting Map
43m
62m 17
Further Application
18
Typical Trajectories in an Office
Environment
Implicit coordination: Explicit coordination:
19
Exploration Time
20
Simulation Experiments
21
Optimizing Assignments
The current system performs a greedy
assignment of robots to target locations
22
Optimizing Assignment Algorithm
. Variants:
Accept lower evaluations with a certain but
over time decreasing probability
Perform random restarts
Other Coordination Techniques
Hungarian Method:
Optimal assignment of jobs to machines given a
fixed cost matrix.
Similar results that the presented coordination
technique.
25
Exploration Time
26
Summary on Exploration
Efficient coordination leads to reduced exploration
times
In general exponential in the team size
Efficient polynomial approximations
Distributing the robots over the environment is
key to efficiency
Methods trade off the cost of an action and the
expected utility of reaching the corresponding
frontier (target location)
27
Other Problems
Unknown starting locations
Exploration under position uncertainty
Limited communication abilities
Efficient exchange of information
…
28
Tasks of Mobile Robots
SLAM
mapping localization
integrated
approaches
active
localization
exploration
path planning
2
Exploration and SLAM
SLAM is typically passive, because it
consumes incoming sensor data
Exploration actively guides the robot to
cover the environment with its sensors
Exploration in combination with SLAM:
Acting under pose and map uncertainty
Uncertainty should/needs to be taken into
account when selecting an action
3
Mapping with Rao-Blackwellized
4
Factorization Underlying
Rao-Blackwellized Mapping
poses map observations & odometry
5
Example: Particle Filter for Mapping
3 particles
map of particle 3 6
Combining Exploration and SLAM
SLAM
mapping localization
integrated
approaches
active
localization
exploration
path planning
8
Exploration
9
Where to Move Next?
10
Decision-Theoretic Approach
11
The Uncertainty of a Posterior
Entropy is a general measure for the
uncertainty of a posterior
Conditional Entropy
13
Mutual Information
Expected Information Gain or Mutual
Information = Expected Uncertainty
Reduction
14
Entropy Computation
15
The Uncertainty of the Robot
The uncertainty of the RBPF:
map
grid cells probability that the
uncertainty
cell is occupied
17
Map Entropy
probability
Low entropy
occupied free
probability
Low entropy
occupied free
probability
High entropy
occupied free
1. High-dimensional Gaussian
2. Grid-based approximation
19
Approximation of the
Trajectory Posterior Entropy
Average pose entropy over time:
20
Mutual Information
The mutual information I is given by the
expected reduction of entropy in the belief
potential observation
sequences
Approximating the Integral
The particle filter represents a posterior
about possible maps
map of particle i
The Utility
We take into account the cost of an action:
mutual information utility U
27
Dual Representation
for Loop Detection
28
Example: Trajectory Graph
29
Application Example
30
Example: Possible Targets
31
Example: Evaluate Targets
32
Example: Move Robot to Target
33
Example: Evaluate Targets
34
Example: Move Robot
… continue …
35
Example: Entropy Evolution
36
Comparison
Map uncertainty only:
37
Real Exploration Example
Selected
target
location
38
Corridor Exploration
39
Summary
A decision-theoretic approach to
exploration in the context of RBPF-SLAM
The approach utilizes the factorization of
the Rao-Blackwellization to efficiently
calculate the expected information gain
Reasons about measurements obtained
along the path of the robot
Considers a reduced action set consisting
of exploration, loop-closing, and place-
revisiting actions
40