What is the meaning of parameter Kcfm in PGS Formulation?

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
Jack2016
Posts: 10
Joined: Fri Aug 12, 2016 5:46 am

What is the meaning of parameter Kcfm in PGS Formulation?

Post by Jack2016 » Wed May 17, 2017 3:11 am

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: Select all

	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: Select all

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.


Jack2016
Posts: 10
Joined: Fri Aug 12, 2016 5:46 am

Re: What is the meaning of parameter Kcfm in PGS Formulatio

Post by Jack2016 » Fri May 19, 2017 4:48 am

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 ... 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

Dirk Gregorius
Posts: 874
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: What is the meaning of parameter Kcfm in PGS Formulatio

Post by Dirk Gregorius » Fri May 19, 2017 5:27 pm

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

Post Reply