0

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.

  • That assumes the model instances are not directly coupled. Is that a reasonable assumption? If one model instance could be connected to another by a joint the generalized inertia could involve coordinates from both instances. – Sherm Sep 19 '18 at 22:36
  • Perhaps it is a good assumption if the method were explicitly designed for this; Maybe we could add something like `GetDecoupledMassMatrix(ModelInstance)`? It could throw an error if there's a topological connection (mobilizer / joint) that couples the instance to something else, otherwise, it could just give you the block of the overall mass you want. (This assumes that the nominal mass matrix is not projected into constraint nullspaces, which I'd assume is quite fair?) – Eric Cousineau Sep 19 '18 at 23:47
  • I think Eric's suggestion would work fine. I *think* this is the only aspect where one has to worry about avoiding unnecessary computation. A similar problem is computing the Jacobian for a single model instance. That problem would only seem to introduce unnecessary computation if there is a large multibody system, for which a large, sparse matrix could result. – Evan Drumwright Sep 20 '18 at 16:56

0 Answers0