Document 247028

AUTONOMOUS SYSTEMS LAB
Information Processing in Robotics
Lecture 2
Dr. Rudolph Triebel
Ralf Kaestner
Autonomous Systems Lab
ETH Zentrum
Tannenstrasse 3, CLA
8092 Zürich, Switzerland
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Overview
Bayes Filter and Monte-Carlo-Localization
•
•
•
•
Introduction to localization problems
Basics of probability theory
The Bayes-Filter
Monte-Carlo-Localization
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
2/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction to Localization Problems
Example:
Mobile Robot
Indoor environment
The Robot has to fulfill a given task, for example: Cleaning
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
3/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
First Idea:
1. Start cleaning at current position
2. Move straight until an obstacle is
encountered
3. Choose a new direction of motion
4. Go back to step 2.
This is called a Reactive Agent
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
4/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
Problems with Reactive Agents:
• When are we ready?
• What is a good decision for a new
direction?
• Can we guarantee that the whole
room will be cleaned?
• What if the robot needs to refill or
recharge?
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
5/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
Second approach:
1. Obtain a map of the environment
2. Plan a path using the given map
3. Move along the obtained path
4. While moving: find position in map
5. End when the whole map is covered
This is called a Model-based Agent
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
6/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
Advantages of Model-based Agents:
• Ready when the path is traversed
• Easier to decide what to do next
• We can guarantee that the room will
be cleaned at some time
• The robot can include the refilling
station into its path
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
7/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
Examples:
Roomba
vacuum cleaner
Electrolux Trilobite
vacuum cleaner
Reactive
Model-based
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
8/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
Two major requirements for Model-based
Agents:
1. Mapping:
We need an accurate map of the environment.
The map is created with sensor measurements.
We need to know where the robot sensed the env.
2. Localization:
We need to know where the robot is with
respect to our map
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
9/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
The chicken-and-egg problem:
mapping
Known
positions
Known
map
localization
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
10/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
Solution to the chicken-and-egg problem:
Robot positions and map are computed
simultaneously
This is usually called:
Simultaneous Localisation
and Mapping (SLAM)
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
11/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Introduction
SLAM techniques are probabilistic. This
means that they
• Model the uncertainty of the robot’s
sensors using probability theory
• Compute the most likely solution for the
robot positions and the map
Textbook: Thrun, Burgard, Fox:
“Probabilistic Robotics”
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
12/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
AUTONOMOUS SYSTEMS LAB
1. Basics of Probability Theory
Autonomous Systems Lab
ETH Zentrum
Tannenstrasse 3, CLA
8092 Zürich, Switzerland
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Basics of Probability Theory
Definition 1.1: A sample space is a set of outcomes of
a given experiment.
Examples:
a) Coin toss experiment:
b) Distance measurement:
Definition 1.2: A random variable
is a function that
assigns a real number to each element of .
Example: Coin toss experiment:
Values of random variables are denoted with small
letters, e.g.:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
14/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Discrete and Continuous
If
is countable then is a discrete random variable,
else it is a continuous random variable.
The probability that
takes on a certain value
real number between and . It holds:
Discrete case
is a
Continuous case
More detailed: see, e.g. P. Brémaud: “An Introduction to Probabilistic Modeling”
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
15/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
A Discrete Random Variable
Suppose a robot knows that it is in a room, but it does
not know in which room. There are 4 possibilities:
Kitchen, Office, Bathroom, Living room
Then the random variable Room is discrete, because it
can take on one of four values. The probabilities
are, for example:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
16/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
A Continuous Random Variable
Suppose a robot travels 5 meters forward from a given
start point. Its position is a continuous random
variable with a Normal distribution:
Shorthand:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
17/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Joint and Conditional Probability
The joint probability of two random variables and
is the probability that the events
and
occur at the same time:
Shorthand:
Definition 1.3: The conditional probability of
is defined as:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
given
18/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Independency
Definition 1.4: Two random variables
independent iff:
For independent random variables
and
and
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
are
we have:
19/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Law of Total Probability
Theorem 1.1: For two random variables
holds:
Discrete case
and
it
Continuous case
The process of obtaining
from
by summing
or integrating over all values of is called
Marginalisation.
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
20/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Bayes Formula
Theorem 1.2: For two random variables
holds:
and
it
“Bayes Rule”
Proof:
I.
(definition)
II.
(definition)
III.
(from II.)
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
21/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Bayes Rule: Background Knowledge
For
it holds:
Background knowledge
Shorthand:
“Normalizer”
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
22/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Computing the Normalizer
Bayes rule
Total probability
can be computed without knowing
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
23/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Conditional Independence
Definition 1.5: Two random variables
and are
conditional independent given a third random
variable iff:
This is equivalent to:
and
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
24/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Expectation and Covariance
Definition 1.6: The expectation of a random variable
is defined as:
(discrete case)
(continuous case)
Definition 1.7: The covariance of a random variable
defined as:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
is
25/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
AUTONOMOUS SYSTEMS LAB
2. Bayes-Filtering
Autonomous Systems Lab
ETH Zentrum
Tannenstrasse 3, CLA
8092 Zürich, Switzerland
ETHZ – ASL – Dr. Rudolph Triebel – Informationsverarbeitung
Information Processing in Robotics
in der Robotik
(Lecture
(Teil
2)2)
Bayesianism vs. Frequentism
Bayesianism
Frequentism
(Bayes)
(Fisher, Neyman, Pearson)
• The state of nature can be
modeled as a random
variable
• Probabilities can be assigned
a-priori to arbitrary
Obviously lacks
statements objectivity
• Subjective (through opinion)
or objective (through data)
• Popular in decision theory
• The frequency of occurrence
of an event determines its
measure of probability
Built-in only result from
• Probabilities
subjectivity random
well-defined
experiments
• Conservative but
guaranteed to be objective
• Empirical, sampling theory
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
27/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Simple Example of State Estimation
Suppose a robot needs to know the state of a door.
It obtains a measurement from its sensor.
What is
?
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
28/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Causal vs. Diagnostic Reasoning
Searching for
is called diagnostic reasoning.
Searching for
is called causal reasoning.
Often causal knowledge is easier to obtain.
Bayes rule allows us to use causal knowledge:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
29/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Example with Numbers
Assume we have:
Then:
“ raises the probability that the door is open”
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
30/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Combining Evidence
Suppose our robot obtains another observation
.
Question: How can we integrate this new
information?
Formally, we want to estimate
.
Using Bayes formula with background knowledge:
?
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
?
31/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Markov Assumption
“If we know the state of the door at time
then
the measurement does not give any further
information about ..”
Formally: “
given
and
are conditional independent
.“ This means:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
32/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Example with Numbers
Assume we have:
(from above)
Then:
“
lowers the probability that the door is open”
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
33/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
General Form
Measurements:
Markov assumption:
and
are
conditionally independent given the state .
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
34/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Example: Sensing and Acting
Now the robot senses the door state and acts (it
opens or closes the door).
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
35/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
State Transitions
An action is modeled as a random variable where
in our case
means “close the door”.
State transition example:
0.9
0.1
open
closed
1
0
If the door is open, the action “close door” succeeds
in 90% of all cases.
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
36/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
The Outcome of Actions
For a given action we want to know the
probability
. We do this by integrating
over all possible previous states .
If the state space is discrete:
If the state space is continuous:
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
37/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Back to the Example
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
38/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Sensor Update and Action Update
So far, we learned two different ways to update the
system state:
• Sensor update:
• Action update:
Now we want to combine both:
Definition 2.1: Let
be a
sequence of sensor measurements and actions
until time . Then the belief of the current state
is defined as
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
39/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Graphical Representation
We can describe the overall process using a
Dynamic Bayes Network:
This incorporates the following Markov assumptions:
(measurement)
(state)
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
40/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
The Overall Bayes Filter
(Bayes)
(Markov)
(Tot. prob.)
(Markov)
(Markov)
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
41/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
The Bayes Filter Algorithm
Algorithm Bayes_filter
1.
2.
3.
4.
5.
6.
7.
8.
9.
:
if is a sensor measurement then
for all do
for all do
else if is an action then
for all do
return
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
42/43
Introduction Basics Bayes Filter MC-Localization Mapping SLAM
Bayes Filter Variants
The Bayes filter principle is used in
• Kalman filters
• Particle filters (Monte-Carlo-Localization)
• Hidden Markov models
• Dynamic Bayesian networks
• Partially Observable Markov Decision Processes
(POMDPs)
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
43/43
Summary
• Model-based agents maintain an internal representation
of their environment. They are capable of localizing
themselves in the environment by means of filtering
techniques, such as the Bayes filtering.
• The Bayes-Filter applies Bayesian probability theory and
the Markov assumption in order to recursively estimate
state (e.g. pose) from observations (e.g. range sensor
readings) and actions (e.g. robot motion).
• The Bayes-Filter is a statistical filter, it estimates
distributions over random state, observation, and action
variables.
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
44/43
Summary 2
• The belief is a key concept of Bayesian state estimation. It
distinguishes the robot’s true state from its internal belief
with regard to the that state.
• Various methods exist to represent the belief distribution.
Some of these methods apply approximation techniques
to overcome complexity issues (see Monte-Carlo
methods).
ETHZ – ASL – Dr. Rudolph Triebel – Information Processing in Robotics (Lecture 2)
45/43