DOF Friction Ignored for MJCF Asset

Hello,

I am trying to set the DOF Friction value for a MJCF asset (I’m working with a UR5 arm) and I am finding that the values I set via the following example (say I’ve loaded in a set of envs and UR5’s already and the list of envs is stored in self.envs and the list of UR5 handles is in self.ur5_handles):

ur5_dof_props = self.gym.get_actor_dof_properties(self.envs[0], self.ur5_handles[0])
ur5_dof_props['friction'][6:] = 10.0
print('Setting DOF friction to:', ur5_dof_props['friction'])
self.gym.set_actor_dof_properties(self.envs[0], self.ur5_handles[0], ur5_dof_props)
ur5_dof_props = self.gym.get_actor_dof_properties(self.envs[0], self.ur5_handles[0])
print('DOF friction is:', ur5_dof_props['friction'])

Will result in the following output:

Setting DOF friction to: [ 0.  0.  0.  0.  0.  0. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10.
 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10.
 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10.
 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10.
 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10. 10.
 10. 10. 10. 10. 10. 10.]
DOF friction is: [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]

As you can see even if I get the actor dof properties right after I set them, the friction values are completely ignored. Note that I have a ton of DOFs there because I am trying to simulate a rope using a string of rigid body capsules connected by ball joints, and the first 6 DOFs correspond to the UR5 DOFs while the rest correspond to the joints between the tiny capsules. This is using the FLeX backend, and I observe this behavior with both the PCR and the Jacobi solver. I am not using the PhysX backend because I found it to be highly nondeterministic.

I also noticed that trying to set the DOF friction in the viewer has zero effect as well - I enter in some value, e.g. 10 and press enter and the value immediately goes back to zero. I do not observe this behavior when I set the armature, stiffness, damping, velocity, effort, or driveMode options.

I also found that I cannot use a URDF model of the UR5 + a string of capsules since to simulate a ball joint, I need to have 3 continuous joints connected via dummy links with zero mass and zero inertia tensor between the physical links, which I have found to make the FLeX backend unstable and unusable. PhysX does not have a problem with these dummy links, but again PhysX is too nondeterministic.

I just tested this out with a URDF asset as well, and it seems like DOF friction is ignored completely if you use the FleX backend. This seems like a bug, is there no other place to change DOF friction in FleX?

Hi Vincent,

Joint friction is not implemented as part of the Flex joint model, it is possible to implement a simple explicit friction model using external joint forces (similar to penalty models of contact friction), but this can be a little tricky to tune.

Regarding the ball joints, this is something that Flex supports internally but I believe is not yet exposed on the Gym interface. We are in the process of adding support for this (possibly with URDF extensions).

Cheers,
Miles