World Maps and Localization 15-494 Cognitive Robotics David S. - - PowerPoint PPT Presentation

world maps and localization
SMART_READER_LITE
LIVE PREVIEW

World Maps and Localization 15-494 Cognitive Robotics David S. - - PowerPoint PPT Presentation

World Maps and Localization 15-494 Cognitive Robotics David S. Touretzky & Ethan Tira-Thompson Carnegie Mellon Spring 2010 02/15/10 15-494 Cognitive Robotics 1 Frames of Reference camera world ground local Camera frame: what


slide-1
SLIDE 1

02/15/10 15-494 Cognitive Robotics 1

World Maps and Localization

15-494 Cognitive Robotics David S. Touretzky & Ethan Tira-Thompson Carnegie Mellon Spring 2010

slide-2
SLIDE 2

02/15/10 15-494 Cognitive Robotics 2

Frames of Reference

  • Camera frame: what the robot sees.
  • projectToGround() = kinematics + planar world

assumption.

  • Local map assembled from camera frames each

projected to ground; robot moves head but not body.

  • World map assembled from local maps built at different

spots in the environment.

camera ground world local

slide-3
SLIDE 3

02/15/10 15-494 Cognitive Robotics 3

Four Shape Spaces

  • camShS = camera space
  • groundShS = camera shapes projected to ground plane
  • localShS = body-centered (egocentric space);

constructed by matching and importing shapes from groundShS

  • worldShS = world space (allocentric space);

constructed by matching and importing shapes from localShS

  • The robot is explicitly represented in worldShS
slide-4
SLIDE 4

02/15/10 15-494 Cognitive Robotics 4

Deriving the Local Map

1) MapBuilder extracts shapes from the camera frame

– Use a request of type MapBuilderRequest::cameraMap if you

want to stop here and just get camera-space shapes.

2) MapBuilder does projectToGround()

– Use MapBuilderRequest::groundMap if you want to stop here and

just get ground shapes from the current camera frame.

3) MapBuilder matches ground shapes against local shapes.

– Request type should be MapBuilderRequest::localMap

4) MapBuilder moves to the next gaze point and repeats.

– The world is assumed not to change during this process.

slide-5
SLIDE 5

02/15/10 15-494 Cognitive Robotics 5

Deriving the World Map

  • The local map covers only what the robot can see from a

single viewing position.

  • The world map can cover much larger territory.

– Use MapBuilderRequest::worldMap

  • The world map persists over a long time period.

– The world will change. Updates must be possible.

  • We update the world map by:

– Constructing a local map. – Aligning it with the world map (by translation and rotation) – Importing shapes from the local map. – Noting additions and deletions since the last local map match.

slide-6
SLIDE 6

02/15/10 15-494 Cognitive Robotics 6

Localization

  • How do we align the local map with the world map?
  • This turns out to be equivalent to determining our

position and orientation on the world map.

  • Tricky, because:

– The local map is noisy – The environment can be ambiguous (multiple pink landmarks)

  • Sensor model: describes the uncertainty in our sensor

measurements.

– Can mix sensor types (vision, IR), info types (bearing, distance)

slide-7
SLIDE 7

02/15/10 15-494 Cognitive Robotics 7

SLAM

  • Simultaneous Localization and Mapping
  • When is this necessary?

– When we don't know the map in advance. – When the world is changing (landmarks can appear or

disappear, or change location.)

– When we're moving through the world.

  • How do we localize on a map that we are still in the

process of building?

  • Motion model: estimates (by odometry) our motion

through the environment.

slide-8
SLIDE 8

02/15/10 15-494 Cognitive Robotics 8

Particle Filtering

  • A technique for searching large, complex spaces.
  • What is the hypothesis space we need to search?

– Robot's position (x,y) – Robot's orientation θ – Which world space shapes have disappeared since last update? – What new shapes have appeared in local space?

  • Each particle encodes a point in the hypothesis space.
  • How can we evaluate hypotheses?

– Use sensor and motion models to update particle weights

slide-9
SLIDE 9

02/15/10 15-494 Cognitive Robotics 9

Ranking a Particle: 1-D Case

Local map World map Hypothesis: dx = 18 Match hypothesis Poor match

slide-10
SLIDE 10

