Auto Inertia Computation #318
Replies: 3 comments 2 replies
-
Quoting the documentation:
So hollow objects, like a vase, would be likely badly approximated. I'm actually quite curious to know how bad the approximation is. If the algorithm, implemented here uses a signed volume, one would expect a hollow convex shape, like a hollow cube, to produce exact results; but I have not tested this. If you feel like testing what inertia you get for a centred hollow-convex shape of known inertia (the inertia of a hollow box is just the difference of inertias of the uniform box and the inertia of box taken from the "hole"), that would be grand. |
Beta Was this translation helpful? Give feedback.
-
I tested it using this Rotational Inertia: The Race Between a Ring and a Disc. Seems like the hollow object's inertia auto-generated correctly. But I haven't checked the distance vs time, etc to actually verify if it is correct. I chose the disc vs ring since there is a direct observable difference between the two as shown in the video. If you have another test in mind please suggest it, I would gladly test it out. For this expt:
I have a question regarding the expt:
Xml and MeshesMeshes: <mujoco>
<option gravity="0 0 -9.81" timestep="0.002" />
<asset>
<mesh name="Ring" file="./hollow_ring.stl" scale=".001 .001 .001" />
<mesh name="Disc" file="./solid_ring.stl" scale=".001 .001 .001" />
</asset>
<worldbody>
<geom type="plane" size="10 10 0.1" pos="0 0 -0.5" euler="10 0 0" />
<light diffuse=".5 .5 .5" pos="0 0 3" dir="0 0 -1" />
<body name="Ring" pos="1 0 0" euler="0 90 0">
<joint type="free" />
<geom type="mesh" mesh="Ring" rgba=".3 .7 .1 1" mass="1.0" />
</body>
<body name="Disc" pos="0 0 0" euler="0 90 0">
<joint type="free" />
<geom type="mesh" mesh="Disc" rgba=".6 .7 .5 1" mass="1.0" />
</body>
</worldbody>
</mujoco> Python fileimport mujoco
from mujoco_viewer import MujocoViewer # pip install mujoco-python-viewer
model = mujoco.MjModel.from_xml_path(
"assets/misc/rolling_rings/rolling_rings.xml"
)
data = mujoco.MjData(model)
viewer = MujocoViewer(model, data)
while True:
mujoco.mj_step(model, data)
viewer.render() TestVideomujoco_rolling_disc_vs_ring.mp4Directly observable differences here: |
Beta Was this translation helpful? Give feedback.
-
In order for this to be precise, we need to use shapes which are not polyhedral approximations of smooth geometries. You can do the following:
Thanks for this! As a side note, an easy feature to add would be a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
By default, does mujoco support auto inertia computation from an STL file loaded as a body? Like a hollow vase? (assuming uniform density)
Beta Was this translation helpful? Give feedback.
All reactions