# is soft_cfm and soft_erp utilized by ODE

I have been trying to add some softness for my grasping ball experiment and I have been struggling to get anywhere. I have been fiddling around with soft_cfm and soft_erp values.

But if you look at physics/ode/ODEPhysics.cc, you can see that the values for soft_cfm is calculated using the kp and kd, so does the value of soft_cfm and soft_erp have any affect?

// Compute the CFM and ERP by assuming the two bodies form a
// spring-damper system.
double kp = 1.0 / (1.0 / surf1->kp + 1.0 / surf2->kp);
double kd = surf1->kd + surf2->kd;

contact.surface.soft_erp = (this->maxStepSize * kp) /
(this->maxStepSize * kp + kd);

contact.surface.soft_cfm = 1.0 / (this->maxStepSize * kp + kd);

// contact.surface.soft_erp = 0.5*(_collision1->surface->softERP +
//                                _collision2->surface->softERP);
// contact.surface.soft_cfm = 0.5*(_collision1->surface->softCFM +
//                                _collision2->surface->softCFM);

edit retag close merge delete

Sort by » oldest newest most voted

They seem to be not used at all, kp and kp are used instead, so you're right. I don't know why they are there

UPD: they were used back in 2012

more