Humanoid Robotics Monte Carlo Localization Maren Bennewitz 1 - - PowerPoint PPT Presentation

humanoid robotics monte carlo localization
SMART_READER_LITE
LIVE PREVIEW

Humanoid Robotics Monte Carlo Localization Maren Bennewitz 1 - - PowerPoint PPT Presentation

Humanoid Robotics Monte Carlo Localization Maren Bennewitz 1 Basis Probability Rules (1) If x and y are independent: Bayes rule: Often written as: The denominator is a normalizing constant that ensures that the posterior of the left


slide-1
SLIDE 1

1

Humanoid Robotics Monte Carlo Localization

Maren Bennewitz

slide-2
SLIDE 2

2

Basis Probability Rules (1)

If x and y are independent: Bayes’ rule: Often written as:

The denominator is a normalizing constant that ensures that the posterior of the left hand side adds up to 1 over all possible values of x.

In case the background knowledge, Bayes' rule turns into

slide-3
SLIDE 3

3

Basis Probability Rules (2)

Law of total probability: continuous case discrete case

slide-4
SLIDE 4

4

Markov Assumption

state of a dynamical system

  • bservations

actions

slide-5
SLIDE 5

5

Motivation

§ To perform useful service, a robot needs to

know its pose in its environment

§ Motion commands are only executed

inaccurately

§ Here: Estimate the global pose of a robot in

a given model of the environment

§ Based on its sensor data and odometry

measurements

§ Sensor data: Range image with depth

measurements or laser range readings

slide-6
SLIDE 6

6

Motivation

§ Estimate the pose of a robot in a given

model of the environment

§ Based on its sensor data and odometry

measurements

slide-7
SLIDE 7

7

State Estimation

§ Estimate the state given observations

and odometry measurements/actions

§ Goal: Calculate the distribution

slide-8
SLIDE 8

8

Recursive Bayes Filter 1

Definition of the belief all data up to time t

slide-9
SLIDE 9

9

Recursive Bayes Filter 2

Bayes’ rule

slide-10
SLIDE 10

10

Recursive Bayes Filter 3

independence assumption

slide-11
SLIDE 11

11

Recursive Bayes Filter 4

Law of total probability

slide-12
SLIDE 12

12

Recursive Bayes Filter 5

Markov assumption

slide-13
SLIDE 13

13

Recursive Bayes Filter 6

independence assumption

slide-14
SLIDE 14

14

Recursive Bayes Filter 7

recursive term

slide-15
SLIDE 15

15

Recursive Bayes Filter 7

motion model

slide-16
SLIDE 16

16

Recursive Bayes Filter 7

  • bservation model
slide-17
SLIDE 17

17

Probabilistic Motion Model

§ Robots execute motion commands only

inaccurately

§ The motion model specifies the probability

that action u carries the robot from to :

§ Defined individually for each type or robot

slide-18
SLIDE 18

18

Model for Range Readings

§ Sensor data consists of measurements § The individual measurements are

independent given the robot’s pose

§ “How well can the distance measurements

be explained given the pose and the map”

slide-19
SLIDE 19

19

§ Ray-cast models consider the first obstacle

along the ray

§ Compare the actually measured distance

with the expected distance

§ Use a Gaussian to evaluate the difference

Simplest Ray-Cast Model

measured distance

  • bject in map
slide-20
SLIDE 20

20

Beam-Endpoint Model

§ Evaluate the distance of the hypothetical

beam end point to the closest obstacle in the map with a Gaussian

Courtesy: Thrun, Burgard, Fox

slide-21
SLIDE 21

21

Summary

§ Bayes filter is a framework for state

estimation

§ The motion and observation model are the

central components of the Bayes filter

slide-22
SLIDE 22

22

Particle Filter Monte Carlo Localization

slide-23
SLIDE 23

23

Particle Filter

§ One implementation of the recursive Bayes

filter

§ Non-parametric framework (not only

Gaussian)

§ Arbitrary models can be used as motion and

  • bservation models
slide-24
SLIDE 24

24

Motivation

§ Goal: Approach for dealing with arbitrary

distributions

slide-25
SLIDE 25

25

Key Idea: Samples

§ Use multiple (weighted) samples to

represent arbitrary distributions

samples

slide-26
SLIDE 26

26

Particle Set

§ Set of weighted samples

state hypothesis importance weight

slide-27
SLIDE 27

27

Particle Filter

§ Recursive Bayes filter § Non-parametric approach § The set of weighted particles approximates

the belief about the robot’s pose

§ Two main steps to update the belief § Prediction: Draw samples from the motion

model (propagate forward)

§ Correction: Weight samples based on the

  • bservation model
slide-28
SLIDE 28

28

Monte Carlo Localization

§ Each particle is a pose hypothesis § Prediction: For each particle sample a new

pose from the the motion model

§ Correction: Weight samples according to

the observation model

[The weight has be chosen in exactly that way if the samples are drawn from the motion model]

slide-29
SLIDE 29

29

Monte Carlo Localization

§ Each particle is a pose hypothesis § Prediction: For each particle sample a new

pose from the the motion model

