# Building URDF from scratch, how to calculate inertial values?

I've been stuck on this for a while. Most resources online point to complex equations even for the simplest of shapes. Surely there is some sort of software in which I can just build my robot and have it generate inertial values?

edit retag close merge delete

1

I don't know of any software that would "just" do this for you unfortunately. But to make sure: if you are not planning on using any sort of dynamic simulator (Gazebo, V-REP, etc), you don't need to specify any inertial properties.

Sort by » oldest newest most voted And I actually just make my inertial values the same as a box the same size as my collision shapes so the inertial values are just calculated using the formula lists for cuboids on this wikipedia page using the values from my collision boxes. Like that gazebo tutorial mentions, if you temporarily set mass = 1, you can view the inertial cube in gazebo and it should be the same as your collision cube.

This is close enough for most applications.

more

Check out the MyBot Tutorial and specifically its xacro file :

<macro name="cylinder_inertia" params="m r h">
<inertia  ixx="${m*(3*r*r+h*h)/12}" ixy = "0" ixz = "0" iyy="${m*(3*r*r+h*h)/12}" iyz = "0"
izz="${m*r*r/2}" /> </macro> <macro name="box_inertia" params="m x y z"> <inertia ixx="${m*(y*y+z*z)/12}" ixy = "0" ixz = "0"
iyy="${m*(x*x+z*z)/12}" iyz = "0" izz="${m*(x*x+z*z)/12}" />
</macro>

<macro name="sphere_inertia" params="m r">
<inertia  ixx="${2*m*r*r/5}" ixy = "0" ixz = "0" iyy="${2*m*r*r/5}" iyz = "0"
izz="\${2*m*r*r/5}" />
</macro>


These macroses are calculations for basic shapes and could be easily pulled into your project. But if you need inertias for some custom shapes, then you should look into some 3D modeling SW, they have capability to calculate necessary matrices for you.

more