Presentation is loading. Please wait.

Presentation is loading. Please wait.

Efficient Distance Computation between Non-Convex Objects

Similar presentations


Presentation on theme: "Efficient Distance Computation between Non-Convex Objects"— Presentation transcript:

1 Efficient Distance Computation between Non-Convex Objects
By Sean Quinlan CSC/Math 870 Yelena Gartsman 11/11/2018

2 The Robotic Challenge…
Computing the distance between objects is a common problem in robotics… Problem One object is a robot and the other object is the union of all obstacles in the environment Solution We find a point on each object such that the distance between the points is minimized, describing how close the robot is to collision 11/11/2018

3 Previous Work (1/2) Previous work focused on convex objects
Finding the distance between two convex objects Iteratively find pairs of points, one on each object, such that the distance between the points monotonically converges to the minimum Properties of convex objects are difficult to extend to the non-convex cases 11/11/2018

4 Previous Work (2/2) Non-Convex Objects - Naïve Implementation
Each object broken down into convex components Known algorithms are used to determine the distance between these convex components The distance between the two objects is then the smallest distance between any pair of convex components Complexity is O(nm), where n and m are the number of components of each of the objects 11/11/2018

5 Collision Detection Definition Uses Observations
Two objects are in collision iff the distance between the objects is zero Uses Robotics – path planning Computer Graphics – physical based modeling Observations Collision detection often consumes a significant percentage of the execution time Much research has been directed at finding efficient algorithms 11/11/2018

6 Collision Detection: Efficient Detection Models
Hierarchical Model(HM) Describes an object at various levels of detail Detection algorithm uses different levels of detail to reduce the number of components that are examined Bounding Representation(BR) Approximately describes an object with simple primitives such as rectangles Detection algorithm determines if collision has occurred between the BR only then the components of the original model are examined 11/11/2018

7 Distance Computation: Algorithm
Objects described as a set of convex components – Underlying Model(UM) From UM a HBR is built based on spheres that approximates the object Search routine examines HBR of each object and determines pairs of components to compare with a convex distance algorithm Experimental results show that only a small fraction of the possible pairs are compared – thus, O(nm) is avoided 11/11/2018

8 Distance Computation: A More Efficient Algorithm
Compute the distance between objects with a relative error For some applications, it is acceptable to partially underestimate the distance between the objects When relative error is zero, the exact distance is computed When relative error approaches 100%, a value of 0 is returned iff the objects intersect Thus, get benefit of some distance information with the efficiency of collision detection 11/11/2018

9 Distance Computation: Assumptions
UM is a surface representation consisting of a set of convex polygons This implies that algorithm will not detect collision when one object completely contains another object 11/11/2018

10 Distance Computation: Bounding Shape Based On Spheres
Spheres Are Simple The simplest geometric solid Can be specified with a position vector and a radius Calculation of distance between two spheres requires 7 additions, 3 multiplications and 1 square root 11/11/2018

11 Distance Computation: Binary Tree (1/2)
BR consists of approximately balanced binary tree Each node of the tree contains a single sphere Tree has the following 2 properties Union of all leaf spheres completely contains the surface of the object Sphere at each node completely contains the spheres of its descendant leaf nodes Leaf spheres closely approximate the surface of the object Interior nodes represent approximations of descendant leaf spheres 11/11/2018

12 Distance Computation: Binary Tree (2/2)
Tree represents a hierarchical description of the object Nodes that are close to the root represent many leaf nodes but to a coarse resolution Nodes near the bottom closely approximate the shape of the few leaf spheres below them 11/11/2018

13 Distance Computation: Building A Tree (1/2)
Cover the object’s surface with small spheres Spheres will be the leaf nodes of the tree Cover the surface by covering each polygon because UM of the object is a set of convex polygons A regular grid of equal sized spheres covers the polygon with the center of each sphere lying in the plane of the polygon Label each leaf sphere with the polygon for which is was created 11/11/2018

14 Distance Computation: Building A Tree (2/2)
Use a divide and conquer strategy to build the interior nodes of the tree Divide a set of leaf nodes into two approximately equal subsets Build a tree for each of the subsets Combine subsets into a single tree by creating a new node with each of the subtrees as children Build subtrees by recursively calling the same algorithm until the set consists of a single leaf node 11/11/2018

15 Distance Computation: Finding The Smallest Sphere
Use two heuristic methods and select the smaller of the two spheres Because no obvious way to compute the smallest sphere that contains a set of spheres First method finds a bounding sphere that contains the spheres of two children nodes and hence, by induction, all descendant leaf nodes Second method directly considers leaf spheres Select center for bounding sphere and examine each of descendant leaf spheres to determine min radius required Selection of center is done by using the average position of the centers of leaf spheres First method works well near the leaves of the tree, while second method produces better results closer to the root 11/11/2018

16 The object is a polygon approximation to the letter “g”
Example (1/4) The object is a polygon approximation to the letter “g” 11/11/2018