02/15/10 15-494 Cognitive Robotics 10

Ranking a Particle: 1-D Case

Local map World map Hypothesis: dx = 56 Match hypothesis Good match

slide-11
SLIDE 11

02/15/10 15-494 Cognitive Robotics 11

Matching a Landmark

Gaussian probability distribution: a sensor model World Local

slide-12
SLIDE 12

02/15/10 15-494 Cognitive Robotics 12

Pick the Best Candidate

Local map World map Hypothesis: dx = 56 Local map Good match Match each local landmark against the closest world landmark of the same type and color. Score with a gaussian.

slide-13
SLIDE 13

02/15/10 15-494 Cognitive Robotics 13

Matching a Set of Landmarks

Gx ,x0 = exp[ −x−x0

2

2

]

Ps∈L,t∈W∣h = GL.sh, W.t Ps∈L∣W ,h=maxt∈WPs∈L,t∈W∣h Ph = ∏

s∈L

Ps∣W ,h

  • Take the product of the match probabilities of the

individual landmarks:

  • Allow penalty terms for addition, deletion.

L.s = coordinate of shape s in Local map W.t = coordinate of shape t in World map h = location hypothesis

slide-14
SLIDE 14

02/15/10 15-494 Cognitive Robotics 14

Addition Penalty

  • A shape in the local map that isn't in the world map must

be accounted for as an addition.

  • Assess a penalty on P(h) for each addition, but remove

that shape from the product term for P(h) so the product doesn't go to zero.

World map Local map

slide-15
SLIDE 15

02/15/10 15-494 Cognitive Robotics 15

Deletion Penalty

  • A shape in the world map that should be visible in the

local map but isn't must be accounted for as a deletion.

  • Assess a penalty on P(h) for each deletion, but remove

that shape from the product term for P(h) so the product doesn't go to zero.

World map Local map

slide-16
SLIDE 16

02/15/10 15-494 Cognitive Robotics 16

What Shapes Should be Visible?

  • Take bounding box of shapes in local space.
  • All shapes within that box should be visible in world

space.

Local map World map

slide-17
SLIDE 17

02/15/10 15-494 Cognitive Robotics 17

When Objects Move

  • If an object moves only a little bit, it will still match, and

the position will be updated.

  • If an object moves by a larger amount, we'll get:

– An object deletion at the old location – An object addition at the new location

  • Could watch for this and combine both changes into a

single “move” penalty.

  • If h is a poor hypothesis, then every object will appear to

have “moved”.

slide-18
SLIDE 18

02/15/10 15-494 Cognitive Robotics 18

Importance Sampling

  • For each particle h, calculate the probability P(h)
  • Create a new generation of particles by resampling from

the previous population:

– Particles with high probability should be more likely to be

sampled, and will therefore multiply.

– Particles with low probability likely won't be sampled, and will

therefore probably die out.

  • The new particle's parameters are “jiggled” a little bit.

This is how we search the space.

  • Repeat this resampling process for several generations.
slide-19
SLIDE 19

02/15/10 15-494 Cognitive Robotics 19

Jiggling a Particle

  • Perturb the translation term (x, y)
  • Perturb the orientation term θ
  • Flip the state of an “addition” bit: one bit for each local

shape

– A value of 1 means this is a new addition to the world.

  • Flip the state of a “deletion” bit: one bit for each world

shape.

– A value of 1 means this world shape has been deleted.

slide-20
SLIDE 20

02/15/10 15-494 Cognitive Robotics 20

So What's In A Particle?

float dx, dy; AngTwoPi orientation; vector<bool> additions(numLocalShapes, false); vector<bool> deletions(numWorldShapes, false);

Parameters to adjust:

– Number of particles (2000) – Number of generations (15) – Amount of noise to add to dx, dy, θ – Probability of flipping an add or delete bit

slide-21
SLIDE 21

02/15/10 15-494 Cognitive Robotics 21

Particle Filter Simulation: 2000 Particles

Zero Iterations World Map

Rotated Local Map

slide-22
SLIDE 22

02/15/10 15-494 Cognitive Robotics 22

Particle Filter Simulation

One Iteration World Map

Rotated Local Map

+ means addition x means deletion  means match

slide-23
SLIDE 23

02/15/10 15-494 Cognitive Robotics 23

Particle Filter Simulation

Five Iterations World Map

Rotated Local Map

+ means addition x means deletion means match

slide-24
SLIDE 24

02/15/10 15-494 Cognitive Robotics 24

Particle Filter Simulation

Fifteen Iterations World Map

Rotated Local Map

+ means addition x means deletion means match

slide-25
SLIDE 25

02/15/10 15-494 Cognitive Robotics 25

Local and World Maps

  • n the Robot

Local Map World Map

slide-26
SLIDE 26

02/15/10 15-494 Cognitive Robotics 26

Localization After Movement

Local Map World Map

slide-27
SLIDE 27

02/15/10 15-494 Cognitive Robotics 27

Construct World Map

Three pieces on the board. Let's delete one.

slide-28
SLIDE 28

02/15/10 15-494 Cognitive Robotics 28

Delete a Game Piece

Actual change: dx = 0 mm, dy = 0 mm, θ = 0o, delete shape 30005 Particle filter: dx = 9 mm, dy = 13 mm, θ = -0.2o, delete shape 30005

slide-29
SLIDE 29

02/15/10 15-494 Cognitive Robotics 29

Construct World Map

Three pieces on the board. Let's add one.

slide-30
SLIDE 30

02/15/10 15-494 Cognitive Robotics 30

Add a Game Piece

Actual change: dx = 0 mm, dy = 0 mm, θ = 0o, add shape 20006 Particle filter: dx = 2 mm, dy = -.5 mm, θ = -0.6o, add shape 20006

slide-31
SLIDE 31

02/15/10 15-494 Cognitive Robotics 31

Construct World Map

Four pieces on the board. Let's move, add, and delete.

slide-32
SLIDE 32

02/15/10 15-494 Cognitive Robotics 32

Change Position and Add/Delete

Actual change: dx = 670 mm, dy = -260 mm, θ = 45o, add 20011, del. 30010 Particle filter: dx = 678 mm, dy = -306 mm, θ = 42o, add 20011, del. 30010

slide-33
SLIDE 33

02/15/10 15-494 Cognitive Robotics 33

Another Particle Filter Demo

Set up a world with three landmarks (worldShS):

slide-34
SLIDE 34

02/15/10 15-494 Cognitive Robotics 34

#nodeclass ParticleDemo : VisualRoutinesBehavior : DoStart // Build the world map NEW_SHAPE(orange1, EllipseData, new EllipseData(worldShS,Point(35,-50,0,allocentric),27.5,27.5));

  • range1->setColor(“orange”);

NEW_SHAPE(orange2, EllipseData, new EllipseData(worldShS,Point(135,-50,0,allocentric),27.5,27.5));

  • range2->setColor(“orange”);

NEW_SHAPE(green1, EllipseData new EllipseData(worldShS,Point(135,-150,0,allocentric),27.5,27.5)); green1->setColor(“green”);

slide-35
SLIDE 35

02/15/10 15-494 Cognitive Robotics 35

Move to New Location and Use MapBuilder to Look Around

Results are constructed in localShS:

slide-36
SLIDE 36

02/15/10 15-494 Cognitive Robotics 36

// Build a local map from what we can see #nodeclass BuildMap : MapBuilderNode(MapBuilderRequest::localMap) : DoStart localShS.clear(); NEW_SHAPE(gazePoly, PolygonData, new PolygonData(localShS, Lookout::groundSearchPoints(), false)); mapreq.searchArea = gazePoly; mapreq.doScan = true; mapreq.pursueShapes = true; mapreq.maxDist = 2000; mapreq.clearShapes = false; // to preserve gazePoly mapreq.addObjectColor(ellipseDataType,”orange”); mapreq.addObjectColor(ellipseDataType,”green”); #endnodeclass

slide-37
SLIDE 37

02/15/10 15-494 Cognitive Robotics 37

Use Particle Filter to Localize

  • n the World Map
slide-38
SLIDE 38

02/15/10 15-494 Cognitive Robotics 38

BiColor Markers

slide-39
SLIDE 39

02/15/10 15-494 Cognitive Robotics 39

LookForBiColorMarkers Demo

slide-40
SLIDE 40

02/15/10 15-494 Cognitive Robotics 40

FourCorners Demo