Add joint friction for ODE revolute, prismatic, and universal joints (#381)

#1206 Declined
  1. Steven Peters

This pull request uses the <axis><dynamics><friction> tag to implements Coulomb joint friction (see Fig 1 in this paper, thanks to @Silvio Traversaro for the suggestion). It is currently implemented for ODE revolute, prismatic, and slider joints using the velocity and force parameters in the ODE joint motor (see #381 for further discussion).

I've added a section to the INTEGRATION_joint_spawn test to verify the SetParam("friction", ...) API, and I've also added a demo world: worlds/ (note that it is generated from an embedded ruby template with suffic .rworld). In this world, there are several joints with different friction values that should behave differently. The universal joints are set to mimic the behavior of the revolute joints.

I should be able to get bullet to work in a similar manner. I will address this in a future pull request.

Caveats: the ODEJoint::SetVelocity had previously been using the ODE joint motors, so this function will currently interfere with joint friction. I plan to address this in a future pull request.

Apologies: I did some refactoring in the ODEJoint::[GS]etParam functions, which has made this diff a bit larger than it needed to be, but it allowed me to delete quite a bit of duplicate code.

Assorted comments:

  • I also moved the sdf parameter loading from ODEJoint::Load to the parent class.
  • I had to modify Joint::Reset to allow joint friction values to persist after a world reset (try resetting the demo world to verify that it works).
  • I had to add a small fix to the INTEGRATION_joint_spawn test to counteract the interference between SetVelocity and joint friction.

Jenkins build is happy

Comments (3)