Search Unity

Virtual Robot Simulation with Unity´s physic-engine

Discussion in 'Editor & General Support' started by Jokerminator, Oct 6, 2010.

  1. Jokerminator

    Jokerminator

    Joined:
    Jun 30, 2006
    Posts:
    258
    Hi,

    Is it possible to get joints (or in some other way) to work like servos of real robots ?
    --Like the software webots from cyberbotics seems to be able to do it..

    I tried to use configurable and hinge joints but it looks like they are not powerful enough to even make a robot stand..
    It is falling on the knees not able to lift it´s own weight. :(
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    It is possible to do this in principle but potentially very complicated. You can use the joint drive "motors" to move the limbs or you might find it easier to use rigidbody.AddForceAtPosition to push the limbs to create the effect of hydraulics.
     
  3. Jokerminator

    Jokerminator

    Joined:
    Jun 30, 2006
    Posts:
    258
    The motors are not strong enough even if I set the force to infinity.
    Use rigidbody.AddForceAtPosition could probabely work.. but I don´t want to use hydaulics.. --I want servos. :(
    To script a stable version of AddForceAtPosition that it works like a servo would take longer than to just test servos/legs in reality I guess.. --also because joints are just not stable enough to resist the forces.. :(

    Well than.. I´ll do it without simulating it in virtual space before.
     
    Last edited: Oct 8, 2010
  4. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,435
    I personally think that you would be better off just scripting the rotations for your servos rather than using physics. In the end the result will be much more accurate and realistic IMO.
     
  5. Jokerminator

    Jokerminator

    Joined:
    Jun 30, 2006
    Posts:
    258
    And how would you handle the collisions ? E.g. if a foot touches the ground..
     
  6. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,435
    You would use the physics engine for collisions and rigidbody functions, but use code to simulate servo movements / rotations.
     
  7. Jokerminator

    Jokerminator

    Joined:
    Jun 30, 2006
    Posts:
    258
    Thanks!
     
    Last edited: Jun 19, 2012
unityunity