17 138 leaf spheres used to cover the outline of the object
Example (2/4) 138 leaf spheres used to cover the outline of the object 11/11/2018

18 Example (3/4) Level five 11/11/2018

19 Example (4/4) Root of the tree 11/11/2018

20 Distance Computation: Execution Time
Bounding tree is expected to be approximately balanced If there are n leaf nodes, we expect there to be about n interior nodes and the depth of the tree to be about logn Time taken to split a set of nodes into two and time needed to form the bounding sphere has order O(ni) complexity, where ni is the number of leaf nodes descending from the i-th node Thus, expected execution time is O(nlogn) and worst case is O(n^2) 11/11/2018

21 Algorithm: Overview (1/2)
Set d to infinity Search routine attempts to show the objects are at least a distance d apart Suppose the search finds two polygons from UM that are less than d apart If polygons intersect, then we know that the distance between two objects is 0 and we are done Otherwise, we set d to the distance between the two polygons and continue the search with the new value of d Eventually, the search shows that either the objects are a distance d apart or the objects intersect 11/11/2018

22 Algorithm: Overview (2/2)
The key to the algorithm is be able to show the two objects are a distance d apart without examining all possible pairs of polygons As each polygon is covered by a set of leaf nodes in the bounding tree, we need only to examine pairs of polygons for which a corresponding pair of leaf spheres are less than a distance d apart 11/11/2018

23 Algorithm: Implementation (1/3)
Search routine examines pairs of nodes in a depth-first manner starting with the root nodes of the two trees If distance between nodes’ spheres is greater or equal to the current value of d then we know the distance between the two sets of descendant leaf spheres is greater or equal to d and can thus be ignored If distance between nodes’ spheres is less than current value of d then we must further examine the children of the nodes 11/11/2018

24 Algorithm: Implementation (2/3)
If both nodes are from interior of the tree, we split one of the nodes into its two children then recursively search the two pairs consisting of a child and the node not split In the case of one interior node and one leaf node, we split the interior node into its two children then recursively search the two pairs consisting of a child and the leaf node In the case of two leaf spheres, the distance between two corresponding polygons can be computed using one of the many available distance algorithms for convex objects 11/11/2018

25 Algorithm: Implementation (3/3)
Issue: the search routine may compute the distance between the same pair of polygons multiple times Because each polygon may be covered by many leaf spheres Solution: We record which pairs of polygons have been examined and before computing the distance between two polygons we check that the computation has not previously been done Record using a Hashtable 11/11/2018

26 Algorithm: Modification
Search routine can be modified to include notion of relative error User specifies a relative error e We calculate a distance d’ such that d’<=d and d-d’<=ed Note, d’ =0 only if d =0; thus, we will not incorrectly report a collision 11/11/2018

27 Algorithm: Modified Version
Search routine must show that the objects are a distance d’ apart The initial value of d’ is set to infinity as in the original algorithm However, when we find two polygons that are closer than d’ apart, we set d’ to be a fraction 1-e of the distance between them 11/11/2018

28 Algorithm Testing: Scenario (1/2)
Six chess piece -- a king, queen, rook, bishop, knight and pawn are randomly placed in 3-dim space For each chess piece, determine its distance to the union of the other five pieces 11/11/2018

29 Algorithm Testing: Scenario (2/2)
Each piece is described by a BR consisting of roughly 2,000 triangles The pieces are non-convex, have rather detailed features and are roughly 100 units high 11/11/2018

30 Algorithm Testing: Results (1/4)
Building Bounding Tree As a pre-computation step, we build the bounding tree for each of the chess pieces For the first two experiments radius of the leaf sphere was set to 2 units resulting in a total of 34,461 leaf nodes The bounding trees for all the pieces are built in 6.4 seconds* * Reported execution times are from an implementation on a Decstation 5000/240 11/11/2018

31 Algorithm Testing: Results (2/4)
Computing Distance The current implementation can examine 80,000 pairs of nodes a second and compute the distance between 11,000 triangles a second For a 20% relative error, the average execution time is 2.0 milliseconds * * Reported execution times are from an implementation on a Decstation 5000/240 11/11/2018

32 Algorithm Testing: Results (3/4)
Varying Relative Error There is approximately two orders of magnitude improvement over naïve implementation if a 20% relative error is specified 11/11/2018

33 Algorithm Testing: Results (4/4)
As two objects get closer, one would expect the search routine to examine more nodes and triangles Algorithm runs a lot slower when the objects are close 11/11/2018

34 Conclusion The combination of HBR, a simple search routine and a convex distance algorithm appears to be a powerful framework for building an efficient distance algorithm for non-convex objects The notion of relative error enables exact distance computation and collision detection to be unified as two extremes of a single problem By accepting a reasonable relative error, one hopes to achieve the performance of a collision detection algorithm while still obtaining useful distance information 11/11/2018


Download ppt "Efficient Distance Computation between Non-Convex Objects"

Similar presentations


Ads by Google