How to represent geometry correctly #2351
-
IntroHi! I am an graphic engineer, I use MuJoCo for developing an Embedded AI simulator. My setupLatest Mujoco 3.2.6 My questionBackground
<geom mesh="coffee_cup0" material="coffee_cup0" class="coffee_cup0_visual"/>
<geom name="coffee_cup0_collision1" class="coffee_cup0_collision" type="mesh" mesh="coffee_cup0"/>
<geom mesh="coffee_cup0" material="coffee_cup0" class="coffee_cup0_visual"/>
<geom name="coffee_cup0_collision1" class="coffee_cup0_collision" type="cylinder" size="0.035 0.07" pos="0.0 0.07 0.0" quat="1 1 0 0"/> How to balance
Minimal model and/or code that explain my questionIf you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue). Model: minimal XML<mujoco>
<worldbody>
<light pos="0 0 1"/>
<geom type="sphere" size="1" rgba="1 0 0 1"/>
</worldbody>
</mujoco>
Code: import mujoco
import mediapy as media
model = mujoco.MjModel.from_xml_string(xml)
data = mujoco.MjData(model)
with mujoco.Renderer(model) as renderer:
mujoco.mj_forward(model, data)
renderer.update_scene(data)
media.show_image(renderer.render()) Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, You correctly identified most of the approaches (Decomposition, SDF, Custom primitive, solver configurations). The main limitation of mesh-mesh contacts is that a single contact point is calculated. (Compared to e.g. box on a plane where 4 contacts are active). Here are a couple more considerations:
Do also check out the |
Beta Was this translation helpful? Give feedback.
Hello,
You correctly identified most of the approaches (Decomposition, SDF, Custom primitive, solver configurations). The main limitation of mesh-mesh contacts is that a single contact point is calculated. (Compared to e.g. box on a plane where 4 contacts are active). Here are a couple more considerations:
Decomp with primitives: You may want to take a look at the mug example model from the release folder, decomposition with boxes might work better than stacked cylinders (although there will be some gaps since the coffee cup walls are not parallel)
SDF: As far as SDFs go, this a reasonable shape to approximate. If the approach interests you, it would be a good choice as there are trun…