Sample Based Motion Planning Robert Platt Northeastern University - - PowerPoint PPT Presentation

sample based motion planning
SMART_READER_LITE
LIVE PREVIEW

Sample Based Motion Planning Robert Platt Northeastern University - - PowerPoint PPT Presentation

Sample Based Motion Planning Robert Platt Northeastern University Problem we want to solve Given: a point-robot (robot is a point in space) description of obstacle space and free space a start configuration and goal region Find:


slide-1
SLIDE 1

Sample Based Motion Planning

Robert Platt Northeastern University

slide-2
SLIDE 2

Problem we want to solve

Starting configuration Goal configuration Given: – a point-robot (robot is a point in space) – description of obstacle space and free space – a start configuration and goal region Find: – a collision-free path from start to goal

slide-3
SLIDE 3

Problem we want to solve

Starting configuration Goal configuration Given: – configuration space – free space – start state – goal region Find: – a collision-free path , such that and

slide-4
SLIDE 4

Problem we want to solve

Given: – configuration space – free space – start state – goal region Find: – a collision-free path , such that and Assumptions: – the position of the robot can always be measured perfectly – the motion of the robot can always be controlled perfectly For example: think about a robot workcell in a factory...

slide-5
SLIDE 5

Key challenge: high dimensions and complex geometry of free space

None of the methods we have looked at so far scale well to manipulator path planning – e.g. a 6-DOF UR5 arm Methods studied so far: – visibility graphs – Voronoi diagrams – cell decomposition – potential functions

Only work for small num of obstacles Only work for small dimensional spaces Not complete

slide-6
SLIDE 6

6

Motion planning problem hardness

The general path planning problem is PSPACE-hard – pspace-hard in complexity of free space, e.g. measured by number of facets in total polyhedral obstacles – in the worst case, path planning requires solving an arbitrary difficult maze – complexity generally increases exponentially in the dimension of the configuration space – the best we can do is find anytime algorithms that solve “simple” problems quickly while retaining completeness for arbitrary problems

slide-7
SLIDE 7

7

Motion planning problem hardness

The general path planning problem is PSPACE-hard – pspace-hard in complexity of free space, e.g. measured by number of facets in total polyhedral obstacles – in the worst case, path planning requires solving an arbitrary difficult maze – complexity generally increases exponentially in the dimension of the configuration space – the best we can do is find anytime algorithms that solve “simple” problems quickly while retaining completeness for arbitrary problems Another key practical challenge: most of the methods above require a preprocessing step where workspace obstacles are projected into the configuration space – this is just as hard as the motion planning problem itself

slide-8
SLIDE 8

Simple PRM (sPRM)

slide-9
SLIDE 9

9

Simple PRM (sPRM)

free space local path milestone

slide-10
SLIDE 10

Simple PRM (sPRM)

slide-11
SLIDE 11

Simple PRM (sPRM)

SampleFree: sample a state from Near: return the set of vertices in G within radius r of v CollisionFree: check whether a line segment between v and u is completely within

slide-12
SLIDE 12

Question

For a fully connected graph created using sPRM parameterized by radius r, consider a vertex that is the nearest neighbor of another. What is the maximum distance between these two vertices?

slide-13
SLIDE 13

sPRM

What kind of graph does sPRM find?

slide-14
SLIDE 14

Question

What kind of graph does sPRM find? Does the graph become connected as n becomes large?

slide-15
SLIDE 15

sPRM

What kind of graph does sPRM find? Does the graph become connected as n becomes large? https://www.youtube.com/watch?v=twjnAE3SjJw

slide-16
SLIDE 16

Question

What kind of graph does sPRM find? Does the graph become connected as n becomes large? For sPRM, express the number of edges in the graph as a function of n as n goes to infinity: Volume of unit ball in d dim

slide-17
SLIDE 17

17

Probabilistic completeness of PRM

SPRM is not complete: not guaranteed to find a solution for any finite value of n However, it is probabilistically complete in the following sense:

Finds a path with probability 1 as the number of vertices increases as long as such a path if robustly feasible

slide-18
SLIDE 18

18

Probabilistic completeness of PRM

SPRM is not complete: not guaranteed to find a solution for any finite value of n However, it is probabilistically complete in the following sense:

Finds a path with probability 1 as the number of vertices increases as long as such a path if robustly feasible

Infinite monkey theorem: A monkey typing keys randomly on a keyboard will produce any given text (the works of William Shakespeare) with probability one.

slide-19
SLIDE 19

19

Probabilistic completeness of PRM

Probability of not finding a solution to a robustly feasible problem decreases exponentially with the number of vertices

slide-20
SLIDE 20

Optimality

Recall: Cost: cost of path Cost of min cost path found by the algorithm Optimal cost

