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

Is there any way to calculate inertial property of a robot to simulate it in Gazebo

asked 2011-09-28 06:33:03 -0500

VN gravatar image

I have got urdf/xacro files for pioneer3dx robot from "p2os" stack, modified them by replacing erratic_robot differential drive plugin and adding transmission for swivel and hubcap (which was not there as many reported a problem in visualizing swivel/hubcap in rviz). Then I tried to simulate pioneer3dx model in gazebo by using erratic_robot_teleop_keyboard node and also using navigation stack (by configuring yaml files).

My robot is behaving very strangely as it topples, lift backside up....etc. I am sure this is because of inertial properties provided in the model.

Is there any way to calculate these properties without estimating them by provide dimensions to any software then it 'll calculate for you??

Also I have model for schunk powercube arm but without any inertial properties. I don't think schunk 'll provide these information, I have to calculate myself to simulate it in gazebo.

Looking forward for a quick solution.

Thanks V.N.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-09-28 07:19:22 -0500

hsu gravatar image

One general rule of thumb I use for checking my inertia tensors is: If total mass of the rigid body is m, and the dimension of the corresponding body is d, then check to see if ixx, iyy, izz are near m*(d/2)^2.

This is by no means correct, but a sanity check to make sure the moment of inertia are the right order of magnitudes, so the model behaves somewhat physically realistically.

I've seen too many simulation where mass is 1(kg), and ixx,iyy,izz are also 1(kg*m^2), while the robot is only 10cm in diameter. This setup usually result in a robot that does not respond to rotational commands easily (given that izz of 1 means there is a 1kg mass at the end of a 1 meter pole).

edit flag offensive delete link more

answered 2011-09-28 07:02:23 -0500

DimitriProsser gravatar image

I know that SolidWorks can calculate this value for you, and I'm assuming that any other CAD program can as well.

As a general rule of thumb, I try to follow a number of guidelines when creating urdf models. These are mostly based on experience, so they should only be taken for what they are.

  1. Don't make objects too large
  2. Don't make objects too small
  3. Avoid modifying the gravity
  4. Keep masses for dynamic objects as close as possible. (i.e. the simulator will not like it if you place a 1000kg weight on four 1kg wheels.
  5. When in doubt, use the identity mass moment of inertia <1 0 0 1 0 1>

You might also want to try the following to make your links more "solid":

<gazebo reference="back_left_wheel">
edit flag offensive delete link more


You can even use the free Meshlab for this: Filters->Quality Measure and Computations->Compute Geometric Measures. However, Meshlab doesn't document which mass does it suppose (I hope it just uses unit mass) and it provides you the inertia tensor with respect to the origin, not with respect to CoM.

peci1 gravatar image peci1  ( 2014-07-01 08:11:45 -0500 )edit

It assumes unit density. So basically the volume is the mass of the object.

ipa-hsd gravatar image ipa-hsd  ( 2016-07-04 10:20:18 -0500 )edit

answered 2022-06-28 05:22:08 -0500

vonunwerth gravatar image

I implemented a python script reading an 3D file like stl or dae and outputting the full URDF XML inertial tag based on the gazebosim tutorial. and pymeshlab.

At first the script calculates the center of mass of the object. After that it scales the mesh by a factor of 100 to increase the numerical accuracy. You could manually change that, if you need to scale it more up. Now the convex hull of your object will be calculated. For the hull the geometric properties will be calculated, scaled back down and outputted as URDF XML inertial tag like that (the precision could also be changed in the script)

  <origin xyz="0.00000002 -0.00000001 0.00000000"/>
  <mass value="5.00000000"/>
  <inertia ixx="7.90866056" ixy="0.00000006" ixz="0.00000000" iyy="7.90866060" iyz="0.00000000" izz="2.48398783"/>

Check it out here:

edit flag offensive delete link more

Question Tools



Asked: 2011-09-28 06:33:03 -0500

Seen: 5,388 times

Last updated: Jun 28 '22