simultaneous localization & mappingoccupancy grid mapping • measurement : m x,y = 1 lidar hit...

49
Simultaneous Localization & Mapping F1/10 th Autonomous Racing Paril Jain

Upload: others

Post on 28-Mar-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Simultaneous Localization & Mapping

F1/10th Autonomous Racing

Paril Jain

Page 2: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Previous Week

2

IMU and LIDAR

Localization PID Control

Page 3: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Limitations : Basic Path Planning

• High Level Path Assignments

– 2nd right, 2nd right, 1st right, 1st left, 1st right

3

Page 4: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Race Lines

4

Page 5: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Limitations : No Future Information

5

Page 6: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

System Overview

6

Mapping

Localization

Path Planning

Control

Page 7: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

System Overview

7

Hector SLAMMapping

Localization

Path Planning

Control

Page 8: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

SLAM : A Chicken-Egg problem

8

MA

P

LOCALIZATION

LOCALIZATION

MA

P

Page 9: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Overview of SLAM

9

Page 10: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Video provided separately

• Car running in corridor

• Map being generated

• Video will be used for explaining the overview

10

Page 11: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

11

Occupied Cell

Free Cell

Un-Explored Cell

Measurement Model

Page 12: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

• Measurement :

mx,y = 1 LiDAR hit

mx,y = 0 No occlusion

12

Occupied Cell

Free Cell

Un-Explored Cell

Measurement Model

Page 13: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

• Measurement :

mx,y = 1 LiDAR hit

mx,y = 0 No occlusion

13

Occupied Cell

Free Cell

Un-Explored Cell • Map Cell:

Z = 1 Occupied

Z = 0 UnExplored

Z = -1 Free

Measurement Model

Page 14: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

• Measurement :

mx,y = 1 LiDAR hit

mx,y = 0 No occlusion

14

Occupied Cell

Free Cell

Un-Explored Cell • Map Cell:

Z = 1 Occupied

Z = 0 UnExplored

Z = -1 Free

• Measurement Model :

Measurement Model

Page 15: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

15

Occupied Cell

Free Cell

Un-Explored Cell

Log Probability for occupied cells Log Probability for free cells

Page 16: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

Map Update :

• Cells with z = 1:

o log odd = log odd + log odd_occ

• Cells with z = -1:

o log odd = log odd - log odd_free

Page 17: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

17

Map Update :

• Cells with z = 1:

o log odd = log odd + log odd_occ

• Cells with z = -1:

o log odd = log odd - log odd_free

• Threshold the cell values by upper /lowerlimit to avoid being

completely certain

Page 18: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

18

Map Update :

• Cells with z = 1:

o log odd = log odd + log odd_occ

• Cells with z = -1:

o log odd = log odd - log odd_free

• Threshold the cell values by upper /lowerlimit to avoid being

completely certain

0.5

1

log odds probability

Page 19: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Occupancy Grid Mapping

19

Map Update :

• Cells with z = 1:

o log odd = log odd + log odd_occ

• Cells with z = -1:

o log odd = log odd - log odd_free

• Threshold the cell values by upper /lowerlimit to avoid being

completely certain

0.5

1

log odds probability

Saturation Limit

Page 20: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Registering the first Scan

20

Page 21: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Registering the first Scan

21

Page 22: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

22

Laser Scans w.r.t car at Time t = t1

Pose of the Car at t = t1

Page 23: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

23

Laser Scans w.r.t car at Time t = t1 Laser Scans w.r.t car at Time t = t2

Pose of the Car at t = t1

Page 24: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

24

Laser Scans w.r.t car at Time t = t1 Laser Scans w.r.t car at Time t = t2

Pose of the Car at t = t1 Pose of the Car at t=t2

Page 25: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

25Source : Mathworks – File Exchange : Iterative Closest Point Package

Iterative Closest Point

Page 26: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

26Source : Mathworks – File Exchange : Iterative Closest Point Package

• Minimize Root Mean Squared

Distance between Point Clouds

Iterative Closest Point

Page 27: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

27Source : Mathworks – File Exchange : Iterative Closest Point Package

• Minimize Root Mean Squared

Distance between Point Clouds

• Find R & T matrix for transformed

