Inertia matrix and mutiple disconnected bodies

Discussion in 'Priority support' started by Gustavo Lahr, Jan 28, 2021.

  1. Hello,

    We have a manipulator model which we want to access some properties in order to calculate control actions. Basically, we want the joint space inertia matrix and Coriolis vector.

    When we setup with only the robot, we got the dense inertia matrix via mj_fullM and continue with all calculations.

    However, when we add a disconnected body (robot_soft.xml), we don't know how to get only the robot's inertia directly from the sparse matrix qM. In our model we can obtain the robot's dense inertia matrix from qM and mj_fullM, but we would have to manipulate a matrix that has more than a 100,000 elements to extract a (7,7) matrix.

    Is there a way to get the dense representation of the inertia matrix only for some bodies from the qM representation?

    Attached is a simple model similar to what we want to access.
     

    Attached Files: