Motion Planning CS 6160, Spring 2010 By Gene Peterson 5/4/2010.

Slides:



Advertisements
Similar presentations
Problem solving with graph search
Advertisements

Single Source Shortest Paths
Computational Geometry
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Fall Path Planning from text. Fall Outline Point Robot Translational Robot Rotational Robot.
Approximations of points and polygonal chains
Motion Planning for Point Robots CS 659 Kris Hauser.
Visibility Graph Team 10 NakWon Lee, Dongwoo Kim.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Jarvis March Graham Scan Chan’s Algorithm
Oceanic Shortest Routes Al Washburn 80 th MORS, 2012 Anton Rowe, Jerry Brown, Wilson Price.
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
CSE 380 – Computer Game Programming Pathfinding AI
Visibility Graphs May Shmuel Wimer Bar-Ilan Univ., Eng. Faculty Technion, EE Faculty.
Visibility Graph and Voronoi Diagram CS Tutorial.
Viewing & Clipping In 2D. 2 of 44 Contents Windowing Concepts Clipping –Introduction –Brute Force –Cohen-Sutherland Clipping Algorithm Area Clipping –Sutherland-Hodgman.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
DESIGN OF A GENERIC PATH PATH PLANNING SYSTEM AILAB Path Planning Workgroup.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Visibility Computations: Finding the Shortest Route for Motion Planning COMP Presentation Eric D. Baker Tuesday 1 December 1998.
November 4, Algorithms and Data Structures Lecture XIV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
1 Last lecture  Configuration Space Free-Space and C-Space Obstacles Minkowski Sums.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
1 Spanning Trees Lecture 20 CS2110 – Spring
Randomized Planning for Short Inspection Paths Tim Danner and Lydia E. Kavraki 2000 Presented by David Camarillo CS326a: Motion Planning, Spring
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
CS 326A: Motion Planning Criticality-Based Motion Planning: Target Finding.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 O’Rourke Chapter 8 Motion Planning.
CS 326A: Motion Planning Basic Motion Planning for a Point Robot.
Randomized Planning for Short Inspection Paths Tim Danner and Lydia E. Kavraki 2000 Presented by Dongkyu, Choi On the day of 28 th May 2003 CS326a: Motion.
Introduction Outline The Problem Domain Network Design Spanning Trees Steiner Trees Triangulation Technique Spanners Spanners Application Simple Greedy.
1 Single Robot Motion Planning Liang-Jun Zhang COMP Sep 22, 2008.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 O’Rourke Chapter 8 Motion Planning.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
Robot Motion Planning Computational Geometry Lecture by Stephen A. Ehmann.
Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Visibility Graphs and Cell Decomposition By David Johnson.
Visibility Graphs and Motion Planning Kittiphan Techakittiroj for the Degree of Master of Science Department of Computer Science, Ball State University,
4/21/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Motion Planning Carola Wenk.
SPANNING TREES Lecture 21 CS2110 – Spring
Collision handling: detection and response
Introduction to Computational Geometry Hackson
Graph Algorithms. Definitions and Representation An undirected graph G is a pair (V,E), where V is a finite set of points called vertices and E is a finite.
The problem of the shortest path The classic Dijkstra algorithm solution to this problem The adaptation of this solution to the problem of robot motion.
Path Planning for a Point Robot
Probabilistic Roadmaps for Path Planning in High-Dimensional Configuration Spaces (1996) L. Kavraki, P. Švestka, J.-C. Latombe, M. Overmars.
Prims’ spanning tree algorithm Given: connected graph (V, E) (sets of vertices and edges) V1= {an arbitrary node of V}; E1= {}; //inv: (V1, E1) is a tree,
Fundamental Data Structures and Algorithms Margaret Reid-Miller 27 April 2004 Computational Geometry.
CMPS 3120: Computational Geometry Spring 2013
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
1 Energy-Efficient Mobile Robot Exploration Yongguo Mei, Yung-Hsiang Lu Purdue University ICRA06.
1 Sections 2.5 and 4.4 Priority Queues and Dijkstra’s Algorithm For Shortest Paths Some Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
4/9/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Motion Planning Carola Wenk.
Computer Graphics CC416 Week 13 Clipping.
Motion Planning for a Point Robot (2/2)
Computational Geometry Capter:1-2.1
Geometry.
Convex Sets & Concave Sets
Intersection problem.
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Geometry.
Algorithms and Data Structures Lecture XIV
Computational Geometry
Presentation transcript:

Motion Planning CS 6160, Spring 2010 By Gene Peterson 5/4/2010

What is Motion Planning? Given a set of obstacles, a start position, and a destination position, find a path from start to destination that doesn’t go through any obstacles This project seeks shortest path Many variations on the basic problem

Program Two parts: Course builder and simulator Course Builder: made in C# using XNA and Windows forms User-friendly interface Simulator: approximately 2000 lines of code OpenGL rendering

Potential Project Goals Point object path finding Polygonal object finding Robot rotation Real-time calculation Non-convex obstacles Moving obstacles Curves No global vision 3D problem Path weighting Group travel

Procedure Define input: obstacles, “robot”, starting position, and destination Create a visibility graph Find the shortest path from start to destination in the graph

Required Geometry Point Vector Line Line Segment Ray Poly Line Polygon

Defining a Polygon Ordered set vertices Edges implicitly defined by adjacency in the vertex list May be clockwise or counter-clockwise wound

Open or Closed Polygons? OpenClosed Does it matter?

Open vs Closed Polygon No Intersection Intersection

