Hello everyone, I have one more question: what is the actual order of the matrix, which I am getting with 'mj_jacBody'? It has the dimension of 3 x nv, which is the number of degrees of freedom (so the number of 'joint' elements in .xml file, please correct me if I am wrong.). Does it mean, that the rows in the 'jacp' matrix correspond to the order of the joints in the .xml file, exactly as 'qpos' does? Because from my current observations it does not seem like it. I am getting the non-zero values for the joint which are higher in the tree, than the element, which I define as 'body' in 'mj_jacBody' function. Maybe something is wrong in the mujoco-py implementation, which I am using... But it is just calling the original Mujoco C++ functions, so I am wanted to ask on the original forum to make sure.

Ok, I got this... I read the flattened out matrix incorrectly. Simple reshape to size (3, -1) has exposed the actual structure of the matrix. Quite embarrassing... Everything is working as expected.