§ Correction: Weight samples according to

the observation model

§ Resampling: Draw sample with

probability and repeat times ( =#particles)

slide-30
SLIDE 30

30

MCL – Correction Step

Image Courtesy: S. Thrun, W. Burgard, D. Fox

slide-31
SLIDE 31

31

MCL – Prediction Step

Image Courtesy: S. Thrun, W. Burgard, D. Fox

slide-32
SLIDE 32

32

MCL – Correction Step

Image Courtesy: S. Thrun, W. Burgard, D. Fox

slide-33
SLIDE 33

33

MCL – Prediction Step

Image Courtesy: S. Thrun, W. Burgard, D. Fox

slide-34
SLIDE 34

34

Resampling

§ Draw sample with probability . Repeat times ( =#particles) § Informally: “Replace unlikely samples by more likely ones” § Survival-of-the-fittest principle § “Trick” to avoid that many samples cover unlikely states § Needed since we have a limited number of samples

slide-35
SLIDE 35

35

w2 w3 w1 wn Wn-1

Resampling

w2 w3 w1 wn Wn-1

§ Draw randomly

between 0 and 1

§ Binary search § Repeat J times § O(J log J) § Systematic resampling § Low variance § O(J) § Also called “stochastic

universal resampling”

step size = 1/J initial value between 0 and 1/J “roulette wheel” Assumption: normalized weights

slide-36
SLIDE 36

36

Low Variance Resampling

J = #particles step size = 1/J cumulative sum of weights decide whether or not to take particle i initialization

slide-37
SLIDE 37

37

initialization

Courtesy: Thrun, Burgard, Fox

slide-38
SLIDE 38

38

  • bservation

Courtesy: Thrun, Burgard, Fox

slide-39
SLIDE 39

39

weight update, resampling, motion update

Courtesy: Thrun, Burgard, Fox

slide-40
SLIDE 40

40

  • bservation

Courtesy: Thrun, Burgard, Fox

slide-41
SLIDE 41

41

weight update, resampling

Courtesy: Thrun, Burgard, Fox

slide-42
SLIDE 42

42

motion update

Courtesy: Thrun, Burgard, Fox

slide-43
SLIDE 43

43

  • bservation

Courtesy: Thrun, Burgard, Fox

slide-44
SLIDE 44

44

weight update, resampling

Courtesy: Thrun, Burgard, Fox

slide-45
SLIDE 45

45

motion update

Courtesy: Thrun, Burgard, Fox

slide-46
SLIDE 46

46

  • bservation

Courtesy: Thrun, Burgard, Fox

slide-47
SLIDE 47

47

weight update, resampling

Courtesy: Thrun, Burgard, Fox

slide-48
SLIDE 48

48

motion update

Courtesy: Thrun, Burgard, Fox

slide-49
SLIDE 49

49

  • bservation

Courtesy: Thrun, Burgard, Fox

slide-50
SLIDE 50

50

slide-51
SLIDE 51

51

Summary – Particle Filters

§ Particle filters are non-parametric, recursive

Bayes filters

§ The belief about the state is represented by

a set of weighted samples

§ The motion model is used to draw the

samples for the next time step

§ The weights of the particles are computed

based on the observation model

§ Resampling is carried out based on weights § Called: Monte-Carlo localization (MCL)

slide-52
SLIDE 52

52

Literature

§ Book: Probabilistic Robotics,

  • S. Thrun, W. Burgard, and D. Fox
slide-53
SLIDE 53

53

6D Localization for Humanoid Robots

slide-54
SLIDE 54

54

Localization for Humanoids

§ 3D environments require a 6D pose

estimate

height yaw, pitch, roll 2D position estimate the 6D torso pose

slide-55
SLIDE 55

55

Localization for Humanoids

§ Recursively estimate the distribution about

the robot‘s pose using MCL

§ Probability distribution represented by

pose hypotheses (particles)

§ Needed: Motion model and observation

model

slide-56
SLIDE 56

56

Motion Model

§ The odometry estimate corresponds to

the incremental motion of the torso

§ is computed from forward kinematics (FK)

from the current stance foot while walking

slide-57
SLIDE 57

57

Kinematic Walking Odometry

Frfoot Ftorso Fodom

fixed frame frame of the current stance foot frame of the torso, transform can be computed with FK over the right leg

§ Keep track of the transform to the current

stance foot, starting with the identity

slide-58
SLIDE 58

58

Kinematic Walking Odometry

Frfoot Ftorso Fodom Frfoot Ftorso Fodom

§ Both feet remain on the ground, compute

the transform to the frame of the left foot with FK

Frfoot Flfoot Ftorso Fodom

slide-59
SLIDE 59

59

Kinematic Walking Odometry

Frfoot Ftorso Fodom Frfoot Ftorso Fodom Frfoot Flfoot Ftorso Fodom

Flfoot Ftorso Fodom

§ The left leg becomes the stance leg and is

the new reference to compute the transform to the torso frame

slide-60
SLIDE 60

60

Kinematic Walking Odometry

§ Using FK, the poses of all joints and sensors

can be computed relative to the stance foot at each time step

§ The transform from the fixed world

frame to the stance foot is updated whenever the swing foot becomes the new stance foot

§ Concatenate the accumulated transform to

the previous stance foot and the relative transform to the new stance foot

slide-61
SLIDE 61

61

Odometry Estimate

§ Odometry estimate from two consecutive

torso poses

ut

slide-62
SLIDE 62

62

Odometry Estimate

§ The incremental motion of the torso is

computed from kinematics of the legs

§ Typically error sources: Slippage on the

ground and backlash in the joints

§ Accordingly, only noisy odometry

estimates while walking, drift accumulates

  • ver time

§ The particle filter has to account for

that noise within the motion model

slide-63
SLIDE 63

63

Motion Model

§ Noise modelled as a Gaussian with

systematic drift on the 2D plane

§ Prediction step samples a new pose

according to

§ learned with least squares optimization

using ground truth data (as in Ch. 2)

covariance matrix calibration matrix motion composition

slide-64
SLIDE 64

65

Sampling from the Motion Model

§ We need to draw samples from a

Gaussian

Gaussian

slide-65
SLIDE 65

66

How to Sample from a Gaussian

§ Drawing from a 1D Gaussian can be done in

closed form

Example with 106 samples

slide-66
SLIDE 66

67

How to Sample from a Gaussian

§ Drawing from a 1D Gaussian can be done in

closed form

§ If we consider the individual dimensions of

the odometry as independent, we can draw each dimension using a 1D Gaussian

draw each of the dimensions independently

slide-67
SLIDE 67

68

Sampling from the Odometry

§ We know how to sample from a Gaussian § We sample an own motion for each particle § We then incorporate the sampled

  • dometry into the pose of particle i

for each particle same distribution for each step

slide-68
SLIDE 68

69

Example for Sampled Motions in the 2D Plane

large angular error, small translational error small angular error, larger translational error robot poses according to estimated odometry samples drawn from Gaussian in motion model

slide-69
SLIDE 69

70

Motion Model

  • dometry (uncalibrated)

ground truth

uncalibrated motion model:

§ Resulting particle distribution (2000 particles) § Nao walking straight for 40cm

slide-70
SLIDE 70

71

Motion Model

  • dometry (uncalibrated)

ground truth

  • dometry (uncalibrated)

ground truth

uncalibrated motion model: calibrated motion model: properly captures drift, closer to the ground truth

slide-71
SLIDE 71

72

Observation Model

§ Observation consists of independent

range , height , and IMU (roll and pitch ) measurements

§ is computed from the values of the joint

encoders

§ and are provided by the IMU (inertial

measurement unit)

slide-72
SLIDE 72

73

Observation Model

Range data: Raycasting or endpoint model in 3D map

slide-73
SLIDE 73

74

Recap: Simplest Ray-Cast Model

§ Ray-cast models consider the first obstacle

along the ray

§ Compare the actually measured distance

with the expected distance

§ Use a Gaussian to evaluate the difference

measured distance

  • bject in map
slide-74
SLIDE 74

75

Recap: Beam-Endpoint Model

§ Evaluate the distance of the hypothetical

beam end point to the closest obstacle in the map with a Gaussian

Courtesy: Thrun, Burgard, Fox

slide-75
SLIDE 75

76

Observation Model

§ Range data: Ray-casting or endpoint model in 3D map § Torso height: Compare measured value from kinematics to predicted height (accord. to motion model) § IMU data: Compare measured roll and pitch to the predicted angles § Use individual Gaussians to evaluate the difference

slide-76
SLIDE 76

77

Likelihoods of Measurements

§ Gaussian distribution

standard deviation corresponding to noise characteristics

  • f joint encoders

and IMU computed from the height difference to the closest ground level in the map

slide-77
SLIDE 77
slide-78
SLIDE 78

79

Localization Evaluation

§ Trajectory of 5m, 10 runs each § Ground truth from external motion capture system § Raycasting results in significantly smaller error § Calibrated motion model requires fewer particles

slide-79
SLIDE 79

80

Trajectory and Error Over Time

slide-80
SLIDE 80

81

Trajectory and Error Over Time

slide-81
SLIDE 81

84

Summary

§ Estimation of the 6D torso pose (globally and local tracking) in a given 3D model § Odometry estimate from kinematic walking § Sample an own motion for each particle from a Gaussian § Use individual Gaussians in the observation model to evaluate the differences between measured and expected values § Particle filter allows to locally track and globally estimate the robot’s pose

slide-82
SLIDE 82

85

Literature

§ Chapter 3, Humanoid Robot Navigation in

Complex Indoor Environments,

Armin Hornung, PhD thesis, Univ. Freiburg, 2014

slide-83
SLIDE 83

86

Next Lecture

§ Inaugural lecture: Wed, May 20 at 5 p.m.,

lecture hall III on the university's main campus (talk in German, slides in English)

§ No lecture on Thu, May 21 § Lecture 6 of the course: Thu, June 11

slide-84
SLIDE 84

87

Acknowledgment

§ Previous versions of parts of the slides have

been created by Wolfram Burgard, Armin Hornung, and Cyrill Stachniss