ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange

# URDF link mass inertia properties

Hi
I'm building a URDF for rviz, and eventually Gazebo. I'm a bit confused about the best values to put in for the Inertia Origin and Moment of Inertia matrix.

Below you should see a screenshot of a robot shoulder in SolidWorks. (Right-click and open to see it in full size)
The origin is the tri-color axis, which I put there because it matches the link origin.
This means I should be able to specify the mesh visual origin as 0,0,0.

The pink axis is the Center of Mass found by SolidWorks.

The URDF XML doc: http://ros.informatik.uni-freiburg.de/roswiki/urdf(2f)XML(2f)inertial.html says the Inertial Origin should be the "Link Center of Mass".

So I could use the SolidWorks Center of Mass x,y,z co-ordinates as the Inertial Origin.
But I don't know which Ix,Px, Lxx, or Ixx values from SolidWorks to use?

Or, why can't I just set the Inertial Origin to 0,0,0 and use the very last set of values from SolidWorks: Ixx, Ixy, Ixz, etc.
Will Gazebo/ODE get confused because the Inertial Origin is not the Center of Mass of the link?

These two posts provided some info, but no complete explanation:

Thanks.

edit retag close merge delete

Sort by ยป oldest newest most voted

The origin of the inertial element of the URDF must be taken from the center of mass of the link. So the XYZ of the inertial origin is the offset from the link's origin to the center of mass. Currently, the orientation of the inertial element is assumed to match the orientation of link's origin and RPY for the inertial origin is not supported. Therefore if you were pulling values from SolidWorks mass properties, you should probably use the moment of inertia taken at the center of mass and aligned with the output coordinate system (Lxx).

However, a few caveats. Make sure the 'output coordinate system' you choose aligns with the coordinate system in the URDF. Many times in SW, the default coordinate system has Y pointing upward, but in URDF and Gazebo, Z is assumed to be pointing upward. Place your 'output coordinate system' by inserting a reference coordinate system in SolidWorks at either the origin location of the joint connecting this link with its parent link, or in the case of the base_link, place the output coordinate system at the collision/visual origin (typically the default origin for the model).

I'm going to toot my own horn here and plug the SolidWorks to URDF exporter for exactly this. Though, I realize answering this question four months after you asked it is of little help.

more