# Setting friction params

Ok guys, is any of you open to explain this in a simplified matter, or on a specific example? We all usually need friction for wheels; so If you have a wheel, turning on the x direction. You would want to have friction on the x direction. and on the y also so the wheel does not slip on the sides. So mu = mu2. But if you want to model an omniwheel, you would like the y direction to have no friction, so the wheel can actually slip that side. So you set up the mu2 = 0 In case your wheel is not oriented on the specified axes you can change the direction with fdir1.

I keep on seing people advising friction of 100 or some other values that are not comprised in the 0..1 interval specified by the sdf documentation. What is the catch with that?

I played around with the friction, but apparently for the same settings, my wheels react differently from a run to another.

I try to simulate a 3 omniwheeled robot base. And I've just come to realise there is no friction in the sdf code generated for gazebo from the xacro file written.

code URDF:

<surface>
<friction>
<ode>
<mu>1</mu>
<mu2>0</mu2>
<fdir1>0 1.0 0</fdir1>
<implicit_spring_damper>true</implicit_spring_damper>
</ode>
</friction>
</surface>


generated code SDF with gw sdf -p:

  <surface>
<contact>
<ode>
<kp>1e+06</kp>
<kd>1</kd>
</ode>
</contact>
<friction>
<ode/>
</friction>
</surface>


A part of my question can be also found here, but nobody actually answered that part.

edit retag close merge delete

Sort by » oldest newest most voted

Very important: fdir = direction of mu1 in the collision local reference frame

SO i was setting the friction all wrong because i have some wheels that are not all oriented on the same angle so i was calculating a different fdir for each one when there was no need because the reference is local so all you need is either x or y of the fdir to be set to 1 depending on how you build the wheels. I bypassed the generation issue by modifying and loading directly the sdf file using gazebo_ros/spawn_model:

<arg name="robot_xdf_description" default="$(find MY_PACKAGE)/urdf/robot.sdf" /> <node name="sdf_spawner_1" pkg="gazebo_ros" type="spawn_model" args="-z 1.0 -unpause -sdf -model robot1 -file$(arg robot_xdf_description)
-robot_namespace /robot1"
respawn="false" output="screen" />


EDIT On a second thought i realised the frame is not the local one (see this issue), but the fdir does not work in the global frame.

EDIT2 Indeed I was right. The fidir still does not work for all the cases. See here.

more