Constrained rigid body Collision detection Contact point - - PowerPoint PPT Presentation

constrained rigid body
SMART_READER_LITE
LIVE PREVIEW

Constrained rigid body Collision detection Contact point - - PowerPoint PPT Presentation

Constrained rigid body Collision detection Contact point Colliding contact Resting contact Friction Collision detection Determine whether the collision occurs within a numerical tolerance Determine


slide-1
SLIDE 1

Constrained rigid body

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
  • Collision detection
  • Contact point
  • Colliding contact
  • Resting contact
  • Friction
slide-6
SLIDE 6

Collision detection

  • Determine whether the collision occurs within

a numerical tolerance

  • Determine all pairs of bounding boxes that
  • verlap
  • Further check contact points between rigid

bodies defined as convex polyhedra

slide-7
SLIDE 7

Bisection

Y(t0) Y(t0 + ∆t) Y(t0 + 1 2∆t) Y(tc)

slide-8
SLIDE 8

Bounding boxes

  • Use bounding boxes to reduce the number of

pairwise collision/contact determinations

  • If two bounding boxes have no overlap, no

further comparisons are needed

  • Coherence can substantially improve the

performance

slide-9
SLIDE 9

Bounding boxes

Sweep and sort algorithm

I1 I2 I3 I4 I5 I6

b3 b5 b1 e5 e1 b6 b2 e3 b4 e6 e4 e2

slide-10
SLIDE 10

Bounding boxes

  • Each bounding box i can be described as an

interval (bi, ei)

  • Find all pairs of interval that intersect
  • All the bi and ei are sorted from lowest to

highest in a list

  • Maintain an active list which is initially empty
  • Whenever bi is encountered, all intervals on the

active list are output as overlapping with i, and i is added to the list

slide-11
SLIDE 11

Bounding boxes

Sweep and sort algorithm

I1 I

2

I3 I4 I5 I6

slide-12
SLIDE 12

Quiz

  • How does sweep and sort extend to 3D cases?
  • A: Apply sweep and sort 3 times in x, y, and z

directions, and take the union of overlapped pairs

  • B: Apply sweep and sort 3 times in x, y, and z

directions, and take the intersection of

  • verlapped pairs
slide-13
SLIDE 13

Bounding boxes

  • We only need to do a full sort and sweep initially
  • What is the cost of the sorting process?
  • Subsequent comparisons can be improved by

utilizing coherence

  • What is the best sorting algorithm for a nearly

sorted list?

slide-14
SLIDE 14

Convex polyhedra

Two polyhedra do not inter-penetrate if and only if a separating plane between them exists

Separating plane

slide-15
SLIDE 15

Separating plane

Check all possible edges or faces to find a separating plane at the very first time step or the first time the bounding boxes

  • verlap
slide-16
SLIDE 16

Y(t0)

Convex polyhedra

Defining face

Utilize coherence by caching defining faces or defining edges

Defining face

Y(t0 + ∆t)

slide-17
SLIDE 17

Convex polyhedra

Defining face Defining face

The defining face no longer separate the polyhedra and a new separating plane must be found If no separating plane is found, an inter-penetration has occurred at some earlier time The simulator must back up until the collision time is determined

slide-18
SLIDE 18
  • Collision detection
  • Contact point
  • Colliding contact
  • Resting contact
  • Friction
slide-19
SLIDE 19

Contact points

  • Once we determine which bodies contact, we

also need to determine the exact contact points

  • We consider two types of contacts
  • vertex/faces
  • edge/edge
slide-20
SLIDE 20

Contact points

4 vertex/face 2 vertex/face 2 edge/edge

slide-21
SLIDE 21

Contact points

A B A B

ˆ n ˆ n

pa(t) pb(t)

Although pa(t) and pb(t) are coincident at time tc, the velocity of the two points may be different

pa(tc) pb(tc)

slide-22
SLIDE 22

Velocity of the contact point

vr = ˆ n(tc) · ( ˙ pa(tc) − ˙ pb(tc)) A B

ˆ n

pa

pb

˙ pb(tc) = vb(tc) + ωb(tc) × (pb(tc) − xb(tc)) ˙ pa(tc) = va(tc) + ωa(tc) × (pa(tc) − xa(tc))

This quantity gives the component of the relative velocity in the normal direction

slide-23
SLIDE 23

Relative normal velocity

vr = 0 vr > 0 vr < 0

A B

˙ pa(tc) − ˙ pb(tc) ˆ n

Separation

A B

˙ pa(tc) − ˙ pb(tc) ˆ n

Resting contact

A B

˙ pa(tc) − ˙ pb(tc) ˆ n

Colliding contact

slide-24
SLIDE 24
  • Collision detection
  • Contact point
  • Colliding contact
  • Resting contact
  • Friction
slide-25
SLIDE 25

Collision process

no force no force

∆t

Impulse:

  • fdt = J = M∆v
slide-26
SLIDE 26

A soft collision

Force

∆t

Velocity

∆V

slide-27
SLIDE 27

A harder collision

Force Velocity

