Gazebo: Q&A Forum - RSS feedhttp://answers.gazebosim.org/questions/Open source question and answer forum for GazeboenCopyright Askbot, 2010-2011.Mon, 02 Feb 2015 13:44:35 -0600The inertia matrix explainedhttp://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/Hello.
I'd like to find some documentation about the inertia matrix in Gazebo/ROS (this topic is located in between).
Here is the ROS wiki page:
http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model
Basically, what I do not understand, is that the inertia matrix could not be independent from the mass. How a discrepancy between a dummy inertia matrix and the real inertia matrix could impact the simulation?
Thanks in advance for any doc that could help me to understand this part of the robot models.Tue, 17 Sep 2013 17:04:04 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/Answer by Martin Günther for <p>Hello.</p>
<p>I'd like to find some documentation about the inertia matrix in Gazebo/ROS (this topic is located in between).</p>
<p>Here is the ROS wiki page:</p>
<p><a href="http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model">http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model</a></p>
<p>Basically, what I do not understand, is that the inertia matrix could not be independent from the mass. How a discrepancy between a dummy inertia matrix and the real inertia matrix could impact the simulation?</p>
<p>Thanks in advance for any doc that could help me to understand this part of the robot models.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?answer=4374#post-id-4374I agree 100% with Adolfo's answer, especially that the identity matrix is a particularly bad choice. That tutorial *really* should be fixed. Some things to add:
You *must* give links an inertia matrix in the URDF, otherwise they (and their child links) won't be simulated.
It's important to give links an inertia matrix that is at least close to the correct order of magnitude. Otherwise, the simulation will be highly unrealistic. Imagine you used the identity matrix for the "head" link of your robot. This tells the simulation that the head has about the inertia of a large arm chair. So if you drive around in simulation and suddenly stop, your robot will (naturally) topple over.
If you use geometric primitives (box, cylinder, sphere) to model a link, and you assume equal distribution of mass, you can use wikipedia's [list of moment of inertia tensors](http://en.wikipedia.org/wiki/List_of_moment_of_inertia_tensors) to compute the correct matrix. I've created a couple of xacro macros that do this automatically: [common.xacro](https://github.com/uos/uos_tools/blob/fuerte/uos_common_urdf/common.xacro).
If you use CAD models to model a link, you can use Meshlab to compute the inertia tensor (again, assuming equal distribution of mass):
- View -> Show Layer Dialog
- Filters -> Quality Measures and Computations -> Compute Geometric Measures
Unfortunately, this usually gives a matrix that is rounded to all zeroes, so you might have to scale up your model, compute the inertia tensor, and divide the result by an appropriate factor.Wed, 18 Sep 2013 03:38:29 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?answer=4374#post-id-4374Comment by Markus Bader for <p>I agree 100% with Adolfo's answer, especially that the identity matrix is a particularly bad choice. That tutorial <em>really</em> should be fixed. Some things to add:</p>
<p>You <em>must</em> give links an inertia matrix in the URDF, otherwise they (and their child links) won't be simulated.</p>
<p>It's important to give links an inertia matrix that is at least close to the correct order of magnitude. Otherwise, the simulation will be highly unrealistic. Imagine you used the identity matrix for the "head" link of your robot. This tells the simulation that the head has about the inertia of a large arm chair. So if you drive around in simulation and suddenly stop, your robot will (naturally) topple over.</p>
<p>If you use geometric primitives (box, cylinder, sphere) to model a link, and you assume equal distribution of mass, you can use wikipedia's <a href="http://en.wikipedia.org/wiki/List_of_moment_of_inertia_tensors">list of moment of inertia tensors</a> to compute the correct matrix. I've created a couple of xacro macros that do this automatically: <a href="https://github.com/uos/uos_tools/blob/fuerte/uos_common_urdf/common.xacro">common.xacro</a>.</p>
<p>If you use CAD models to model a link, you can use Meshlab to compute the inertia tensor (again, assuming equal distribution of mass):</p>
<ul>
<li>View -> Show Layer Dialog</li>
<li>Filters -> Quality Measures and Computations -> Compute Geometric Measures</li>
</ul>
<p>Unfortunately, this usually gives a matrix that is rounded to all zeroes, so you might have to scale up your model, compute the inertia tensor, and divide the result by an appropriate factor.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=5783#post-id-5783Thanks for that xacos, nice work.
But I have a question, because you have two versions with and without origin. The without version has the orgion at <0 0 0> does this mean the centre of mass is not at the centre?
e.g. If I like to use your macros for a box with the centre in the centre of the object. So I have to use the box_inertial_with_origin with the origin at (x y z)/2?Mon, 31 Mar 2014 04:11:18 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=5783#post-id-5783Comment by Arn-O for <p>I agree 100% with Adolfo's answer, especially that the identity matrix is a particularly bad choice. That tutorial <em>really</em> should be fixed. Some things to add:</p>
<p>You <em>must</em> give links an inertia matrix in the URDF, otherwise they (and their child links) won't be simulated.</p>
<p>It's important to give links an inertia matrix that is at least close to the correct order of magnitude. Otherwise, the simulation will be highly unrealistic. Imagine you used the identity matrix for the "head" link of your robot. This tells the simulation that the head has about the inertia of a large arm chair. So if you drive around in simulation and suddenly stop, your robot will (naturally) topple over.</p>
<p>If you use geometric primitives (box, cylinder, sphere) to model a link, and you assume equal distribution of mass, you can use wikipedia's <a href="http://en.wikipedia.org/wiki/List_of_moment_of_inertia_tensors">list of moment of inertia tensors</a> to compute the correct matrix. I've created a couple of xacro macros that do this automatically: <a href="https://github.com/uos/uos_tools/blob/fuerte/uos_common_urdf/common.xacro">common.xacro</a>.</p>
<p>If you use CAD models to model a link, you can use Meshlab to compute the inertia tensor (again, assuming equal distribution of mass):</p>
<ul>
<li>View -> Show Layer Dialog</li>
<li>Filters -> Quality Measures and Computations -> Compute Geometric Measures</li>
</ul>
<p>Unfortunately, this usually gives a matrix that is rounded to all zeroes, so you might have to scale up your model, compute the inertia tensor, and divide the result by an appropriate factor.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4384#post-id-4384Thank you for this useful information about the inertia tensor.Wed, 18 Sep 2013 14:07:45 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4384#post-id-4384Comment by Martin Günther for <p>I agree 100% with Adolfo's answer, especially that the identity matrix is a particularly bad choice. That tutorial <em>really</em> should be fixed. Some things to add:</p>
<p>You <em>must</em> give links an inertia matrix in the URDF, otherwise they (and their child links) won't be simulated.</p>
<p>It's important to give links an inertia matrix that is at least close to the correct order of magnitude. Otherwise, the simulation will be highly unrealistic. Imagine you used the identity matrix for the "head" link of your robot. This tells the simulation that the head has about the inertia of a large arm chair. So if you drive around in simulation and suddenly stop, your robot will (naturally) topple over.</p>
<p>If you use geometric primitives (box, cylinder, sphere) to model a link, and you assume equal distribution of mass, you can use wikipedia's <a href="http://en.wikipedia.org/wiki/List_of_moment_of_inertia_tensors">list of moment of inertia tensors</a> to compute the correct matrix. I've created a couple of xacro macros that do this automatically: <a href="https://github.com/uos/uos_tools/blob/fuerte/uos_common_urdf/common.xacro">common.xacro</a>.</p>
<p>If you use CAD models to model a link, you can use Meshlab to compute the inertia tensor (again, assuming equal distribution of mass):</p>
<ul>
<li>View -> Show Layer Dialog</li>
<li>Filters -> Quality Measures and Computations -> Compute Geometric Measures</li>
</ul>
<p>Unfortunately, this usually gives a matrix that is rounded to all zeroes, so you might have to scale up your model, compute the inertia tensor, and divide the result by an appropriate factor.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4375#post-id-4375I've updated the tutorial.Wed, 18 Sep 2013 04:08:50 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4375#post-id-4375Comment by Adolfo Rodríguez T for <p>I agree 100% with Adolfo's answer, especially that the identity matrix is a particularly bad choice. That tutorial <em>really</em> should be fixed. Some things to add:</p>
<p>You <em>must</em> give links an inertia matrix in the URDF, otherwise they (and their child links) won't be simulated.</p>
<p>It's important to give links an inertia matrix that is at least close to the correct order of magnitude. Otherwise, the simulation will be highly unrealistic. Imagine you used the identity matrix for the "head" link of your robot. This tells the simulation that the head has about the inertia of a large arm chair. So if you drive around in simulation and suddenly stop, your robot will (naturally) topple over.</p>
<p>If you use geometric primitives (box, cylinder, sphere) to model a link, and you assume equal distribution of mass, you can use wikipedia's <a href="http://en.wikipedia.org/wiki/List_of_moment_of_inertia_tensors">list of moment of inertia tensors</a> to compute the correct matrix. I've created a couple of xacro macros that do this automatically: <a href="https://github.com/uos/uos_tools/blob/fuerte/uos_common_urdf/common.xacro">common.xacro</a>.</p>
<p>If you use CAD models to model a link, you can use Meshlab to compute the inertia tensor (again, assuming equal distribution of mass):</p>
<ul>
<li>View -> Show Layer Dialog</li>
<li>Filters -> Quality Measures and Computations -> Compute Geometric Measures</li>
</ul>
<p>Unfortunately, this usually gives a matrix that is rounded to all zeroes, so you might have to scale up your model, compute the inertia tensor, and divide the result by an appropriate factor.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4377#post-id-4377Very well written. I hope this clarifies the confusion in the tutorial.Wed, 18 Sep 2013 04:25:51 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4377#post-id-4377Answer by Adolfo Rodríguez T for <p>Hello.</p>
<p>I'd like to find some documentation about the inertia matrix in Gazebo/ROS (this topic is located in between).</p>
<p>Here is the ROS wiki page:</p>
<p><a href="http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model">http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model</a></p>
<p>Basically, what I do not understand, is that the inertia matrix could not be independent from the mass. How a discrepancy between a dummy inertia matrix and the real inertia matrix could impact the simulation?</p>
<p>Thanks in advance for any doc that could help me to understand this part of the robot models.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?answer=4373#post-id-4373The inertia tensor encodes the **mass distribution** of a body, so it *does* depend on the mass, but also on where it is located.
The URDF tutorial you point to states that
> "If unsure what to put, the identity matrix is a good default."
I highly disagree with this statement, as there is no one-size-fits-all inertia. In fact, this value will probably be too large for most links used in human-sized robots (or smaller). In my experience, heavier mobile base links (in the 50kg-100kg range) have inertias that fall within this order of magnitude, but almost all other smaller links (belonging to arms, legs, heads) have inertias that are between two and five orders of magnitude smaller.
That being said, this statement is only saying that for a given mass, you're assuming a fictitious mass distribution the yields the identity. Although it may seem unrealistic, it is possible to distribute mass so that a desired matrix results.Wed, 18 Sep 2013 02:50:21 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?answer=4373#post-id-4373Comment by Adolfo Rodríguez T for <p>The inertia tensor encodes the <strong>mass distribution</strong> of a body, so it <em>does</em> depend on the mass, but also on where it is located.</p>
<p>The URDF tutorial you point to states that</p>
<blockquote>
<p>"If unsure what to put, the identity matrix is a good default."</p>
</blockquote>
<p>I highly disagree with this statement, as there is no one-size-fits-all inertia. In fact, this value will probably be too large for most links used in human-sized robots (or smaller). In my experience, heavier mobile base links (in the 50kg-100kg range) have inertias that fall within this order of magnitude, but almost all other smaller links (belonging to arms, legs, heads) have inertias that are between two and five orders of magnitude smaller.</p>
<p>That being said, this statement is only saying that for a given mass, you're assuming a fictitious mass distribution the yields the identity. Although it may seem unrealistic, it is possible to distribute mass so that a desired matrix results.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4387#post-id-4387Martin already updated it. The link is in the original question.Thu, 19 Sep 2013 04:04:16 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4387#post-id-4387Comment by hsu for <p>The inertia tensor encodes the <strong>mass distribution</strong> of a body, so it <em>does</em> depend on the mass, but also on where it is located.</p>
<p>The URDF tutorial you point to states that</p>
<blockquote>
<p>"If unsure what to put, the identity matrix is a good default."</p>
</blockquote>
<p>I highly disagree with this statement, as there is no one-size-fits-all inertia. In fact, this value will probably be too large for most links used in human-sized robots (or smaller). In my experience, heavier mobile base links (in the 50kg-100kg range) have inertias that fall within this order of magnitude, but almost all other smaller links (belonging to arms, legs, heads) have inertias that are between two and five orders of magnitude smaller.</p>
<p>That being said, this statement is only saying that for a given mass, you're assuming a fictitious mass distribution the yields the identity. Although it may seem unrealistic, it is possible to distribute mass so that a desired matrix results.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4379#post-id-4379Adolfo, can you point me to the tutorial (or feel free to update it)? I think more appropriately it should say: "...the identity matrix is unrealistic but a good default for stable dynamics especially when using LCP solvers such as ODE or Bullet.". Thanks.Wed, 18 Sep 2013 12:26:30 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4379#post-id-4379Comment by Arn-O for <p>The inertia tensor encodes the <strong>mass distribution</strong> of a body, so it <em>does</em> depend on the mass, but also on where it is located.</p>
<p>The URDF tutorial you point to states that</p>
<blockquote>
<p>"If unsure what to put, the identity matrix is a good default."</p>
</blockquote>
<p>I highly disagree with this statement, as there is no one-size-fits-all inertia. In fact, this value will probably be too large for most links used in human-sized robots (or smaller). In my experience, heavier mobile base links (in the 50kg-100kg range) have inertias that fall within this order of magnitude, but almost all other smaller links (belonging to arms, legs, heads) have inertias that are between two and five orders of magnitude smaller.</p>
<p>That being said, this statement is only saying that for a given mass, you're assuming a fictitious mass distribution the yields the identity. Although it may seem unrealistic, it is possible to distribute mass so that a desired matrix results.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4383#post-id-4383Thanks for your answer. I've been confused by the way the tutorial was written.Wed, 18 Sep 2013 14:06:36 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=4383#post-id-4383Answer by peci1 for <p>Hello.</p>
<p>I'd like to find some documentation about the inertia matrix in Gazebo/ROS (this topic is located in between).</p>
<p>Here is the ROS wiki page:</p>
<p><a href="http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model">http://wiki.ros.org/urdf/Tutorials/Adding%20Physical%20and%20Collision%20Properties%20to%20a%20URDF%20Model</a></p>
<p>Basically, what I do not understand, is that the inertia matrix could not be independent from the mass. How a discrepancy between a dummy inertia matrix and the real inertia matrix could impact the simulation?</p>
<p>Thanks in advance for any doc that could help me to understand this part of the robot models.</p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?answer=6923#post-id-6923I've created a tutorial explaining step-by-step how to estimate the inertia matrix of your robot from 3D models using Meshlab.
It is based on the same ideas @Martin Günther has in the end of his answer.
[http://gazebosim.org/tutorials?tut=inertia&cat=build_robot](http://gazebosim.org/tutorials?tut=inertia&cat=build_robot)Fri, 29 Aug 2014 04:52:33 -0500http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?answer=6923#post-id-6923Comment by culletom for <p>I've created a tutorial explaining step-by-step how to estimate the inertia matrix of your robot from 3D models using Meshlab.</p>
<p>It is based on the same ideas <a href="/users/22/martin-gunther/">@Martin Günther</a> has in the end of his answer.</p>
<p><a href="http://gazebosim.org/tutorials?tut=inertia&cat=build_robot"></a><a href="http://gazebosim.org/tutorials?tut=inertia&cat=build_robot">http://gazebosim.org/tutorials?tut=inertia&cat=build_robot</a></p>
http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=7921#post-id-7921Hi, thanks for the step-by-step tutorial, it has been very helpful. I just have one question regarding the inertia tensor - considering its SI unit is kg.m^2, I wondering if I also have to multiply the produced inertia tensor by twice the ratio of meshlab units to meters (similar to what is done to calculate the center of mass in the previous step)? This would be in addition to multiplying the inertia tensor by 1/s^2 (where s is the reciprocal of the scale used for upscaling)Mon, 02 Feb 2015 13:44:35 -0600http://answers.gazebosim.org/question/4372/the-inertia-matrix-explained/?comment=7921#post-id-7921