Stabilizing collisions

Discussion in 'Priority support' started by Peter W, Jan 6, 2020.

  1. Do you have any advise on how to debug this, pretty simple, environment with a cylinder falling down on a block and getting stuck in it?

    <mujoco>
    <option timestep="0.001"/>
    <worldbody>
    <body name="table">
    <geom name="table" size="0.2 0.2 0.2" type="box" />
    </body>
    <body name="cylinder" pos="0 0 0.6">
    <geom rgba="0.4 0.8 0.4 1.0" size="0.1 0.01" type="cylinder" />
    <joint type="free" />
    </body>
    </worldbody>
    </mujoco>


    The above model works fine, but if I change the position of the cylinder just slightly off-center, to e.g. pos="0.01 0 0.6", then half of the cylinder gets stuck in the block.

    What parameters do you recommend tuning in situations like this? I did play around a bit with the timestep, but to no avail.
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You could add this:

    <default>
    <geom solref="0.01 1.1"/>
    </default>

    It makes contacts a bit stiffer and more damped compared to the default. See explanation of parameters here:

    http://www.mujoco.org/book/modeling.html#CContact

    If you enable contact point rendering (press C in the simulator), you will notice that cylinder-box collisions involve a single contact which is running around like crazy trying to prevent penetrations everywhere. Cylinder-plane is much better behaved. There is a plan to do something about these collision situations in the next release. The contact softness/stability and collision detection are in principle orthogonal, but this single-contact property of convex collisions is affecting stability and contact dynamics indirectly.
     
  3. Thanks! Even with the solref changes, the cylinder sinks in a bit. But as you recommended, a plane behaves better than the box. So I ended up placing a plane on top of the box for now.