# where to specify friction?

I see several examples (such as test_friction.world ) that specify mu/mu2/slip1/slip2 in the link/collision/surface/friction/ode namespace.

I also see some examples (such as this one ) that specify mu1/mu2/slip1/slip2 in the <gazebo> namespace.

Aside from the mu vs mu1 question, which one is correct? Or are they two ways of the same thing?

edit retag close merge delete

Sort by » oldest newest most voted

They are the same, but neither of them is guaranteed to actually be applied to your model (personal experience). I cannot pinpoint when the set parameters are being used and when are not. Use whatever makes more sense in your usecase. Either you have a robot/model description on a separate location from your world (perhaps you use it in multiple worlds) then you want to specify the friction inside this description (the <gazebo> tags), or you only specify this model in the specific world description. In that case go ahead and define the friction in there.

In case the surface friction set in the SDF description does not apply (you check the value inside the gazebo client, for example, and it is not what you set), you will need to set the friction in some gazebo plugin.

model->GetLink(link_name)->GetCollision(_index)->GetSurface()->FrictionPyramid()->SetMuPrimary(mu);

more