Point Cloud w.r.t original cloud.

Iterative Closest Point

𝑅, 𝑇 = argmin𝑅,𝑇

2

𝑖=1

𝑛

𝑑𝑖𝑠𝑡(𝑅 ∗ 𝑅𝑒𝑑i + 𝑇, 𝐵𝑙𝑢𝑒𝑖)2

Page 28: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

28Source : Mathworks – File Exchange : Iterative Closest Point Package

• Minimize Root Mean Squared

Distance between Point Clouds

• Find R & T matrix for transformed

Point Cloud w.r.t original cloud.

Iterative Closest Point

𝑅, 𝑇 = argmin𝑅,𝑇

2

𝑖=1

𝑛

𝑑𝑖𝑠𝑡(𝑅 ∗ 𝑅𝑒𝑑i + 𝑇, 𝐵𝑙𝑢𝑒𝑖)2

Page 29: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan Matching

29Source : Mathworks – File Exchange : Iterative Closest Point Package

• Minimize Root Mean Squared

Distance between Point Clouds

• Find R & T matrix for transformed

Point Cloud w.r.t original cloud.

Iterative Closest Point

𝑅, 𝑇 = argmin𝑅,𝑇

2

𝑖=1

𝑛

𝑑𝑖𝑠𝑡(𝑅 ∗ 𝑅𝑒𝑑i + 𝑇,𝐵𝑙𝑢𝑒𝑖)2

Page 30: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

S2

S1

y

x

30

Page 31: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

S2

S1

y

x

31

Robot Pose

Page 32: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

S2

S1

Impact coordinates of ith scan in world frame

Total of n scans

y

x

32

Robot Pose

Page 33: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

S2

S1

Map Value at

coordinates given by Si

Impact coordinates of ith scan in world frame

Total of n scans

y

x

33

Robot Pose

Page 34: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

34

Page 35: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

35

Taylor Expansion of

Function M

Page 36: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

36

Taylor Expansion of

Function M

Page 37: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scan matching: Hector Slam

37

Taylor Expansion of

Function M

Solving for ∆ξ yields

Gauss-Newton

Equation

Evaluation of Gauss-Newton equation gives a

step ∆ξ that minimizes the objective function

Page 38: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Raw LiDAR Scans

38Baseframe Axes

Page 39: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Scans after transforming by ∆ξ at each

stage

39Mapframe Axes

Page 40: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Map Update

40

Page 41: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Multi-Resolution Map Representation

41

20 cm Grid Cell 10 cm Grid Cell 5 cm Grid Cell

Page 42: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Saving the map

42

Page 43: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Saving the map

43

• ROS Package called

MAP Server

• Allows saving a map currently being

published over /map topic

• Save the map:rosrun map_server map_saver [-f mapname]

• Load the map:

rosrun map_server map_server <name.yaml>

Page 44: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Odometry Using Hector Mapping

44

Page 45: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Odometry Using Hector Mapping

• Using Hector Slam for measuring ∆ξ, while discarding the map

45

Page 46: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Odometry Using Hector Mapping

• Using Hector Slam for measuring ∆ξ, while discarding the map

• Optional Approach : CSM (Canonical Scan Matcher) by Andrea

Censi

– Scan matching between 2 scans 46

Page 47: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

System Tf tree

47

Map Frame

Odom Frame

Base Frame

Laser Frame

Tf Provided by

Hector dometry

Tf required by

Hector package

Page 48: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Parameters for Hector SLAM : ROS

• map resolution - Grid resolution

• map_update_distance_thresh - minimum distance to be travelled before

having a map update

• map_update_angle_thresh - minimum angle to be travelled before a

map update

• laser_max_dist - Laser sensor specification

• update_factor_free - Log odds probability for occupied cells

• update_factor_occupied - Log odds probability for free cells

48

Page 49: Simultaneous Localization & MappingOccupancy Grid Mapping • Measurement : m x,y = 1 LiDAR hit m x,y = 0 No occlusion 13 Occupied Cell Free Cell Un-Explored Cell • Map Cell: Z =

Next Lecture

• Using the map generated today

• Localizing using Adaptive Monte Carlo localization (AMCL)

• Integrating hector odometry and AMCL

49