Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed May 17, 2017 3:11 am 
Offline

Joined: Fri Aug 12, 2016 5:46 am
Posts: 10
I read K.Erlenben book <<Stable,Robust And Verstile>> Chapter 6 to learn the PGS in Bullet
Image

Image
When I see the src code in Bullet, I think the Result of the Equation is the Constraint Force Fc*deltaT = dP (delta Impulse).
But I can't understand the param 'Kcfm' in the formulation above,constraint force mixing,it's a diagonal matrix in vector form
Which paper is about 'Kcfm'?

Image

Code:
   void tbSequentialImpulseConstraintSolver::ResolveSingleConstraintRowLowerLimit(tbSolverBody& body1, tbSolverBody& body2, const tbSolverConstraint& c)
   {
      tbScalar deltaImpulse = c.m_rhs - tbScalar(c.m_appliedImpulse)*c.m_cfm;
      const tbScalar deltaVel1Dotn = c.m_contactNormal.Dot(body1.m_deltaLinearVelocity) + c.m_relpos1CrossNormal.Dot(body1.m_deltaAngularVelocity);
      const tbScalar deltaVel2Dotn = -c.m_contactNormal.Dot(body2.m_deltaLinearVelocity) + c.m_relpos2CrossNormal.Dot(body2.m_deltaAngularVelocity);

      deltaImpulse -= deltaVel1Dotn*c.m_jacDiagABInv;
      deltaImpulse -= deltaVel2Dotn*c.m_jacDiagABInv;

      const tbScalar sum = tbScalar(c.m_appliedImpulse) + deltaImpulse;
      if (sum < c.m_lowerLimit)
      {
         deltaImpulse = c.m_lowerLimit - c.m_appliedImpulse;
         c.m_appliedImpulse = c.m_lowerLimit;
      }
      else
      {
         c.m_appliedImpulse = sum;
      }

      if (body1.m_invMass > tbScalar(0.))
         body1.ApplyImpulse(c.m_contactNormal*body1.m_invMass, c.m_angularComponentA, deltaImpulse);
      if (body2.m_invMass > tbScalar(0.))
         body2.ApplyImpulse(-c.m_contactNormal*body2.m_invMass, c.m_angularComponentB, deltaImpulse);
   }



Code:
tbScalar restitution = 0.f;
tbScalar positionalError = solverConstraint.m_rhs;//already filled in by getConstraintInfo2
tbScalar   velocityError = restitution - rel_vel;// * damping;
tbScalar   penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
tbScalar   velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
solverConstraint.m_rhs = penetrationImpulse + velocityImpulse;
solverConstraint.m_appliedImpulse = 0.f;


In the Formulation above,I'm clear about the posErr and velocityErr,But Berror doesn't have the param 'restitution',
so what's the meaning of 'restitution' and which paper is about it.


Last edited by Jack2016 on Fri May 19, 2017 5:23 am, edited 3 times in total.

Top
 Profile  
 
PostPosted: Thu May 18, 2017 7:49 pm 
Offline

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 873
Location: Kirkland, WA
http://box2d.org/files/GDC2011/GDC2011_ ... raints.pdf


Top
 Profile  
 
PostPosted: Fri May 19, 2017 4:48 am 
Offline

Joined: Fri Aug 12, 2016 5:46 am
Posts: 10
Dirk Gregorius wrote:
http://box2d.org/files/GDC2011/GDC2011_Catto_Erin_Soft_Constraints.pdf


Thanks, Drik

The Paper <<Soft Constraints>> by Erin is very helpful to me.

I also find the entire derivation about softness post by Erin https://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=4&t=1354

v2new = v2damaged + invM * JT * dP
J * (v2damaged + invM * JT * dP) + softness * P + softness * dP + bias = 0

(J * invM * JT + softness) * dP = -(J * v2damaged + softness * P + bias)

the softness is CFM

But I'm still not clear about the parameter 'restitution' which is about damping.
'restitution' is not in the Formula above,any one can make it clear ? thanks


Top
 Profile  
 
PostPosted: Fri May 19, 2017 5:27 pm 
Offline

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 873
Location: Kirkland, WA
This might be unrelated to the soft parameters. Normally we solve for a relative velocity of zero at a contact point or limit, but you can also imagine to solve to revert some of the approaching velocity to model bouncy contacts (e.g. a ball) or limits.

https://en.wikipedia.org/wiki/Coefficie ... estitution


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group