# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Bullet Pt2Pt Constraint and Jacobian entryPosted: Sun Oct 23, 2005 12:45 pm

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 773
Location: Bellevue, WA
I looked at the Point2PointConstraint class and have a question how the constraint is satisfied ( Point2PointConstraint::SolveConstraint( dt ) ). For my understanding two steps have to be taken:

1.) First calculate the constraint error
This is very obvious here. Simply calculate the relative drift and relative velocity at the pivot point.

2.) Find correction (impulse) such that constraint error is repaired

Questions:

(1)
The Jacobian for the Pt2Pt constraint is a 3 x 12 matrix and it has the following entries:

J = ( I -R1 -I R2 )

I := Identity matrix (3x3)
R1 := Cross matrix for offset vector from CM body1 to pivot point in world space (3x3)
R2 := Cross matrix for offset vector from CM body2 to pivot point in world space (3x3)

How does this relate to the JacobianEntry class and what is the "normal" entry in this class?

(2)
We need to find an impulse such that constraint error is resolved. How is this achieved using the JacobianEntry class? Derivation? I have solved this problem by finding an impulse such that relative velocity at the pivot point is resolved, but I don't take the Jacobian into account. So how can use the Jacobian to find the repairing impulse?

(3)
For a hinge joint the resulting impulse would be a 5 x1 vector. How do I build a linear and angular impulse from this data?

A sketch of the basic idea would be very helpful - especially the role of the Jacobian!

Regards,

-Dirk

Top

 Post subject: RE:Posted: Sun Oct 23, 2005 1:50 pm

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 773
Location: Bellevue, WA
I thought about the problem and came up with the following idea:

The velocity update for the two bodies is:

M * du /dt = f_ext + JT * lambda

Here u is the generalized velocity vector for body1 and body2, JT is the transposed jacobian and lambda is a vector of langrange multipliers.

Since we use linear dynamics we can use superposition and apply the external and constraint forces subsequently. So the velocity update because of the the constraint forces becomes:

M * du /dt = JT * lambda

The compatibility equation (velocity constraint) for the two bodies is:

J * u(t) = 0

Numerical integration of the Newton-Euler equation:

M * ( u(t+dt) - u(t) ) / dt = JT * lambda

<=> u(t+dt) = u(t) + M^-1*JT*lambda*dt

Semi-implicit integration, therefore

J * u(t+dt) = 0

Plug integrated Euler-Newton into compatibility equation:

J * [ u(t) + M^-1*JT*lambda*dt ] = 0
<=> J*M^-1*JT * lambda * dt + J*v(t) = 0

This is a linear system: A * x + b = 0

If we look now sharply we see that J*v(t) is the constraint error and lambda * dt is the wanted impulse. We define

A := J*M^-1*JT
x := lambda * dt
b := J*v(t)

=> lambda = A^-1 * constraint error (J*v(t))

So the wanted linear and angular impulses for body1 and body2 are simply:

P = JT * lambda

Is this correct?

-Dirk

Top

 Post subject: Posted: Mon Oct 24, 2005 11:12 pm

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3825
Location: California, USA
I renamed some variables to make the source a bit more clear.
Basically the JacobianEntry calculates and stores some values to perform constraint correction:

for two rigidbodies, A and B it precomputes

angular Jacobian entries J for both bodies
Minv Jt for both bodies
Adiag, the diagonal entry in the system matrix A = J Minv Jt

This information can be used in a Gauss-Siedel iterative LCP solver, or to correct the constraint error on a per-body pair.

Once I got some time I will add some more details, see the renamed variables in JacobianEntry here:
http://www.erwincoumans.com/Bullet/Bull ... tated.html

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities