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

How to control angular velocity of ArticulationBody

Discussion in 'Robotics' started by simonezandara, Jun 19, 2022.

  1. simonezandara

    simonezandara

    Joined:
    Feb 20, 2021
    Posts:
    1
    Hello

    I am working on simulating a robotic arm. Very simple 3 DOF. I have some sort of pick and place solution where I am able to direct the robot EE to a target point in world frame.

    I am looking into simulating a gentle motion but somehow using the ArticulationBody I cannot really get to a state which makes sense. The arm is just too fast or not moving at all.

    If I slow down the movement through weaker stiffness then effect is that the arm is slower but it won't get to the target I am setting. ie. I give
    xDrive.target = 180
    but it stops at 175 (it works properly with higher stiffness).

    I tried various combination of Linear/Angular Damping and Friction as well.

    I have also tried setting
    ArticulationBody.maxAngularVelocity
    but nothing seems to be affecting the speed in a decent way.

    I am aware of this page https://github.com/Unity-Technologi...ppendix.md#guide-to-write-your-own-controller but honestly it's not very intuitive. I worked with robotics controllers before and it's common to be able to control the max velocity.

    This is how I am setting the targets

    Code (CSharp):
    1.                 var jointName = jointNamesFromROS[joint];
    2.                 var jointIndex = (int)jointPositionIndex[jointName];
    3.                 var joint1XDrive = jointArticulationBodies[jointIndex].xDrive;
    4.                 joint1XDrive.target = result[joint];
    5.                 jointArticulationBodies[jointIndex].xDrive = joint1XDrive;

    And here are some parameters I work with

    unity_thread.jpg
     
  2. ActiveSim

    ActiveSim

    Joined:
    May 10, 2019
    Posts:
    59
    I made the same experience. Staring with some reasonable values and changing them until the movement makes sense didn't lead to a good working solution.
    Writing your own controller and just AddTorque is one option, using another physics engine is another.