URDF-Importer icon indicating copy to clipboard operation
URDF-Importer copied to clipboard

How Can I read in Unity the maximun velocity of each joint?

Open marcoojer opened this issue 3 years ago • 3 comments

Hi I want to read the maximum velocity of a joint specified in my urdf, in the unity loaded gameobject.

I'm trying with the value of articualtionBody.MaxAngularJoint and is giving me a value of 7 which is the default one, instead of the ones specified in the urdf.

Anyone one knows how to do it?

Thanks in advance!!

marcoojer avatar Feb 25 '22 09:02 marcoojer

Hi @marcoojer!

To get the maximum velocity of your joints from the loaded GameObject, you should be able to use these APIs: ArticulationBody.maxAngularVelocity ArticulationBody.maxLinearVelocity These correspond to the APIs used by urdf-importer to set the max velocities.

Let us know if it works for you!

sarah-gibson avatar Mar 02 '22 17:03 sarah-gibson

[AIRO-1796]

vidurvij-Unity avatar Mar 10 '22 13:03 vidurvij-Unity

Thank you for the answer and sorry for delay in the response. However, I'm loading a urdf with some primatic joint which is like that <joint name="joint_base_finger_2" type="prismatic"> <origin rpy="0 0 0" xyz="0 0 0"/> <parent link="base_tool"/> <child link="base_finger_2"/> <axis xyz="1 0 0"/> <limit effort="140" lower="0" upper="0.025" velocity="0.04166666666666667"/> </joint>

but when I print the ArticulationBody.maxLinearVelocity of the joints it output a value of 100, which I suppose is the default value. Didn't it should be 0.04166?

marcoojer avatar Oct 17 '22 12:10 marcoojer