# Contact modeling

Hi,
I’m currently working on simulating a humanoid robot (Talos) into DART.
Is it possible to modify the contact model (sphere, box…)? Like gazebo does with ODE: Kp, Kd, mu1, mu2… Hard and soft contact implementation.
Sometimes the robot slips or bounces on the floor when it starts to walk, due to the impact between the foot and the floor. Although, I put 0.0 velocity at the end of the foot’s trajectory. This trick is not enough if the robot moves rapidly.

DART uses a hard contact model (to prevent unrealistic penetration between objects), and you can change the relevant parameters such as first/second friction directions (mu1/mu2), friction coefficient, and restitution coefficient. You might want to look into DynamicsAspect and code examples.

Although soft contact implementation is not provided, but it should be straightforward to implement it yourself by applying spring-damper force to each contact point on the BodyNode as external forces since the necessary data (e.g., contact point/normal/penetration depth) are available.

The relevant parameters seem to be greatly set (0 restitution and 1 friction).

If I want to implement my own soft contact implementation based on the force :
Should I remove the current force at the body in contact? Then apply the calculated force based on penetration and velocity (K_pe+K_d\dot{e}) on the body in contact?

Just to clarify my last post, contact points on the BodyNode are available with the following code :

   const dart::collision::Contact &dtContact =
_dtLastResult->getContact(i);