Search code examples
drake

Using InverseDynamicsController on coupled joints


The arm I’m trying to port into drake (vs300s) has two prismatic finger joints and a continuous gripper joint. I’ve been trying to couple the two fingers to the gripper joint such that the the whole hand has only 1 actuated joint rather than three.

I’ve been following https://github.com/RobotLocomotion/drake/blob/master/examples/simple_gripper/simple_gripper.cc and https://github.com/RobotLocomotion/drake/blob/master/examples/simple_gripper/simple_gripper.sdf.

So far I’ve done the following:

  1. I’ve set the effort for the fingers to 0 to make them unactuated
  2. I’ve coupled the gripper to the left finger, and the gripper to the right finger using AddCouplerConstraint.

Everything looks fine, but when I try to use it with InverseDynamicsController, I get an error complaining that the number of positions is more than the number of actuators. Can someone help me understand what other steps I need to take to make this coupled gripper assembly work with InverseDynamicsController?

Here’s the original urdf (well, after converting from xacro and replacing stl with obj): https://github.com/frouhi/drake_xsarms/blob/main/urdf/vx300s.urdf

Thank you


Solution

  • Making InverseDynamics (and other tools) and other tools effectively use the MultibodyPlant constraints is a known TODO: https://github.com/RobotLocomotion/drake/issues/18917 .

    The standard approach (which is in a sense the "correct" approach for panda and iiwa simulations) is to have a welded version of the gripper (both fingers are welded in place) which is used in the inverse dynamics calculations. In the extreme form, that's just another copy of the urdf with the modification. It's correct for iiwa and panda because that's actually the only information that the true iiwa and panda controllers can be given about any attached end effector. Even in your case, the position of the fingers will not impact the inverse dynamics commands substantially.

    It's not very ergonomic, but that approach would work for you here, too as a stopgap.