0
$\begingroup$

In Gazebo Classic, it was possible to assign torsional friction to objects, as explained here https://classic.gazebosim.org/tutorials?tut=torsional_friction&cat=physics. However, when I follow the same steps to add torsional friction parameters to my sdf for Gazebo Sim (Harmonic), it doesn't work. A sphere will keep spinning no matter how much torsional friction I give it. I have searched the repository and issues of Gazebo Sim and don't see any mention of torsional friction, which makes me think it might not be implemented. Below is the piece of sdf code I use:

                   <surface>
                    <friction>
                      <torsional>
                        <coefficient>1.0</coefficient>
                        <surface_radius>0.5</surface_radius>
                        <use_patch_radius>false</use_patch_radius>
                        </torsional>
                    </friction>
                 </surface>

Is this the correct way to use it? Or is there a workaround that would allow me to apply friction to an object which only has a single point of contact with another object? Maybe a way to increase contact depth/number of contact points between them?

$\endgroup$

1 Answer 1

0
$\begingroup$

Have you tried the dynamics field for a joint?

The surface element is part of the collision element of a link, hence describing contact physics with other links. I am not sure exactly how the torsional friction element you are refering to is translated or which forces are calculated, but if you just want a sphere to not spin infinitely, this might be a way.

Beside, I would also advise to try different physics engines. It may actually be translated correctly by the sdf parser, but not every physics engine has the same set of features implemented and may do things differently for certain situations. You can try dart, bullet or bullet-featherstone. I do believe dart is the default engine.

Maybe also take a look at the contact tree, those can be finicky, it helps to also visualize them in the gui together with the forces to actually see what is happening.

Hope this helps.

PS: Bullet-featherstone definitely passes the torsional element

$\endgroup$
1
  • $\begingroup$ I can't use the friction parameter of a joint since the two objects are not always in contact. However, I tried your bullet-featherstone suggestion and it does implement torsional friction and you can tune its coefficient (patch-radius/surface-radius not yet implemented). If for some reason you can't use bullet-featherstone for the physics engine (for my use case it is generating unstable forces), there is an option in Dart to change the collision detector, which can increase the number of contact points and mimic torsional friction depending on use case. $\endgroup$
    – robo_q
    Commented Jul 11 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.