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

Calculating inertia for a vehicle robot

asked 2019-10-02 20:41:24 -0600

horseatinweeds gravatar image

I'm trying to set the inertia for this Ackermann vehicle robot. I'm trying to model the GEM e2 https://gem.polaris.com/en-us/e2/specs/

I'm using these equations: https://en.wikipedia.org/wiki/List_of...

It seems pretty straight forward. I'm using meters and kilograms. However, in Gazebo when I use the View Inertia option -- to see the pink rectangles representing the inertia -- it's way bigger than the robot.

Am I missing something important???

Here is how I'm calculating inertia. I've tried it a few different ways:

    <!--<macro name="box_inertia" params="m x y z">
        <inertia  ixx="${m*(z*z+x*x)/12}" ixy = "0" ixz = "0"
                  iyy="${m*(y*y+x*x)/12}" iyz = "0"
                  izz="${m*(y*y+z*z)/12}" /> 
    </macro>
  <macro name="box_inertia" params="x y z mass">
      <inertia ixx="${0.0833333 * mass * (y*y + z*z)}" ixy="0.0" ixz="0.0"
        iyy="${0.0833333 * mass * (x*x + z*z)}" iyz="0.0"
        izz="${0.0833333 * mass * (x*x + y*y)}" />
  </macro>-->
  <macro name="box_inertia" params="x y z m">
        <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="cylinder_inirtia" 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>

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-03 04:17:57 -0600

aPonza gravatar image

The formulas seem correct (e.g. I used to have:

<!-- inertial -->
<xacro:macro name="box_inertial" params="m x y z">
  <intertial>
    <mass value="${m}"/>
    <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}"
    />
</intertial>
</xacro:macro>

so same as you unless xacro:macro instead of macro changes anything).

From the Gazebo tutorial:

You can temporarily set all the links to have a mass of 1.0 (by editing the URDF or SDF file). Then all the purple boxes should have more or less the same shapes as the bounding boxes of their links. This way you can easily detect problems like misplaced Center of Mass or wrongly rotated Inertia Matrix. Do not forget to enter the correct masses when you finish debugging.

It seems like you expect to see the bounding boxes of the links superimposed to the inertial ones, but for those you'd have to set the masses to 1.0 instead of the actual mass. Would that fix it?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-10-02 20:41:24 -0600

Seen: 867 times

Last updated: Oct 03 '19