slide-21
SLIDE 21

Optimality of sPRM

K-nearest sPRM is variation where connect vertices w/ k-NN instead of neighbors within radius

slide-22
SLIDE 22

PRM*

Problem w/ sPRM: number of edges grows nearly quadratically with the number of edges Num NEAR vertices grows linearly w/ n Idea: reduce the connection radius as the number of vertices grows – BUT: if you do it too quickly, the graph becomes asymptotically disconnected

slide-23
SLIDE 23

PRM*

Idea: set r to exactly Recall: Technically, we need to adjust r for the volume of obstacles: Volume of unit ball in d dim

slide-24
SLIDE 24

PRM*

PRM* adds a constant number of edges on each step, but remains asyptotically optimal

slide-25
SLIDE 25

PRM sampling strategies

Can we do better with a smarter sampling strategy?

slide-26
SLIDE 26

PRM sampling strategies

Problem: it may take a lot of samples to reach a fully connected graph

slide-27
SLIDE 27

PRM sampling strategies

Let’s think about the “online” version of algorithm

slide-28
SLIDE 28

PRM sampling strategies

Let’s think about the “online” version of algorithm

slide-29
SLIDE 29

Resampling

Idea: expand vertices that are close to obstacles

  • 1. Sample a vertex to expand

– select vertices for which many link failures have

  • ccurred
  • 2. Pick a random motion direction in c-space and move in this

direction until an obstacle is hit.

  • 3. When a collision occurs, choose a new random direction and

proceed for some distance.

  • 4. Add the resulting nodes and edges to the tree. Re-run tree

connection step. Expand nodes w/ prob: Where:

slide-30
SLIDE 30

30

Resampling (expansion)

slide-31
SLIDE 31

31

So far, we have only discussed uniform sampling... Problem: uniform sampling is not a great way to find paths through narrow passageways.

start goal C-obst C-obst C-obst C-obst

PRM Roadmap

Gaussian sampler

slide-32
SLIDE 32

32

Gaussian sampler

Gaussian sampler:

  • 1. Sample points uniformly at random (as before)
  • 2. For each sampled point, sample a second point

from a Gaussian distribution centered at the first sampled point

  • 3. Discard both samples if both samples are either

free or in collision

  • 4. Keep the free sample if the two samples are NOT

both free or both in collision (that is, keep the sample if the free/collision status of the second sample is different from the first).

slide-33
SLIDE 33

33

Gaussian sampler

Probability of sampling a point under the Gaussian sampler as a function of distance from a c-space obstacle Example of samples drawn from Gaussian sampler

slide-34
SLIDE 34

34

Lazy PRM Precomputation: roadmap construction

  • Nodes

– Randomly chosen configurations, which may or may not be collision-free – No call to CLEAR

  • Edges

– an edge between two nodes if the corresponding configurations are close according to a suitable metric – no call to LINK

Lazy PRM

Single query problem: you are only interested in connecting start and goal

  • configurations. Don’t care about cull connectivity of the map.

Lazy PRM idea: only check edges that could potentially be on the shortest path through the graph.

slide-35
SLIDE 35

35

Lazy PRM

  • 1. Find a shortest path in the roadmap
  • 2. Check whether the nodes and

edges in the path are free.

  • 3. If yes, then done. Otherwise,

remove the nodes or edges in

  • violation. Go to (1).

We either find a collision-free path, or exhaust all paths in the roadmap and declare failure. Query processing:

Using UCS or A*

slide-36
SLIDE 36

Rapidly Exploring Random Trees (RRTs)

Problems with PRM: – two steps: graph construction, then graph search – hard to apply to problems where edges are directed, i.e. kinodynamic problems RRTs solve both of these problems: – create a tree instead of graph: no graph search needed! – tree rooted at start or goal – edges can be directed

slide-37
SLIDE 37

RRT Algorithm

slide-38
SLIDE 38

RRT Algorithm

slide-39
SLIDE 39

RRT Algorithm

slide-40
SLIDE 40

RRT Algorithm

slide-41
SLIDE 41

RRT Algorithm

slide-42
SLIDE 42

RRT Algorithm

slide-43
SLIDE 43

RRT Algorithm

slide-44
SLIDE 44

RRT versus a naïve random tree

Growing the naïve random tree:

  • 1. pick a node at random
  • 2. sample a new node near it
  • 3. grow tree from random node to

new node RRT Naïve random tree

slide-45
SLIDE 45

RRTs and Bias toward large Voronoi regions

http://msl.cs.uiuc.edu/rrt/gallery.html

slide-46
SLIDE 46

Biases

  • Bias toward larger spaces
  • Bias toward goal

 When generating a random sample, with some

