Closed sibocw closed 1 month ago
Hi @sibocw, it looks like this issue comes from mujoco mesh preprocessing algorithm
Positioning and orienting is complicated by the fact that vertex data in the source asset are often relative to coordinate frames whose origin is not inside the mesh. In contrast, MuJoCo expects the origin of a geom’s local frame to coincide with the geometric center of the shape. We resolve this discrepancy by pre-processing the mesh in the compiler, so that it is centered around (0,0,0) and its principal axes of inertia are the coordinate axes. We save the translation and rotation offsets applied to the source asset in mjModel.mesh_pos and mjModel.mesh_quat; these are required if one reads vertex data from the source and needs to re-apply the transform.
If you specify inertial properties of the thorax manually, it makes axes look ok. Probably you can use mjModel.mesh_quat to correct axes orientation, or maybe it makes sense to just create a dummy toplevel body and read its position/oriantaion instead of "Thorax".
Thank you @stepanove for this information! It's really helpful. I have fixed this issue in #219 .
You're welcome @sibocw, I'm glad to be of help :)
See #214. Two things are unclear to me:
My guess is that these have to do with how the model is configured in Blender, but I'm deferring it because it's still functional and changing it will break backward compatibility. In the meantime, help is greatly appreciated.
For reference, here's the mesh file for the thorax and the issues above do not seem to be present in the Mesh file as (based on my understanding of how MeshLab visualizes bodies, screenshot below).
Thorax.zip