How to set physics/ode parameters of individual joints in URDF to reduce joint errors

asked 2022-03-15 12:31:10 -0600

christophfroehlich gravatar image

updated 2022-03-16 10:23:44 -0600

I have a problem simulating a robot with a mechanical transmission system: drawbars actuated by a hydraulic actuator. The kinematic chain works when I set the effort of the revolute joint, where the drawbars and hydraulic cylinder is moving as expected. But when I apply a force on the hydraulic cylinder (prismatic joint), the drawbars are "pushed away", i.e., the joints of the drawbars are not in the correct position any more with the standard physics solver settings. By increasing the iterations of the quick-solver together with a higher global ERP setting the physics seems to be solved correctly, but with a realtime factor of approx 0.01 only.

Is it possible to set the ERP/CFM parameters separately for each joint?

I use gazebo11 with ROS2 galactic, using <gazebo> tags in the URDF file:

<gazebo reference="cylinder_linkage">
  <physics>
    <ode>
      <erp>0.8</erp>
      <cfm>0.0</cfm>
    </ode>
  </physics>
  <stopErp>0.8</stopErp>
  <stopCfm>0.00001</stopCfm>
</gazebo>

This is converted to the following sdf file by gazebo

<joint name='cylinder_linkage' type='revolute'>
  ...
  <physics>
    <ode>
      <limit>
        <cfm>1e-05</cfm>
        <erp>0.8</erp>
      </limit>
    </ode>
  </physics>
  <physics>
    <ode>
      <erp>0.8</erp>
      <cfm>0</cfm>
    </ode>
  </physics>
</joint>

But there seems to be no change of the simulation behavior after changing the value of the physics/ode/erp tag, as if it would be discarded.

Any suggestions on how to get the solver running?

edit retag flag offensive close merge delete

Comments

I solved the original problem: The joints were not calculated well due to improperly set inertia tensors. After setting them properly everything is solved fine without the need of adapting ERP/CFM. However, I'll let the question open, maybe someone can explain how to set this in the URDF file

christophfroehlich gravatar imagechristophfroehlich ( 2022-03-16 10:23:31 -0600 )edit