0
$\begingroup$

Rosanswers logo

I tried to spawn a cube in gazebo with the following URDF.

<robot name="simple_box">
  <link name="my_box">
    <inertial>
      <origin xyz="2 0 0" />
      <mass value="1.0" />
      <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
    </inertial>
    <visual>
      <origin xyz="0.7 0 0.56"/>
      <geometry>
        <box size="0.02 0.02 0.02" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0.7 0 0.56"/>
      <geometry>
        <box size="0.02 0.02 0.02" />
      </geometry>
    </collision>
  </link>
  <gazebo reference="my_box">
    <material>Gazebo/Blue</material>
  </gazebo>
</robot>

with the following entry in my launch file :

<!-- spawn a cube for pick and place -->
<node name="spawn_cube" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_pnp)/urdf/object.urdf -urdf -model cube" />

But I see some strange behavior of the cube as it never stops moving. https://youtu.be/HPc2xJXtPhc

I am guessing it has something to do with inertia / mass?


Originally posted by ipa-hsd on ROS Answers with karma: 150 on 2016-06-06

Post score: 0


Original comments

Comment by JohnDoe2991 on 2016-06-06:
Should your mass origin and visual/collision origin not be the same? I'm not an expert with URDF, I always solve this by try and error. But this movement looks like your mass center is wrong.

Comment by ipa-hsd on 2016-06-06:
Perfect! Works fine

Comment by longforgotten on 2016-06-06:
@JohnDoe2991 not always. But for the cube, you're right.

Comment by longforgotten on 2016-06-06:
@intelharsh, your inertia tensor is miles away from a real tensor, given that your cube mass is 1 kg.

You can use this xacro to compute a viable inertia tensor to the cube.

Comment by ipa-hsd on 2016-06-07:
@emersonfs can I find a documentation somewhere regarding this?

Comment by ipa-hsd on 2016-06-07:
@emersonfs I used the macro you mentioned and it seems to work fine, though I'll need to read about it to understand what's happening.

Comment by longforgotten on 2016-06-07:
This xacro file implements some known moment of inertia tensors for certain shapes. To understand why inertia tensors are so importants to physics, you can read the chapter 6 "Manipulator dynamics", section 3 "Mass distribution", from Craig's book, "Introduction to Robotics".

Comment by ipa-hsd on 2016-06-08:
@emersonfs thanks! Will go through it

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I can confirm from a lot of tests that the ratio between mass and inertia is crucial in the Gazebo physics. I had a problem with my robot collapsing, it also ended up being caused by inertia issues. The answer here covers a lot of solutions.


Originally posted by Laurens Verhulst with karma: 167 on 2016-06-06

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.