probability pick the goal instead of a random node when expanding

 This introduces another parameter  5-10% is probably the right choice

slide-47
SLIDE 47

47

RRT probabilistic completeness

Notice that this is exactly the same bound as for sPRM.

slide-48
SLIDE 48

RRT does not find optimal paths

slide-49
SLIDE 49

Is there a version of RRT that is optimal?

Don’t just connect to Attempt to connect to every vertex within a radius r Use same variable radius as in PRM* Yes: RRG and RRT*

slide-50
SLIDE 50

RRG Properties

RRG is complete … how do you know?

slide-51
SLIDE 51

RRG Properties

RRG is complete … how do you know?

slide-52
SLIDE 52

RRG Properties

RRG is complete … how do you know? But, why might RRT still be preferable to RRG?

slide-53
SLIDE 53

RRT* Algorithm

Don’t just connect to Attempt to connect to every vertex within a radius r Use same variable radius as in PRM* Get position and cost

  • f min-cost vertex in

Rewire parents of nodes in to go through if that’s faster

slide-54
SLIDE 54

RRT* Algorithm

slide-55
SLIDE 55

RRT* Algorithm

RRT* is complete … how do you know?

slide-56
SLIDE 56

Bidirectional RRT (RRT Connect)

slide-57
SLIDE 57

Bidirectional RRT (RRT Connect)

RRT_CONNECT (qinit, qgoal) { Ta.init(qinit); Tb.init(qgoal); for k = 1 to K do qrand = RANDOM_CONFIG(); if (qnew= EXTEND(Ta, qrand) == Reached) then if (EXTEND(Tb, qnew) == Reached) then Return PATH(Ta, Tb); SWAP(Ta, Tb); Return Failure; }

Instead of switching, use Ta as smaller tree.

slide-58
SLIDE 58

qinit qgoal A single RRT-Connect iteration...

slide-59
SLIDE 59

qinit qgoal 1) One tree grown using random target

slide-60
SLIDE 60

qinit qgoal qtarget 2) New node becomes target for other tre

slide-61
SLIDE 61

qinit qgoal qtarget qnear 3) Calculate node “nearest” to target

slide-62
SLIDE 62

qinit qgoal qnew qtarget qnear 4) Try to add new collision-free branch

slide-63
SLIDE 63

qinit qgoal qnew qtarget qnear 5) If successful, keep extending branch

slide-64
SLIDE 64

qinit qgoal qnew qtarget qnear 5) If successful, keep extending branch

slide-65
SLIDE 65

qinit qgoal qnew qtarget qnear 5) If successful, keep extending branch

slide-66
SLIDE 66

qinit qgoal qnear 6) Path found if branch reaches target

slide-67
SLIDE 67

qinit qgoal 7) Return path connecting start and goal

slide-68
SLIDE 68

Bidirectional RRT (RRT Connect)

Is bi-directional RRT always better?

slide-69
SLIDE 69

Kinodynamic planning with RRTs

So far, we have assumed that the system has no dynamics – the system can instantaneously move in any direction in c-space – but what if that's not true??? Consider the Dubins car: – c-space: x-y position and velocity, angle – control forward velocity and steering angle – plan a path through c-space with the corresponding control signals where: x_t – state (x/y position and velocity, steering angle) u_t – control signal (forward velocity, steering angle)

slide-70
SLIDE 70

Kinodynamic planning with RRTs

But, what if x_{near} isn't the right node to expand ???

slide-71
SLIDE 71

So, what do they do?

  • Use nearest neighbor anyway
  • As long as heuristic is not bad, it helps

(you have already given up completeness and optimality, so what the heck?)

  • Nearest neighbor calculations begin to

dominate the collision avoidance

  • Remember K-D trees
slide-72
SLIDE 72

Left-turn only forward car

slide-73
SLIDE 73

Hovercraft with 2 Thusters

slide-74
SLIDE 74

Path Smoothing

Paths produced by sample based planners are generally not smooth – RRT* and PRM* converge to optimal paths in the limit, but it’s generally not possible to run these algorithms long enough to converge.

slide-75
SLIDE 75

75

Smoothing the path

slide-76
SLIDE 76

76

Smoothing the path

slide-77
SLIDE 77

77

Smoothing the path

slide-78
SLIDE 78

78

Smoothing the path

slide-79
SLIDE 79

79

Smoothing the path

slide-80
SLIDE 80

80

Smoothing the path

slide-81
SLIDE 81

81

Smoothing the path

slide-82
SLIDE 82

82

Smoothing the path

slide-83
SLIDE 83

83

Smoothing the path

slide-84
SLIDE 84

84

Smoothing the path

slide-85
SLIDE 85

85

Smoothing the path

slide-86
SLIDE 86

86

Smoothing the path