240 likes | 259 Views
Visibility Graph and Voronoi Diagram. CS 234326 Tutorial. Common Framework. Roadmap approach Limited to low-dimensional C : essentially 2D polygonal regions, objects and obstacles. Good for Multi-queries Complete algorithms. Visibility Graphs. non-directed graph G
E N D
Visibility Graph and Voronoi Diagram CS 234326 Tutorial
Common Framework • Roadmap approach • Limited to low-dimensional C • : essentially 2D polygonal regions, objects and obstacles. • Good for Multi-queries • Complete algorithms
Visibility Graphs • non-directed graph G • nodes: initial and goal configurations + vertices of C-obstacles • edges: straight-line segments connecting two nodes that don’t go through obstacles – a weight of an edge is it’s euclidian distance. qqoal qinit
Dijkstra’s Shortest Path Algorithm • Single source and target. Let us define a Graph G=(V,E) where - s is the source node and - t is the target node. • INITIALIZE_SINGLE_SOURCE(G,s) • We use the relaxation procedure -
Dijkstra’s Shortest Path Algorithm • RELAX(u,v,w) • The procedure improves the estimated path length to node v, when we visit him from node u !
The Full Algorithm • DIJKSTRA(G,w,s) • The extract the path we go from node t to it’s parents until we reach s ! (The path is the opposite path we traversed)
Why it works Proposition: a semi-free path between qinit and qqoal a simple polygonal line τ lying in cl(Cfree) whose endpoints are qinit and qqoal, and such that τ’s vertices are vertices of CB Sufficient to consider only polygonal lines running via vertices of CB, and if such path exists, G contains the shortest one. Visibility Graph
A* path finder • Construct the Graph, and on every node we define a 2 functions: • 1. g(x) – a cost of a path we found till the node x. • 2. h(x) - an admissible heuristic function that estimates the distance left to reach the goal. • We define their sum f(x) = h(x) + g(x) and choose always a node with minimal f value. If h is admissible (i.e. < true distance to the goal) A* is guaranteed to find the shortest path and more efficiently.
A* path finder • We use method that resembles to Dijkstra but our priority-queue is sorted according to the f() function. • For example: here we choose first (s,a) then (a,b) then (b,c) etc…
A* path finder • Pseudo code: Input: A graph Output: A path between start and goal nodes
The Algorithm • Construct a visibility graph G • Search G for a path from qinit to qqoal by using dijkstra or other search algorithm as A-star. • If a path is found, return it; otherwise, indicate failure • Construction most expensive: - naively O(n3) - sweep-line algorithm renders it O(n2 log n) - O(n2) proposed. Visibility Graph
Unneccesary edges Unfortunately - the visibility graph has many needless edges. The use of supporting and separating lines can reduce the number of edges in the graph. Supporting line – tangent to 2 obstacles where they both lie on the same side of the line. Separating line – tangent to 2 obstacles where they lie on the opposite lines of the line. The Reduced Visibility graph can be constructed solely from these lines. Visibility Graph
Reduced Visibility Graphs • G without non-tangent segments and concave vertices. • Tangent segment: a segment tangent to CB at both nodes • If we use only these lines only the convex-hulls of every obstacle are considered to be taken to the graph ! qqoal qinit
Efficient Graph construction • To construct the visibility graph we must determine which vertices are visible from a vertex v , for every v. • Naïve algorithm: for every vertex we check all the possible line segments emanating from it O(n) and see if each of them intersects an edge. There are O(n) edges hence for every vertex the complexity is N^2 , hence altogether is O(N^3). • Line-sweep algorithm: for every vertex we define the angles of lines connecting him with other vertices [o,2*pi]. For every such line in increasing angle order, we sort all the edges that intersect the line and maintain them in a Balanced-Tree. Whenever the closest edge changes we add the corresponding vertex to the graph – O(N^2logN).
Voronoi Diagram • A roadmap method based on retraction • : a continuous function of Cfree defined onto a 1D subset of itself. • A realization of retraction in 2D C with polygonal obstacles • : consists of curves in Cfree that are equidistant from two or more points in Cfree
Generalized voronoi diagram-GVD • given a set of obstacles we define the generalized voronoi region as: • it is an area of points where the closest obstacle is Oi. • Given 2 obstacles Oi and Oj we define the two-equidistant surface : • Two equidistant face is defined as : • The GVD is : • This definition applies to any dimensional spaces!
GVD-Mathematical definition • For a given manifold X, a retraction is a continuous function • the subset A is called retract (typically the dimension of A is less than the dimension of X. • Let 2 functions where U,V are manifolds. A homotopy is a continuous function such that • for example :
GVD-Mathematical definition • Now we can define the GVD by deformation retraction: • Let is a retraction. A deformation retraction is a homotopy such that: • In other words: H is a homotopy between an identity map and a retraction . We use deformation retraction to smoothly deform , without tearing or pasting X onto a lower, preferably 1D subset A of X. As t varies from 0 to 1 a point from X moves towards a point in A. The GVD is deformation retract !!
Construction of the GVD There are 2 methods for construction of the planar GVD: Use the sensor information to construct the GVD in an unknown space. Assume the world is a grid and compute a distance function with the wave propagation method.
Sensor based construction We simultaneously generate and explore a graph that is embedded in the free space. The robot uses it’s sensor to find the closest obstacle and moves away from it until it reaches an equidistant point. It starts to trace the edge by the same curve-tracing technique we saw in tangent bug except so the tangent is the null space of . (This is identical to passing a line through the 2 closest points and taking the vector perpendicular to that line). A meet-point is detected by looking for a sudden change in one of the closest obstacles) When a robot encounters a new meet-point it marks the direction from which it came as explored and identifies all new GVD edges. Chose and edge and continue recursively. (DFS search)
Grid C-Space – The Brushfire alg. We start to propagate a wave front from the obstacles boundaries outside and in every step update the pixels pointer to the obstacle which originated the wave front. When a collision of 2 wave fronts from 2 different obstacles occure this collision point must be on the equidistant edge, hence on the GVD, so every pixel which will have 2 different pointers will be marked as a GVD Roadmap pixel.
Polygonal Obstacles • When all the obstacles are polygonal we have only 2 features: vertices and edges, thereby making equidistant relationships easy to define: • The set of points equidistant to 2 vertices is a line. • The set of points equidistant to 2 edges is a line. • The set of point that is equidistant to a vertex and edge is a parabola .
The Algorithm • Compute GVD(Cfree) • Compute p(qinit) and p(qqoal); find the arcs containing them just follow away from the closest obstacle until you reach the GVD. • Search and return a path between them if exists; otherwise, return failure. (Boundary tracing) • You can find the shortest path with Fast-Marching method. • Construction most expensive: O(n log n) • Other steps: O(n) Voronoi Diagram