Contacts between geometries

Discussion in 'Simulation' started by Feryal, Jun 9, 2015.

  1. We are currently using MuJoCo Version 0.5.0 to simulate contacts between multiple objects. In our simulations only a single contact per time step is returned between a pair of geometries, even while they are stacked on top of each other. We were wondering whether there is a way to retrieve all the contact points between geometries at a particular time step?
     
  2. Vikash Kumar

    Vikash Kumar Guest

    Version 0.0.5 is obsolete. We strongly recommend you to upgrade to latest version of Mujoco available on the downloads page.

    There is no way for us to reproduce the problem at our end but if you can send your model file, I'll be happy point out anything that's obvious to the eye. Do mention relevant details like - api (source/lib/mex) in use, platform(windows/Linux/Mac) and the way you are retrieving the contacts.
     
  3. Emo Todorov

    Emo Todorov Administrator Staff Member

    To be more precise, we recommend downloading the latest version when it becomes available for download :) Right now only the socket-API version is available.

    Regardless of the version, MuJoCo always uses convex geoms for collision, so you should in general expect a single contact per pair. There are specialized functions that return multiple contacts (box-plane for example can return 4) but the general mesh collider uses the Mink0wski Portal Refinement (MPR) algorithm which returns a single contact.

    Note that you can attach multiple geoms to the same body. In this way you can model bodies with arbitrary geometry; for example you can decompose a non-convex mesh into a union of convex meshes, load them as separate geoms and attach all of them to the same body.

    The engine is not hiding/filtering any contacts. mjData.contact contains all the contacts that were detected. The reason you get different contacts at different time steps is because convex geometries stacked on top of each other tend to wobble -- in which case the single contact point can move rapidly. We are considering an improvement to the MPR algorithm that will hopefully address this wobbling issue. But in the meantime, simply attach more than one geom to the same body.
     
  4. Thank you for the replies.

    We also thought about fixing this issue by attaching multiple geometries to the same body. However, we are getting the following error when we try to add more than 70 geometries within a given simulation:

    " Warning: could not add contact, Jacobian full "

    We were wondering whether this is a hard limit which cannot be surpassed?
     
  5. Vikash Kumar

    Vikash Kumar Guest

    There are ways to increase the max jacobian sizes in Mujoco. Export the mjcf schema using the version of Mujoco you have and look for the attribute called 'njmax' under <size/>.

    Please respond with the exported schema and your model file for a detailed response.
     
    Last edited by a moderator: Jun 16, 2015