Full inertia matrix from data->qM

Discussion in 'Simulation' started by kracon7, Jul 23, 2019.

  1. Hi,
    I have been using mujoco-py for my manipulator simulation but I found that the python wrapper doesn't have a reference to the function mj_fullM(model, buffer, data->qM) to obtain a dense representation of full inertia matrix. What I could access through python wrapper though, is data.qM and data.qLD.
    Since I don't know how to access mj_fullM() through python, are there any documentation about how the function mj_fullM() works internally?
    Really appreciate your help!!
     
  2. Hello, I realize this is several months old, but in case you're still wondering:

    Code:
    import mujoco_py as mjp
    MNN_vector = np.zeros(N_JOINTS**2)
    mjp.cymj._mj_fullM(self.model, MNN_vector, self.sim.data.qM)
    M = MNN_vector.reshape((N_JOINTS, N_JOINTS))
    you can see this in full on our pull request (which should be merged into master shortly, hopefully) at https://github.com/abr/abr_control/pull/59 in the abr_control/arms/mujoco_config.py file.