Open vs Closed Polygons Cannot achieve shortest possible path with closed polygons Always can get slightly closer Open polygons cannot get any closer to the polygon without penetrating it

Course Builder Create 2D polygons and lay them out as a course Saved to file, loaded by simulator

Convex Hull Algorithm #1 Trivial O(n^3) algorithm Every pair of vertices is checked to see if it can be an edge of the convex set

Convex Hull Algorithm #2 Gift wrapping technique O(n*h) n: # of vertices h: # of vertices in the convex hull

Convex Hull Algorithm #3 Graham-Schmidt algorithm O(n log n) n: # of vertices Sorts the points Didn’t attempt algorithm #4: mix of gift wrapping with Graham-Schmidt

Polygonal Robot Instead of a point robot, use a polygon By calculating the Configuration Space of the polygonal robot, the robot can be represented by a point C-Space is the areas that the point robot cannot move

Configuration Space Calculate C-Space version of each obstacle using Minkowski sum of the polygon and the robot

Minkowski Sum Algorithm #1 Trivial algorithm - O(n^3) For each vertex a in polygon A For each vertex b in polygon B Add point (a+b) to P Minkowski sum is the convex hull of points P

Minkowski Sum Algorithm #2 Sweep method – O(n + m) n: # of vertices in polygon A m: # of vertices in polygon B Sorts the points in each polygon in counter- clockwise order Next point is the point with smallest angle

Visibility Graph Graph vertices represent vertices of the C-Space obstacles and the start and destination points Edges represent possible paths If a line segment from any vertex in the graph to any other vertex in the graph doesn’t penetrate an obstacle, there’s an edge between those two vertices Edge weights represent distance between points Shortest path in the graph is shortest path through the obstacles

Graph

Line Segment-Polygon Intersection

Visibility Graph Algorithm #1 O(n^3) Create every possible line segment from pairs of vertices in the graph Any line segment that doesn’t penetrate an obstacle gets added as an edge in the graph

Visibility Graph Algorithm #2 O(n^2 log n) Sweep algorithm Uses the fact that some edges will obscure other edges from being visible Requires a line segment search tree data structure

Ray-Line Segment AVG Tree Balanced binary search tree Given a ray, find the line segment in the tree that it will intersect first

Shortest Path Now that we have an obstacle course and a visibility graph for it, we can calculate the shortest path using graph algorithms

Dijkstra’s Algorithm Breadth first search with weights Only non-negative edges Requires priority queue

Path Finding in Video Games Generally discretised (grid based) 2D path finding useful in many 3D games Speed important (1/60 th of a second/frame) Accuracy less important Much of the environment is static Precomputation often available

Precomputation Precalculate visibility graph of C-Space obstacles only (don’t include any start or end point) To create the full visibility graph, insert start and destination points (calculating visibility for each polygon vertex for them) Use a copy of precalculated visibility graph so it can be reused Needs to be recomputed as often as the environment changes

Statistics TO FILL IN WHEN I HAVE THE FINAL STATISTICS AVAILABLE

More Speed? Multi-threading CUDA Performance optimizations (length squared, etc) Minimizing geometry where possible Sacrifice accuracy Amortize path finding cost over time

Non-Convex Polygons

Robot Rotation Unlike translation, rotating the robot changes the C-Space Even if rotation angles are discretized, greatly enlarges the graph size, and thus the computation time Gave up on this problem to pursue other aspects of motion planning

Goals Revisited Point object path finding Polygonal object finding Robot rotation Real-time calculation Non-convex obstacles Moving obstacles Curves No global vision 3D problem Path weighting Group travel Too computationally expensive for real-time Not as useful in video games, slow Didn’t get to it Beyond the scope of this project AI Problem

Further Exploration Rotation Better precomputation Non-convex performance Sacrificing accuracy for performance Regional partitioning

Implicit Line Equation from 2 Points Given two points on the line, calculate a, b, c  Pick any a and b that make this true  Use any point (x,y) on the line * Any multiple k ≠ 0 applied to (a, b, c) will result in the same line

Half Space (2D) Input: Line and a Point Output: Real (+,-,0) Geometric Interpretation: 0 means the point is on the line + means on one side of the line - means on the other side Plug point into implicit line equation Result is the half space that contains the point (+,-,0)

Half Space (2D) cont. + -

Line-Line Intersection (2D) Line 0: Line 1: Solve for (x,y): two equations, two unknowns Three cases: - No intersection (parallel lines) - Always intersect (same line) - One intersection

Line-Line Intersection (2D) cont. No intersection (parallel lines) Always intersect (same line) Otherwise, solve for (x,y) Constant time Slope of the two lines are equal: For k ≠ 0: But not the same line:

Line Segment-Line Segment Intersection Find intersection point using line-line intersection (if it exists, if it doesn’t the line segments don’t intersect) Create a ray for each line segment Ray ranges from 0 to 1 along the line segment Calculate t of the intersection point for each line segment If both t’s are in [0,1], line segments intersect

Point-Line Intersection Calculate the halfspace the point lies in If halfspace equals 0, point is on the line Floating point error may play into this Use an epsilon, point is near close enough to being on the line

Point-Polygon Intersection Calculate the half space the point lies in for each edge of the polygon If the polygon is clockwise wound, the point must always be in - half space If the polygon is counter-clockwise wound, the point must always be in + half space O(# of vertices in the polygon)

Clockwise Winding Counter-Clockwise Winding

Polygon-Polygon Intersection Possibly intersecting or fully contained Check each line segment in polygon A for intersection with each line segment in polygon B Check for containment: pick a point from A and see if it’s in B (and do same check to see if B is in A)