Most efficient way to calculate end-effector wrench

Discussion in 'Priority support' started by Alireza Ranjbar, May 5, 2020.

  1. Hi,

    I wanted to ask what might be the best way for calculating the external end-effector wrench in tool coordinate, and base coordinate.

    A sample code snippet would be greatly appreciated. Thank you.
     
    Samarth Brahmbhatt likes this.
  2. You could use a end-effector mounted force / torque sensor, i.e., the force / torque sensor that is already provided http://www.mujoco.org/book/XMLreference.html#sensor-force. That will give you the forces in your desired frame. You might have to compensate the mass that follows your measurement frame (e.g. the gripper mass) but that should be straight forward. J.J. Craig "Introduction to Robotics" Chapter 5 is a good reference for getting a coordinate transform of that force into base / world frame.
     
  3. Emo Todorov

    Emo Todorov Administrator Staff Member

    In addition to what Florian said, you can use the body Jacobians to convert between joint forces to end-effector forces. One conversion is straightforward, the other requires a pseudo-inverse.

    If you want contact forces expressed in end-effector coordinates, they are computed at each step, and can be found in mjData.contact. Note that if you are using pyramidal friction cones, the contact forces are in an over-complete and non-orthogonal coordinate system, but you can decode them with the function mju_decodePyramid.
     
  4. Thank you for your answers. Just three more questions:

    1_In mujoco is there an advantage for using the body jacobians for getting the end-effector wrench compared to defining force/torque sensors at a desired site?
    2_So my understanding is then that instead of transforming the wrench from the end-effector frame to base frame, we can also define another site for the end-effector's body but with it's frame defined similar to base frame's position and orientation, right?
    3_Just wondering if there was any literature/documentation that you may suggest regarding if for contact rich manipulation using mjData.contact might be better than calculating end-effector wrench.

    Thank you.
     
  5. Emo Todorov

    Emo Todorov Administrator Staff Member

    1. body jacobians are a bit faster, but the difference is negligible.

    2. yes you can define sites and get their jacobians.

    3. there is no general answer, it greatly depends on what you are doing.