Model Inaccuracies/Problems

Discussion in 'Support requests' started by rafaelp, Jul 3, 2019.

  1. Hello,

    We have an issue with our robot model in MuJoCo. We get unrealistic physics predictions with this model. I am attaching a demo code to reproduce the problem (more details below).

    In this demo, we have a simple, planar, gripper as the robot.

    How to run the demo:
    • Go into to the directory, copy a mjkey.txt license there.
    • Run make.
    • Run ./bin/basic models/scene.xml
    You can move the robot using the keys "w", "s", "a", "d" and to control the gripper using "c" and "o".

    If you move the robot towards one of the objects trying to push it with the tip of the gripper's finger you will see that sometimes the objects are not reacting realistically (for example pushing one of the objects to its edge that should have as a result the object to fall into the gripper, the object instead moves away from the gripper).

    Also, if you push one object against the shelf/wall you will see some penetration. This penetration also happens if you move the robot with constant velocity against the wall. This is also a problem when planning or when the robot is moving with high velocities sometimes it's penetrating with objects unexpectedly (i.e., if the robot is moving in free space with high velocities against an object, the robot penetrates the object).

    Why do we get these inaccuracies? Is there something wrong with our model?

    The file is larger than the size limit due to the STL files of the robot, here is a link to the sample code.

    Thank you in advance for your time.
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    I did not run your code, but looking at the model, here are some suggestions:

    Try making the contacts harder and the time step smaller. This will reduce penetrations. In general, if objects are moving fast relative to the time step, you can expect significant penetrations in a single time step. The simulator will then generate contact forces against the penetration.

    The side walls should be made thicker, to avoid objects going through them (similar reasons as above).

    If you enable contact visualization, you will see that each cylinder-table contact is a single contact point running around rapidly. If you use a plane instead of a box for the horizontal surface, this contact will behave much better. You can still render the plane as a rectangular patch with the desired dimensions. This is not likely to be causing the specific problems you mentioned, but is good practice in general.
    rafaelp likes this.