body with mesh geom fits through hole slightly smaller than it (issue with collision detection?) #3000
-
IntroHi! I am an independent ML researcher. I am using MuJoCo to evaluate frontier LLMs' ability to solve practical CAD problems. My setupmujoco 3.4.0, Python 3.13, macOS on Apple Silicon My questionI've noticed that in some cases MuJoCo allows an object to pass through a hole slightly smaller than the object. Both the object and the hole have geoms that are defined by meshes (not sure if this matters). I created a simplified repro here where a ball is dropped into a "funnel" made of 3 rectangular prisms. The ball's diameter is 1% too large to pass through the bottleneck of the funnel and yet in the simulation the ball falls through the funnel. Why does this happen? I imagine it is either due to a misconfiguration on my part (I'm new to MuJoCo) or a limitation / design tradeoff baked into MuJoCo. Is there a setting I can change to make this simulation work properly?
Minimal model and/or code that explain my questionConfirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
Your gravity is 10x larger than it should be, which explains why it falls through. If you set it to -9.81 the ball does not fall through. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the response! -98.1 is the correct value for gravity if one unit in MuJoCo corresponds to 100 cm in real life. I agree the example is clearer if I instead scale everything so that one unit in MuJoCo corresponds to 1 m; I've pushed that change. The ball still unexpectedly passes through the funnel. |
Beta Was this translation helpful? Give feedback.
-
|
My bad didn't notice that. I played around with your model a bit, and hardening the contact and adding noslip seems to solve it. <mujoco>
<option timestep="0.002" noslip_iterations="2" noslip_tolerance="0"/>
<asset>
<mesh file="funnel_piece_0.stl" scale="0.01 0.01 0.01"/>
<mesh file="funnel_piece_120.stl" scale="0.01 0.01 0.01"/>
<mesh file="funnel_piece_240.stl" scale="0.01 0.01 0.01"/>
<mesh file="ball.stl" scale="0.01 0.01 0.01"/>
</asset>
<worldbody>
<light name="top" pos=".1 0 1"/>
<body name="ball">
<geom type="mesh" mesh="ball" name="ball" rgba="0 1 0 1" friction="0.75 0.00375 0.000075" solref="0.004 1"/>
<freejoint name="object"/>
</body>
<body name="funnel">
<geom type="mesh" mesh="funnel_piece_0" rgba="1 0 0 1" friction="0.75 0.00375 0.000075"/>
<geom type="mesh" mesh="funnel_piece_120" rgba="1 0 0 1" friction="0.75 0.00375 0.000075"/>
<geom type="mesh" mesh="funnel_piece_240" rgba="1 0 0 1" friction="0.75 0.00375 0.000075"/>
</body>
</worldbody>
</mujoco>But let's ask @yuvaltassa for his input :) |
Beta Was this translation helpful? Give feedback.

My bad didn't notice that. I played around with your model a bit, and hardening the contact and adding noslip seems to solve it.