Search Unity

Phantom forces on robotic arm, objects drifting apart after fixing pivot position.

Discussion in 'Physics' started by TBulbuc, May 19, 2020.

  1. TBulbuc

    TBulbuc

    Joined:
    Apr 30, 2020
    Posts:
    21
    Hi,

    I am working on a VR Unity project where a user controls a robotic arm to perform tasks. In the game, I need different sections(bicep, forearm, wrist, gripper) to rotate relative to one another. I imported some files from SolidWorks and I noticed the pivot positions where very far away from my actual object. I found online that you should be able to just parent your object to a empty object with the correct pivot position, which I have done.

    My situation is a little more complicated however, in that I have multiple prefabs ( one for bicep, one for forearm, etc) all which have their own rigidbody and configurable joints as well as a motor script. Since I need the different sections to rotate relative to one another, to correct the pivot positions I created empty objects for each the bicep, forearm, wrist and gripper and parented appropriately. However now, the different parts start to drift apart when I launch the game as if there is some phantom force being applied. The different parts move apart at different speeds ( because the mass of the bicep doesn't equal the mass of the forearm which doesn't equal the mass of the wrist, so on and so forth).

    No idea why this is happening/ideas how to correct this or if anyone has had similar issues. Right now, I moved the motor script from the original prefab into the prefab container, i.e. from Bicep to Bicep container, from Forearm to Forearm container, etc because the prefab containers have the correct pivot positions which I want to rotate about ( see image). I tried moving the rigidbody and configurable joints into the prefab containers as well but this didn't fix the issue. The motor script shouldn't be the issue as I have used the exact same script on the same arm in another scene which works fine.

    Maybe the issue is with how how I made the empty objects for each prefab. Maybe there is a better way to fix pivot positions for prefabs?

    Thanks in advance for any suggestions! Hierachy tree.JPG
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  4. TBulbuc

    TBulbuc

    Joined:
    Apr 30, 2020
    Posts:
    21
    Thanks @mgear and @JeffDUnity3D for the responses.

    To fix this, I had to manually move all the different models of each prefab to a position in which made the pivot position be located where I wanted and this seemed to help.

    Thanks for your suggestions.