Improve mj_fullM documentation, add clarifying test.
PiperOrigin-RevId: 796134559 Change-Id: I85ab3680d3545ccf83d0d3af8a7c21cb36e96d4e
This commit is contained in:
committed by
Copybara-Service
parent
6b41fbe72a
commit
972ffd7b90
@@ -459,7 +459,13 @@ Get name of object with the specified :ref:`mjtObj` type and id, returns ``NULL`
|
||||
.. mujoco-include:: mj_fullM
|
||||
|
||||
Convert sparse inertia matrix ``M`` into full (i.e. dense) matrix.
|
||||
|br| ``dst`` must be of size ``nv x nv``, ``M`` must be of the same size as ``mjData.qM``.
|
||||
|br| ``dst`` must be of size ``nv x nv``, ``M`` must be of the same structure as ``mjData.qM``.
|
||||
|
||||
The ``mjData`` members ``qM`` and ``M`` represent the same matrix in different formats; the former is unique to
|
||||
MuJoCo, the latter is standard Compressed Sparse Row (lower triangle only). The :math:`L^T D L` factor of the inertia
|
||||
matrix ``mjData.qLD`` uses the same CSR format as ``mjData.M``. See
|
||||
`engine_support_test <https://github.com/google-deepmind/mujoco/blob/main/test/engine/engine_support_test.cc>`__ for
|
||||
pedagogical examples.
|
||||
|
||||
.. _mj_mulM:
|
||||
|
||||
|
||||
@@ -266,7 +266,13 @@ found, the function will return ``distmax`` and ``fromto``, if given, will be se
|
||||
.. _mj_fullM:
|
||||
|
||||
Convert sparse inertia matrix ``M`` into full (i.e. dense) matrix.
|
||||
|br| ``dst`` must be of size ``nv x nv``, ``M`` must be of the same size as ``mjData.qM``.
|
||||
|br| ``dst`` must be of size ``nv x nv``, ``M`` must be of the same structure as ``mjData.qM``.
|
||||
|
||||
The ``mjData`` members ``qM`` and ``M`` represent the same matrix in different formats; the former is unique to
|
||||
MuJoCo, the latter is standard Compressed Sparse Row (lower triangle only). The :math:`L^T D L` factor of the inertia
|
||||
matrix ``mjData.qLD`` uses the same CSR format as ``mjData.M``. See
|
||||
`engine_support_test <https://github.com/google-deepmind/mujoco/blob/main/test/engine/engine_support_test.cc>`__ for
|
||||
pedagogical examples.
|
||||
|
||||
.. _mj_mulM:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user