Introduction to Robot Mapping Mobile...

63
1 Grid Maps and Mapping With Known Poses Wolfram Burgard Introduction to Mobile Robotics

Transcript of Introduction to Robot Mapping Mobile...

Page 1: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

1

Robot Mapping

Grid Maps and Mapping With Known Poses

Wolfram Burgard

Introduction to Mobile Robotics

Page 2: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

2

Why Mapping?

Learning maps is one of the fundamental problems in mobile robotics

Maps allow robots to efficiently carry out their tasks, allow localization …

Successful robot systems rely on maps for localization, path planning, activity planning etc.

Page 3: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

3

The General Problem of Mapping

What does the environment look like?

Page 4: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

4

The General Problem of Mapping Formally, mapping involves, given the

sensor data to calculate the most likely map

Page 5: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

5

The General Problem of Mapping Formally, mapping involves, given the

sensor data to calculate the most likely map Today we describe how to calculate

a map given the robot’s poses

Page 6: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

6

The General Problem of Mapping with Known Poses Formally, mapping with known poses

involves, given the measurements and the poses to calculate the most likely map

Page 7: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

7

Features vs. Volumetric Maps

Courtesy by E. Nebot

Page 8: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

8

Grid Maps

We discretize the world into cells The grid structure is rigid Each cell is assumed to be occupied or

free It is a non-parametric model It requires substantial memory

resources It does not rely on a feature detector

Page 9: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

9

Example

Page 10: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

10

Assumption 1

The area that corresponds to a cell is either completely free or occupied

free space

occupied space

Page 11: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

11

Representation

Each cell is a binary random variable that models the occupancy

Page 12: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

12

Occupancy Probability

Each cell is a binary random variable that models the occupancy Cell is occupied Cell is not occupied No information The environment is assumed to be

static

Page 13: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

13

Assumption 2

The cells (the random variables) are independent of each other

no dependency between the cells

Page 14: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

14

Representation The probability distribution of the map is

given by the product of the probability distributions of the individual cells

cell map

Page 15: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

15

Representation The probability distribution of the map is

given by the product of the probability distributions of the individual cells

four-dimensional vector

four independent cells

Page 16: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

16

Estimating a Map From Data

Given sensor data and the poses of the sensor, estimate the map

binary random variable

Binary Bayes filter (for a static state)

Page 17: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

17

Static State Binary Bayes Filter

Page 18: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

18

Static State Binary Bayes Filter

Page 19: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

19

Static State Binary Bayes Filter

Page 20: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

20

Static State Binary Bayes Filter

Page 21: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

21

Static State Binary Bayes Filter

Page 22: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

22

Static State Binary Bayes Filter

Do exactly the same for the opposite event:

Page 23: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

23

Static State Binary Bayes Filter

By computing the ratio of both probabilities, we obtain:

Page 24: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

24

Static State Binary Bayes Filter

By computing the ratio of both probabilities, we obtain:

Page 25: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

25

Static State Binary Bayes Filter

By computing the ratio of both probabilities, we obtain:

Page 26: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

26

Occupancy Update Rule

Recursive rule

Page 27: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

27

Occupancy Update Rule

Recursive rule Often written as

Page 28: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

28

Log Odds Notation

Log odds ratio is defined as and with the ability to retrieve

Page 29: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

29

Occupancy Mapping in Log Odds Form The product turns into a sum

or in short

Page 30: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

30

Occupancy Mapping Algorithm

highly efficient, only requires to compute sums

Page 31: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

31

Occupancy Grid Mapping

Developed in the mid 80’s by Moravec and Elfes Originally developed for noisy sonars Also called “mapping with know poses”

Page 32: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

32

Inverse Sensor Model for Sonars Range Sensors

In the following, consider the cells along the optical axis (red line)

Page 33: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

33

Occupancy Value Depending on the Measured Distance

z+d1 z+d2

z+d3 z

z-d1

measured dist.

prior

distance between the cell and the sensor

Page 34: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

34

z+d1 z+d2

z+d3 z

z-d1

Occupancy Value Depending on the Measured Distance

measured dist.

prior “free”

distance between the cell and the sensor

Page 35: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

35

z+d1 z+d2

z+d3 z

z-d1

Occupancy Value Depending on the Measured Distance

distance between the cell and the sensor

measured dist.

prior

“occ”

Page 36: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

36

Occupancy Value Depending on the Measured Distance

z+d1 z+d2

z+d3 z

z-d1

measured dist.

prior “no info”

distance between the cell and the sensor

Page 37: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

37

Update depends on the Measured Distance and Deviation from the Optical Axis

cell l

Linear in Gaussian in

Page 38: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

38

Intensity of the Update

Page 39: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

39

Resulting Model

Page 40: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

40

Example: Incremental Updating of Occupancy Grids

Page 41: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

41

Resulting Map Obtained with Ultrasound Sensors

Page 42: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

42

Resulting Occupancy and Maximum Likelihood Map

The maximum likelihood map is obtained by rounding the probability for each cell to 0 or 1.

Page 43: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

43

Inverse Sensor Model for Laser Range Finders

Page 44: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

44

Occupancy Grids From Laser Scans to Maps

Page 45: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

45

Example: MIT CSAIL 3rd Floor

Page 46: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

46

Uni Freiburg Building 106

Page 47: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

47

Alternative: Counting Model

For every cell count hits(x,y): number of cases where a beam

ended at <x,y> misses(x,y): number of cases where a

beam passed through <x,y>

Value of interest: P(reflects(x,y))

Page 48: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

48

The Measurement Model

Pose at time t: Beam n of scan at time t: Maximum range reading: Beam reflected by an object:

0 1

measured dist. in #cells

Page 49: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

49

The Measurement Model

Pose at time t: Beam n of scan at time t: Maximum range reading: Beam reflected by an object:

0 1

max range: “first zt,n-1 cells covered by the beam must be free”

Page 50: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

50

The Measurement Model

Pose at time t: Beam n of scan at time t: Maximum range reading: Beam reflected by an object:

0 1

otherwise: “last cell reflected beam, all others free”

max range: “first zt,n-1 cells covered by the beam must be free”

Page 51: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

51

Computing the Most Likely Map Compute values for m that maximize

Assuming a uniform prior probability for

P(m), this is equivalent to maximizing:

since independent and only depend on

Page 52: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

52

Computing the Most Likely Map cells beams

Page 53: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

53

Computing the Most Likely Map “beam n ends in cell j”

Page 54: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

54

Computing the Most Likely Map “beam n ends in cell j”

“beam n traversed cell j”

Page 55: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

55

Computing the Most Likely Map

Define

“beam n ends in cell j”

“beam n traversed cell j”

Page 56: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

56

Meaning of αj and βj

Corresponds to the number of times a beam that is not a maximum range beam ended in cell j ( )

Corresponds to the number of times a beam traversed cell j without ending in it ( )

Page 57: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

57

Computing the Most Likely Map Accordingly, we get

If we set

Computing the most likely map reduces to counting how often a cell has reflected a measurement and how often the cell was traversed by a beam.

we obtain

As the mj’s are independent we can maximize this sum by maximizing it for every j

Page 58: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

58

Difference between Occupancy Grid Maps and Counting The counting model determines how

often a cell reflects a beam.

The occupancy model represents whether or not a cell is occupied by an object.

Although a cell might be occupied by an object, the reflection probability of this object might be very small.

Page 59: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

59

Example Occupancy Map

Page 60: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

60

Example Reflection Map

glass panes

Page 61: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

61

Example Out of n beams only 60% are reflected from a cell

and 40% intercept it without ending in it. Accordingly, the reflection probability will be 0.6. Suppose p(occ | z) = 0.55 when a beam ends in a

cell and p(occ | z) = 0.45 when a beam traverses a cell without ending in it.

Accordingly, after n measurements we will have

The reflection map yields a value of 0.6, while the occupancy grid value converges to 1 as n increases.

Page 62: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

62

Summary (1) Grid maps are a popular model for

representing the environment Occupancy grid maps discretize the

space into independent cells Each cell is a binary random variable

estimating if the cell is occupied We estimate the state of every cell using

a binary Bayes filter This leads to an efficient algorithm for

mapping with known poses The log odds model is fast to compute

Page 63: Introduction to Robot Mapping Mobile Roboticsais.informatik.uni-freiburg.de/teaching/ss20/robotics/...robotics Maps allow robots to efficiently carry out their tasks, allow localization

63

Summary (2) Reflection probability maps are an

alternative representation The key idea of the sensor model is to

calculate for every cell the probability that it reflects a sensor beam

Given the this sensor model, counting the number of times how often a measurement intercepts or ends in a cell yields the maximum likelihood model

This approach has a consistent sensor model for mapping and localization