CMU-Q 15-381
Lecture 4: Path Planning
Teacher: Gianni A. Di Caro
CMU-Q 15-381 Lecture 4: Path Planning Teacher: Gianni A. Di Caro - - PowerPoint PPT Presentation
CMU-Q 15-381 Lecture 4: Path Planning Teacher: Gianni A. Di Caro A PPLICATION : M OTION P LANNING Path planning: computing a continuous sequence (a path) of configurations (states) between an initial configuration (start) and a final
Teacher: Gianni A. Di Caro
2
§ Path planning: computing a continuous sequence (“a path”) of configurations (states) between an initial configuration (start) and a final configuration (goal) in a physical environment
limitations in rotations and translations)
§ Trajectory planning: pp + time parameter (→ velocity profile) goal start
3
Kia car factory
4
§ Let’s consider an omnidirectional point “agent” § Let’s discretize the free world representing it into a graph § Let’s search for a (discrete) path in the graph § Let the world be static § Let the cost be the length of the path § Let’s forget about time and velocity
Combinatorial planning
Roadmap graphs We have the entire graph
(A* vs. Dijkstra ?) The graph can be huge depending on discretization
5
Baldur’s gate Mario AI Competition
https://www.youtube.com/watch?v=DlkMs4ZHHr8
6
§ The continuous world is covered by a discrete set of cells § How to make the coverage? First guess: a grid § Mark cells that intersect obstacles as blocked, free otherwise § The motion through a cell happens through its center § Each cell has n=8 neighbors § Find path through centers of free cells
Which are the nodes and the edges of the roadmap graph?
Is cell decomposition Complete? Optimal?
The shortest path through cell centers is the optimal path on the graph! The way we perform decomposition matters for completeness!
7
§ How many cells (vertices, edges) do we need? § Mobile planar robot moving in an area of 100 𝑛% § We want cm-level precision: 100 & 100 % = 100 & 10( cells § If the robot moves in the 3D space 100 & 100 ) = 1 & 10*% cells! § Articulated robots move in 3D spaces and have multiple dimensions (one for each joint) … § We need to find smart ways to define the grid, and, in general to trade some precision off
8
§ Distinguish between
§ Iterate: If no path found, subdivide the cells intersecting obstacles § Any n-tree decomposition can be used (e.g., quad- / oct-trees) § High resolution (# cells) only where needed, save on states
9
§ A path planning algorithm is resolution complete when: a. If a path exists, it finds it in finite time b. If a path does not exist, it returns in finite time Cell decomposition satisfies: 1. a but not b 2. b but not a 3. Both a and b 4. Neither a nor b
10
Reduce distance distortion Small area / Large perimeter
§ Cells can have different shapes
§ Cells’ centers can be replaced by edges or vertices
More flexibility for local motion
§ Navigation inside a cell can be done in many different ways
11
§ Meshes can be used instead of uniform cells
12
Shortest paths through cell centers Shortest path
A* is complete and optimal: it will find the shortest path, on the road map graph, moving between neighbor nodes
A shortest path on the road map graph is not equivalent to a shortest path in the continuous environment!
13
Moves and step costs § Node id § (𝑦, 𝑧) coordinates on the grid § -cost § ℎ-cost = Obstacle-free distance
§ Cost 𝑔 = + ℎ § Parent node id § Free / Obstruction node § Explored / Frontier / Unseen Node data structure Start Goal Current Obstruction (cur) = 20, ℎ(cur) = 48 𝑔(cur) = 68 Note: The graph is given
14
15
Select node with least 𝑔
16
Select node with least 𝑔 Resolve ties considering least ℎ
17
Keep going …
18
𝑔 increases along any expanded path from start to goal No node with 𝑔 > 𝑔 ∗ is expanded A number of nodes with 𝑔 = 𝑔 ∗ have been expanded
19
§ This is one-query: from a specific start to a destination § What if, we keep the destination fixed and try to be ready to answer queries from any starting state? § IF we have enough time, we can compute the distance to the goal from any starting state … § All collision-free 4 neighbors are given a cost of 1 § Iterative wave front construction § Follow the “downhill” path!
20
Key observation:
space (in the real world)
Allow connections to further states than neighbors on the graph!
21
A shortest path through cell centers Shortest path
What is left are only the navigation points that go around the corners of obstacles (not in line-of-sight)
Smoothed shortest path
22
A shortest path through cell centers Shortest path
Even going through a different direction doesn’t help to find the (real-world) optimal path!
A* can have many turns, it doesn’t look realistic
23
§ Idea: Allow parents that are non-neighbors in the graph to be used during search, looking backward. In Post Smoothing this kind of process is done on the final path, in Theta* while the path is built § Standard A*
𝑔 𝑧 = (𝑦) + 𝑑(𝑦, 𝑧) + ℎ(𝑧) § Theta*
𝑔(𝑧) = (parent(𝑦)) + 𝑑(parent(𝑦),𝑧) + ℎ(𝑧)
to iterate, if possible
parent(𝑦) 𝑦 𝑧
24
Each vertex is labeled with its g-value and an arrow pointing to its parent
The hollow circle indicates the vertex being expanded goal
25
Theta* path, likely J Shortest path
26
http://www.jair.org/media/2994/live-2994-5259-jair.pdf
http://aigamedev.com/open/tutorials/theta-star-any-angle-paths/
27
§ Polygonal path: sequence of connected straight lines § Inner vertex of polygonal path: vertex that is not beginning or end § Theorem: Assuming polygonal
polygonal path whose inner vertices are vertices of obstacles
28
§ Suppose for contradiction that shortest path is not polygonal § Obstacles are polygonal ⇒ ∃ point 𝑞 in interior of free space such that “(shortest) path through 𝑞 is curved” § 𝑞 in free space ⇒ ∃ disc of free space around 𝑞 § Path through disc can be shortened by connecting points of entry and exit § à Path it’s polygonal! (also true in free space)
𝑞
29
ü Path is polygonal § Vertex cannot lie in interior of free space, otherwise we can do the same trick and shorten the path (that would not then be the shortest) § Vertex cannot lie on an edge, otherwise we can do the same trick ü Inner vertices are vertices of obstacles ∎
𝑞 𝑞
30
Can the theorem help us to define a roadmap graph
Need to include also start and end nodes Vertices and edges of “A*-optimal” road map graph: 1. V = regular grid, vertices are the middle points 2. V = in the middle point of the polygons 3. V = vertices of the polygons 4. No graph guarantees optimality
31
Sweeping, O(n2) complexity
32
§ Terminology:
uniform cost search, greedy, A*, Theta*
§ Big ideas: