Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question ArticulationBody with multiple parents

Discussion in 'Physics Previews' started by SimonCVintecc, Jul 2, 2020.

  1. SimonCVintecc

    SimonCVintecc

    Joined:
    Jun 4, 2019
    Posts:
    8
    The new ArticulationBody component is a much needed addition to enable stable physics joints for simulating machinery.

    However, I have some cases where a single body should be connected to multiple parent bodies (see attached image). As far as I know, this is currently not supported.
    Is there a workaround? Is it something that is planned to be added in future releases?


    In the attached image, the lower (blue) frame is suspended by two (red) hinges to an upper (blue) horizontal bar. The lower frame swings, depending of the orientation of the whole machine, and should stabilize itself.
     

    Attached Files:

    • DMS.JPG
      DMS.JPG
      File size:
      40.1 KB
      Views:
      499
  2. SimonCVintecc

    SimonCVintecc

    Joined:
    Jun 4, 2019
    Posts:
    8
    It would be great to get some feedback on this ;)
     
  3. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,495
    Yes, I'd love to know more as well. Summoning @yant... ;)
     
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You can't have loops or multiple parents in articulations, it has to have tree like hierarchy. This isn't Unity or PhysX limitation either, it's basic limitation of the algorithm used on it.

    There is a workaround for this though and it is to connect articulation bodies with regular physx joints. You will not get similar level robustness for these connecting joints as you get for the articulation ones but with clever design you can probably minimize the negative impacts from this. Unity supports regular joint connections to articulations since 2020.2.0a15.

    As example, Nvidia did showcase dual wishbone vehicle suspension with articulations:

    Obviously this can't happen with pure articulation setup so one of the links on the suspension chain had to be a regular joint.
     
    newlife and Edy like this.
  5. SimonCVintecc

    SimonCVintecc

    Joined:
    Jun 4, 2019
    Posts:
    8
    Thanks for your tip for working around this limitation!
    Do you have by any chance a link to the example of the dual wishbone suspension you mention?
     
  6. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I dunno if there's some nvidia provided examples for this but they won't do you any good with Unity as you assemble things differently through Unity's physics wrappers anyway. Doing the basic setup for a thing like that should be pretty straight forward though.
     
  7. Ro-tico

    Ro-tico

    Joined:
    Jul 1, 2021
    Posts:
    1
    Is this still not supported?
     
  8. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Condering it's this way by design (as in, how the algorithm behind this works), why would it be any different now? :) This feature is essentially a wrapper for Physx functionality and there's no multiparent setup on their articulation.
     
  9. yangcookie_

    yangcookie_

    Joined:
    Sep 27, 2019
    Posts:
    10
    Is this still not supported?
     
  10. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    594
    Let me emphasise what @rz_0lento posted above. It's a current limitation of PhysX, directly inherited from the specifics of how Featherstone's forward dynamics work.
     
  11. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
    While this is technically true, PhysX provides a method to get around this: Here

    "Articulations are tree structures and do not support closed loops natively. PhysX can simulate closed loop systems by the use of joints. Additionally, contacts between links and other rigid bodies (e.g. the ground) can form loops if more than one link has contacts. These joints and contacts are solved by the rigid body solver during PhysX simulation, but it is often desirable to factor these constraints into inverse dynamics.

    To facilitate this, PhysX provides a mechanism to register loop constraints with the articulation:"
    Code (CSharp):
    1.  
    2. PxJoint* joint = ...;
    3.  
    4. articulation->addLoopJoint(joint);
    5.  
    6. articulation->removeLoopJoint(joint);
    I doubt Unity exposes that stuff though
     
  12. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    From my previous post in this thread (https://forum.unity.com/threads/articulationbody-with-multiple-parents.924014/#post-6141408):
     
  13. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
  14. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    943
    I have a similar situation/requirement. When connecting rigidbodies via fixed or hinge joint to articulationbodies, force that acts on the rigidbody doesn't seem to get transfered to the articulationbody, in my case this means drive input (prismatic type) on the articulation body that moves the rigidbody towards a collider makes the rigidbody somewhat stop at the collider, but without impeding the motion of the articulation body.

    https://i.imgur.com/Gjj7vKR.mp4

    Is there any workaround