∆t

∆V

slide-28
SLIDE 28

∆t = 0

An infinitely hard collision

Force Velocity

fimp = ∞ fimp∆t = J

∆V

slide-29
SLIDE 29

Impulse force

  • In the rigid body world, we want velocity to

change instantaneously

  • use finite impulse to change velocity instead
  • f infinite force
  • J = ΔP = M Δv
slide-30
SLIDE 30

Impulsive torque

  • If the impulse acts on a point p, J produces an

impulsive torque

  • τimp = (p - x(t)) × J
  • impulsive torque gives rise to a change in angular

momentum: τimp = ΔL = I(tc) ω(tc)

slide-31
SLIDE 31

Colliding contact

A B

ˆ n jˆ n

For frictionless bodies, the direction of the impulse will be in the normal direction ˆ

n(tc)

J = jˆ n(tc)

Body A is subject to this impulse J, while body B is subject to an equal but opposite impulse -J If we can solve for j, we then can compute the velocity of the rigid body after the collision

slide-32
SLIDE 32

Colliding contact

A B

ˆ n

When two bodies collide, we apply an impulse between them to change their linear and angular momentum such that the penetration doesn’t happen in the next time step:

v+

r = −v− r

vr < 0

slide-33
SLIDE 33

The empirical law

Coefficient of restitution: A B

ˆ n V −

r

= 0 = 1 = 0.5

= 0 = 1

Perfect bounce Resting contact

v+

r = −v− r

slide-34
SLIDE 34

Colliding contact

A B

ˆ n

A B

ˆ n ˙ p+

a (tc) − ˙

p+

b (tc)

˙ p−

a (tc) − ˙

p−

b (tc)

jˆ n

Relative normal velocity before and after the application of the impulse before collision after collision

v−

r = ˆ

n(tc) · ( ˙ p−

a (t0) − ˙

p−

b (t0))

v+

r = ˆ

n(tc) · ( ˙ p+

a (t0) − ˙

p+

b (t0))

slide-35
SLIDE 35

Compute the impulse

Define the displacements from center of mass of the body

rb = pb(tc) − xb(tc) ra = pa(tc) − xa(tc)

and The pre-impulse velocity of pa: The post-impulse velocity of pa: ˙

p+

a = v+ a (tc) + ω+ a (tc) × ra

˙ p−

a = v− a (tc) + ω− a (tc) × ra

Replace with in

v+

a (tc)

v+

a (tc) = v− a (tc) + jˆ

n(tc) Ma ˙ p+

a (tc)

Replace with in

ω+

a (tc) = ω− a (tc) + I−1(tc)(ra × jˆ

n(tc)) ω+

a (tc)

˙ p+

a (tc)

slide-36
SLIDE 36

Compute the impulse

˙ p+

a (tc) = ˙

p−

a + j

ˆ n(tc) Ma + (I−1

a (tc)(ra × ˆ

n(tc))) × ra

  • v+

r = ˆ

n(tc) · ( ˙ p+

a (tc) − ˙

p+

b (tc))

ˆ n(tc) · (I−1

b (tc)(rb × ˆ

n(tc))) × rb) = ˆ n(tc) · ( ˙ p−

a (tc) − ˙

p−

b (tc)) + j( 1

Ma + 1 Mb + ˆ n(tc) · (I−1

a (tc)(ra × ˆ

n(tc))) × ra+ = v−

r +j( 1

Ma + 1 Mb +ˆ n(tc)·(I−1

a (tc)(ra׈

n(tc)))×ra+ˆ n(tc)·(I−1

b (tc)(rb׈

n(tc)))×rb) v−

r +j( 1

Ma + 1 Mb +ˆ n(tc)·(I−1

a (tc)(ra׈

n(tc)))×ra+ˆ n(tc)·(I−1

b (tc)(rb׈

n(tc)))×rb) = −v−

r

˙ p+

b (tc) = ˙

p−

b − j

✓ ˆ n(tc) Mb + (I−1

b (tc)(rb × ˆ

n(tc))) × rb ◆

slide-37
SLIDE 37

Compute the impulse

j = −(1 + )v−

r 1 Ma + 1 Mb + ˆ

n(tc) · (I−1

a (tc)(ra × ˆ

n(tc))) × ra + ˆ n(tc) · (I−1

b (tc)(rb × ˆ

n(tc))) × rb)

Now we can compute the impulse and impulsive torque for body A and B Finally, apply the change in linear momentum and angular momentum to the current state

L(tc + h) = L(tc) + τimp P(tc + h) = P(tc) + J τimp = ra × J J = jˆ n(tc)

A: B:

τimp = rb × J J = −jˆ n(tc)

slide-38
SLIDE 38
  • Collision detection
  • Contact point
  • Colliding contact
  • Resting contact
  • Friction
slide-39
SLIDE 39
slide-40
SLIDE 40

Resting contact

  • In this case, all n contact points have the zero

relative velocity

  • At each contact point there is some force ,

where fi is an unknown scalar

  • Our goal is to determine what each fi is and all the

