Ask Your Question
2

revolute joint not working in gazebo

asked 2012-11-21 16:18:38 -0600

ccm gravatar image

updated 2012-11-21 18:31:08 -0600

I'm trying to simulate a door in gazebo but the revolute joint does not seem to work. Could someone take a look at my urdf file and see what might be possibly wrong with it

<robot name="door2">
  <link name="wall">
    <inertial>
      <origin xyz="0 0 1.2" /> 
      <mass value="100.0" />
      <inertia  ixx="1.0" ixy="0"  ixz="0"  iyy="1.0"  iyz="0"  izz="1.0" />
    </inertial>
    <visual>
      <origin xyz="0 0 1.2"/>
      <geometry>
        <box size="0.2 2.4 2.4" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 1.2"/>
      <geometry>
        <box size="0.2 2.4 2.4" />
      </geometry>
    </collision>
  </link>

  <link name="door">
    <inertial>
      <origin xyz="-0.1 0.6 0" /> 
      <mass value="1.0" />
      <inertia  ixx="1.0" ixy="0"  ixz="0"  iyy="1.0"  iyz="0"  izz="1.0" />
    </inertial>
    <visual>
      <origin xyz="-0.1 0.6 0"/>
      <geometry>
        <box size="0.2 1.2 2.4" />
      </geometry>
    </visual>
    <collision>
      <origin xyz="-0.1 0.6 0"/>
      <geometry>
        <box size="0.2 1.2 2.4" />
      </geometry>
    </collision>
  </link>

  <joint name="hinge" type="revolute">
    <limit upper="0" lower="-1.57" velocity="10" effort="1"/>
    <origin xyz="0.1 1.2 1.2"/>
    <axis xyz="0 0 1" />
    <parent link="wall"/>
    <child link="door"/>
  </joint>   

  <gazebo reference="wall">
    <material>Gazebo/Blue</material>
    <static>true</static>
  </gazebo>
</robot>

This is the link the video I took http://www.youtube.com/watch?v=iCwonqFniqA&feature=youtu.be

I'm running Fuerte, Ubuntu 12.04

Thank you

EDIT: I tried a second time but this time with an extra block to prevent the thing from toppling: http://www.youtube.com/watch?v=l3gPdSxkyCU&feature=youtu.be The door managed to open but with much difficulty, have to move pr2 very slowly. Does anyone know how to make the joint more smooth?

*my velocity and effort for the revolute joint was 1000 and 10000 respectively for the second video if that makes any difference

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2012-11-22 21:38:13 -0600

One thing to think about: your inertia tags have to match your mass. The mass you specified (100 kg and 1 kg) only tells the simulation the gravitational force. What you want is inertia: the wall should be much harder to move than the door (at the moment, they are the same). Also see Wikipedia's List of moment of inertia tensors.

For a mass of 1 kg, the door should have something like this if my calculations are right:

ixx = 1/3 * m * (y^2 + z^2) = 1/3 * 1 * (1.2^2 + 2.4^2) = 2.4
iyy = 1/3 * m * (x^2 + z^2) = 1/3 * 1 * (0.2^2 + 2.4^2) = 1.933333
izz = 1/3 * m * (x^2 + y^2) = 1/3 * 1 * (0.2^2 + 1.2^2) = 0.493333

So your door inertia was in the right ballpark. The wall should have 100 times that.

On the other hand, you may also want to change some other joint properties (damping or such?) to make the door swing more lightly. I remember there was one guy on this answer board who had the opposite problem (the door would never stop swinging) a while ago.

edit flag offensive delete link more
0

answered 2012-11-26 13:46:45 -0600

Additionally if you want your wall not to move, you can link it to the world via a revolute joint of limits 0.0 to 0.0 rotating around the y axis. This will effectively join your wall to the world and make it immovable.

However I notice that your model is in urdf and when I did this I used an SDF file not a urdf one. Here is an example of the file I wrote to fix my base_link to the world, stopping it from continually toppling.

I think the link "world" is a global tag I didn't explicitly define it.

<?xml version="1.0"?>
<gazebo version="1.0">
  <world name="default">
    <include filename="ground_plane.model"/>
    <include filename="sun.light"/>

     <physics type="ode">
        <gravity xyz="0 0 -9.80"/>
        <ode>
            <solver type="quick" dt="0.0001" iters="100" sor="1.3"/>
            <constraints cfm="0.0" erp="0.2" contact_max_correcting_vel="100.0" contact_surface_layer="0.001"/>
        </ode>
     </physics>


     <model name="HMM_version2" static="false">
        <origin pose="-0.25 0.4 2.415 0 0 0" />
        <!--origin pose="0 0 0 0 0 0"/-->

      <link name = "base_link" >

            <visual name="base_link_visual">
                <geometry>
                <box  size="1.528 .491 .825"/>
            </geometry>
                <origin pose="0 0 0 0 0 0"/>
                <material script="Gazebo/Red"/>
        </visual>
        <collision name="base_link_collision">
            <geometry>
                <box size="1.528 0.491 .825"/>
            </geometry>
            <origin pose="0 0 0 0 0 0"/>
        </collision>
        <inertial mass ="750.004">
            <inertia ixx="67.5" ixy="0.022" iyy="67" ixz="-0.363" iyz="-0.0352" izz="25"/>
            <origin pose=" 0.262 -0.005 0.053 0 0 0" />
        </inertial>     
    </link>

    <link name = "Shoulder" >
          <origin pose="0.9 0 0.279 0 0 0"/>
      <visual name="Shoulder_visual">
        <geometry>
        <box size=".780 .328 .424"/>
            </geometry>
        <origin pose=" .20 0.051 0 0 0 0"/>
        <material script="Gazebo/BlueLaser">
        <!--ambient rgba="0 0 1.0 1"/-->
        </material>
       </visual>
    <collision name = "Shoulder_collision">
        <geometry>
            <box size=".780 .328 .424"/>
                </geometry>
         <origin pose= " .20 0.051 0 0 0 0"/>
    </collision>
    <inertial mass="51.004">
            <inertia ixx="1.59" ixy="0.022" iyy="3.39" ixz="-0.363" iyz="-0.0352" izz="4.05"/>
            <origin pose=" 0.262 -0.005 0.053 0 0 0" />
    </inertial>
    </link>


    <joint name="joint0" type="revolute">
     <parent link="world"/>
     <child link="base_link"/>
     <axis xyz="0 0 1">
        <limit lower="0.0000" upper="0.0000"/>
     </axis>
    </joint>

    <joint name="joint1" type="revolute">
       <parent link="base_link"/>
       <child link="Shoulder"/>
       <!--origin pose= " 1.927 0 0.27923 0 0 0   "/-->

       <axis xyz="0 0 1" >
        <limit effort="3900" lower="-1.31" upper="1.31" velocity="0.62"/>
        <dynamics friction ="1000" damping="100"/>
       </axis>
    </joint>



     <plugin name="HMM_plugin" filename="libHMMv2.so"/>
     </model>
  </world>
 </gazebo>
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-11-21 16:18:38 -0600

Seen: 3,421 times

Last updated: Nov 26 '12