Unintuitive physics of welded bodies

Discussion in 'Simulation' started by Alvaro, Jun 15, 2018.

  1. Hi!

    I was trying to weld some bodies together using a weld equality constraint. The weld works correctly in that it keeps the bodies together, however, it does not seem to simulate physics in the way that I expected.

    The specific example is with two bodies, each of them consisting of an elongated box geom. Each of the bodies only move within a 2-D plane with two slide joints, and a perpendicular rotate joint.
    Floor: -------
    Body 1: XXXXXXX
    Body 2: OOOOOOO

    If I arrange the objects like in an inverted L shape with a weld between the two bodies:

    OXXXXXXX
    O
    O
    O
    O


    --------------------

    The subsequent dynamics are just:

    OXXXXXXX
    O
    O
    O
    O
    --------------------


    Essentially, the L does not tip over, towards the right, as it should. Is this expected?

    I have checked multiple things:
    - Masses, center of masses, and inertia tensors seem fine.
    - If I remove the weld, both objects fall all the way to the floor as expected.
    - If I add a point obstacle that hits the X body as it is falling, the entire body rotates/tips (so it is not a problem with a missing degree of freedom).
    - If the point obstacle hits the X body exactly in the middle as it falls, it also stays stable on the obstacle (Also unintuitive).
    - If I provide some initial rotation to the L towards the right side, it will still not tip over until the center of mass of the O body stops being supported (at which point it does indeed tip over).

    Any idea what may be happening here? Any suggestions for how to solve it?

    I know I could make just both geoms to be in the same body, or the second body as a child of the first without joints. However, for my use case, I want to be able to enable/disable mid- simulation.

    Thanks :)