fi’s must be determined at the same time

fiˆ n(tc)

slide-41
SLIDE 41

Resting contact

  • To solve for fi, we need to consider
  • three relations between acceleration of the

contact points and the contact forces

  • all the fi that are in contact at the same time
slide-42
SLIDE 42

Non-penetration

A B

ˆ n pa(t) pb(t)

di(t) = 0

B

ˆ n pb(t)

A

pa(t)

di(t) < 0

A B

ˆ n pa(t) pb(t)

di(t) > 0

This is what we want to avoid di(t) = ˆ ni(t) · (pa(t) − pb(t))

slide-43
SLIDE 43

Non-penetration

˙ di(t) = ˙ ˆ ni(t) · (pa(t) − pb(t)) + ˆ ni · ( ˙ pa(t) − ˙ pb(t)) At time tc, pa(tc) = pb(tc) The definition of two bodies in resting contact: di(tc) = ˙ di(tc) = 0 This means that ˙ di(tc) = vr

slide-44
SLIDE 44

Non-penetration

If , the bodies have an acceleration towards each other and the penetration will occur

¨ di(tc) < 0

Therefore, the first condition is

¨ di(tc) ≥ 0

di(tc) = ˙ di(tc) = 0

When

slide-45
SLIDE 45

Repulsive force

The contact forces can push bodies apart, but can never act like “glue” and hold bodies together Therefore, each contact force must act outward

fi ≥ 0

slide-46
SLIDE 46

Workless force

The contact force at the a contact point becomes zero if the bodies begin to separate If contact is breaking , then fi should be zero

¨ di(tc) > 0

If fi is not zero, then the contact is not breaking

¨ di(tc) = 0

What is the equation that satisfies these two cases?

fi ¨ di(tc) = 0

slide-47
SLIDE 47

Resting contact conditions

A B

ˆ n f ˆ n

Condition 1: Non-penetration Condition 2: Repulsive force Condition 3: Workless force

di(t) = ˆ ni(t) · (pa(t) − pb(t))

¨ di(tc) ≥ 0 fi ≥ 0

where

fi ¨ di(tc) = 0

slide-48
SLIDE 48

Compute contact forces

¨ di(tc) = ai1f1 + ai2f2 + · · · + ainfn + bi

Step 1: compute A and b

   ¨ d1(tc) . . . ¨ dn(tc)    = A    f1 . . . fn    + b

Step 2: solve f using quadratic programming

slide-49
SLIDE 49

Compute contact forces

¨ di(tc) = ˆ ni(tc) · (¨ pa(tc) − ¨ pb(tc)) + 2 ˙ ˆ ni(tc) · ( ˙ pa(tc) − ˙ pb(tc))

Factor out the terms that depend on fj and assign them to aij Assign the rest of terms to bi

= ai1f1 + ai2f2 + . . . + ainfn+bi

See details in Baraff and Witkin’s course notes

slide-50
SLIDE 50

Quadratic programming

Solve for Subject to

f1, f2, · · · , fn fi ≥ 0

A    f1 . . . fn    + b ≥ 0

(ai1f1 + · · · + ainfn + bi)fi = 0

i = 1 · · · n i = 1 · · · n

slide-51
SLIDE 51
  • Collision detection
  • Contact point
  • Colliding contact
  • Resting contact
  • Friction
slide-52
SLIDE 52

Contact friction

  • Dry friction occurs when surfaces in contact

are free of any contamination

  • Wet friction occurs when the surfaces are

separated by a thin film of lubricants

slide-53
SLIDE 53

Dry contact friction

  • Coulomb’s law
  • if sliding, the kinetic friction is
  • if static (|vT|= 0) then stay static as long as

Ffriction = −µk|Fnormal| vT |vT | |Ffriction| ≤ µs|Fnormal|

slide-54
SLIDE 54

Coulomb friction cone

static friction dynamic friction

slide-55
SLIDE 55

Quiz

  • Given µ for static friction, can you compute the angle
  • f the friction cone θ?

|Ffriction| ≤ µs|Fnormal| θ

slide-56
SLIDE 56

Quiz

  • True or False
  • Glass has bigger mu value than rubber.
  • The larger the mu is, the wider the angle of the

friction cone is.

  • Suppose I am pushing a furniture on the floor.

The faster I push horizontally, the more I damage the floor.

slide-57
SLIDE 57

Collision friction

  • Collision takes place over a very small time

interval with very large forces

  • Assume forces don’t vary significantly over that

interval, then we can replace forces in friction laws with impulses

slide-58
SLIDE 58

Dry collision friction

  • Assume
  • Static case is , when
  • Sliding case is

µs = µk v+

T = 0

|v−

T | =≤ µ|∆vN|

v+

T = v− T − µ|∆vN| v− T

|v−

T |

slide-59
SLIDE 59

Summary

  • What’s the physical meaning of the rotation

matrix?

  • How is the rotation matrix related to angular

velocity?

  • How do you compute inertia tensor efficiently?
  • Why do we compute impulse instead of force in

the case of colliding contact?