330 likes | 480 Views
GJK Supplement. Reference : SIGGRAPH2004 Course Note Original Reference: A Fast Procedure for Computing the Distance between Objects in Three-Dimensional Space , by E. G. Gilbert, D. W. Johnson, and S. S. Keerthi, In IEEE Transaction of Robotics and Automation, Vol. RA-4:193--203, 1988.
E N D
GJK Supplement Reference: SIGGRAPH2004 Course Note Original Reference: A Fast Procedure for Computing the Distance between Objects in Three-Dimensional Space, by E. G. Gilbert, D. W. Johnson, and S. S. Keerthi, In IEEE Transaction of Robotics and Automation, Vol. RA-4:193--203, 1988.
Introduction • Find Euclidean distance (and closest points) between the convex hulls of two point sets • If disjoint, also find the separation axis • If collision, can be enhanced to find penetration depth
Introduction (cont) • Simplex-based descent algorithm • d-simplex: the convex hull of d+1 independent points in d-dimensional space
Demonstration Proximity Query (minimum distance) Penetration Depth
Properties • Distance • distance(A,B) = minaA,b B || a–b ||2 • distance(A,B) = min c A⊖B || c ||2 • if A and B disjoint, c is a point on boundary of Minkowski difference • Penetration Depth • pd(A,B) = min{ || t ||2 | A Translated(B,t) = } • pd(A,B) = mint A⊖B|| t ||2 • if A and B intersect, t is a point on boundary of Minkowski difference
(Simplified) p Simplified Version Find the distance between the CH and origin
Example 1(4) Q = {A} • A is the point of minimum norm in CH(Q) • Q is irreducible • Find B in direction of –A • Add B to Q
Example 2(4) • Q = {A,B} • C is the point of minimum norm • Q is irreducible • Find D in direction of –C • Add D to Q D
Example 3(4) • Q = {A,B,D} • E is the point of minimum norm • Reduce Q to {B,D} • Find F in direction of –E • Add F to Q F
Example 4(4) • Q = {B,D,F} • G is the point of minimum norm • Reduce Q to {D,F} • Cannot find lower support in direction of –G • G is the closest point
Example 1(3) Q={A} A has minimum norm Find B in direction of –A Add B to Q A B
Example 2(3) Q={A,B} C has minimum norm Q is irreducilble Find D in direction of –C Add D to Q Q={A,B} C has minimum norm Q is irreducilble Find D in direction of –C Add D to Q A D C B
Example 3(3) Q={A,B,D} Pt of minimum norm is origin Polygon contains origin distance = 0 A D B
Estimating Penetrating Depth (ref) Start with the triangle containing origin … Expanding polytope
Example 1(3) Start from ABD, the triangle containing origin Expanding, find E A D E B
Example 2(3) Find closest edge Expanding, find F A D F E B
Example 3(3) Find closest point Expanding, find no more. End. A D F E B
Running Time of GJK • Each iteration of the while loop requires O(n) time. • O(n) iterations possible. The authors claimed between 3 to 6 iterations on average for any problem size, making this “expected” linear. • Trivial O(n) algorithms exist if we are given the boundary representation of a convex object, but GJK will work on point sets - computes CH lazily.
More on GJK Given A = CH(A’) A’ = { a1, a2, ... , an } and B = CH(B’) B’ = { b1, b2, ... , bm } A⊖B = CH(P), P = {a–b | a A’, b B’} • Can compute points of P on demand: • p-x = a-x - bx where a-x is the point of A’ extremal in direction -x, and bx is the point of B’ extremal in direction x. • The loop body would take O(n + m) time, producing the “expected” linear performance overall.
Sampling Minkowski Difference (8,5) = (4,4) – (-4,-1) Not explicitly compute the Minkowski difference. Only samples the point set using the support mapping
Example 1(4) Sampling A⊖B (8,5) = (4,4) – (-4,-1)
Example 2(4) (2,1) = (1,2) – (-1,1)
Example 4(4) Note: this also defines the separation axis d = sqrt(1+22)
GJK for Moving Objects time interval is short enough to assume constant velocity movement
Swept Volume … as convex hull of start and end polygon?!