Is there a straightforward way to compute the generalized inertia matrix for a model instance in a MultibodyTree? Meaning, suppose that I've created a MultibodyTree/MultibodyPlant for a robot (one model instance) and a ball that it is to interact with.
I want the generalized inertia matrix for the robot only.
The dumb way to do this would be to call the MultibodyTree::CalcMassMatrixViaInverseDynamics
followed by getting the relevant block of the matrix from MultibodyTree::get_velocities_from_array()
.
A smarter way (more efficient, but tedious to make happen) would be to create two MultibodyPlant objects: one corresponding to the robot+ball and the other for just a robot.