pinocchio.getFrameJacobian for intermediate joint frames

This question applies to all phases.

We are trying to get the Jacobians for the intermediate joint in order to apply gravity compensation on each finger, using the pinocchio library.

I tried to change the finger_id argument in the pinocchio.getFrameJacobian function to get the intermediate Jacobians. I noticed that finger i’s fingertip uses finger_id = i*10+4 (eg fingertip 3 is frame 34). Naturally, one would assume that the single-digit of finger_id would correspond to the intermediate frames of each finger. But this is the result of testing on finger #3:

I noticed that IDs 31 and 32 are identical, as well as IDs and 33 and 34. If we look at the columns, it’d make sense that 30, 31 (or 32), and 33 (or 34) would correspond to the Jacobian frames that I’d want, but since there’s very little documentation on the Pinocchio website, I’d like to get some confirmation on that. Thanks so much!

I’m unfortunately not an expert on Pinocchio myself. We are getting the IDs of the tip links from their names using robot_model.getFrameId (see here).
So I would expect that you can the IDs of the intermediate links in the same way and then use them in getFrameJacobian.

The links are called (from base to tip):

  • finger_upper_link_X
  • finger_middle_link_X
  • finger_lower_link_X
  • finger_tip_link_X

where “X” is one of 0, 120, 240, depending on the finger. “lower_link” and “tip_link” are actually the same link but for “tip_link” the origin is in the centre of the finger tip while the one of “lower_link” is in the corresponding joint. For more details you can take a look at the Xacro file.

I hope this helps.