Home | Tutorials | Wiki | Issues
Ask Your Question
1

Problem with making a floating gripper in Gazebo

asked 2017-12-12 07:14:47 -0500

Fiddle gravatar image

updated 2017-12-13 11:19:21 -0500

Hi, I am trying to make a floating gripper for gazebo that will be used for reinforced learning, so far I want it to move up and down and close its claws. Currently I have a problem with spawning it in gazebo simulation, because I think the urdf is not parsed correctly, because the gravity is turned off only for the first link. The code for gripper is attached below. I guess I kinda messed up with the dummy links, but I can't find any example like that.

image description

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    Gripper file used for openai gym            | -->
<!-- |                                                | -->
<!-- =================================================================================== -->

 <robot name="Gripper">

   <gazebo reference="dummy_prismatic_link">
    <gravity>0</gravity>
    <mu1>0.5</mu1>
    <mu2>0.5</mu2>
    <material>Gazebo/Orange</material>
  </gazebo>

  <gazebo reference="dummy">
    <gravity>0</gravity>
    <mu1>0.5</mu1>
    <mu2>0.5</mu2>
    <material>Gazebo/Orange</material>
  </gazebo>

  <gazebo reference="gripper_main_body">
    <gravity>0</gravity>
    <mu1>0.5</mu1>
    <mu2>0.5</mu2>
    <material>Gazebo/Orange</material>
  </gazebo>
  <gazebo reference="gripper_finger1">
    <gravity>0</gravity>
    <mu1>0.5</mu1>
    <mu2>0.5</mu2>
    <material>Gazebo/Red</material>
  </gazebo>
  <gazebo reference="gripper_finger2">
    <gravity>0</gravity>
    <mu1>0.5</mu1>
    <mu2>0.5</mu2>
    <material>Gazebo/Red</material>
  </gazebo>

  <link name="world"/>

  <joint name="fixed" type="fixed">
    <parent link="world"/>
    <child link="dummy"/>
  </joint>

  <joint name="gripper_dummy" type="fixed">
    <parent link="dummy"/>
    <child link="dummy_prismatic_link"/>
    <origin rpy="0  0  0" xyz="0   0   0.5"/>
  </joint>

  <joint name="dummy_prismatic_joint" type="prismatic">
    <parent link="dummy_prismatic_link"/>
    <child link="gripper_main_body"/>
    <origin rpy="0  3.14159265  0" xyz="0   0   0"/>
    <axis xyz="0  0  1"/>
    <limit effort="1.0" lower="-0.0" upper="0.02" velocity="1.0"/>
    <dynamics damping="0.2"/>
  </joint>
  <transmission name="gripper_tran">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="gripper_joint">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="gripper_motor">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <joint name="gripper_joint1" type="prismatic">
    <parent link="gripper_main_body"/>
    <child link="gripper_finger1"/>
    <origin rpy="0  0  0" xyz="0.001   0.01375   0.12925"/>
    <axis xyz="0  1  0"/>
    <limit effort="1.0" lower="-0.01" upper="0.01" velocity="1.0"/>
    <dynamics damping="0.2"/>
  </joint>
  <transmission name="gripper_tran1">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="gripper_joint1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="gripper_motor0">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <joint name="gripper_joint2" type="prismatic">
    <parent link="gripper_main_body"/>
    <child link="gripper_finger2"/>
    <origin rpy="0  0  3.14159265" xyz="0.001   -0.012   0.12925"/>
    <axis xyz="0  1  0"/>
    <limit effort="1.0" lower="-0.01" upper="0.01" velocity="1.0"/>
    <dynamics damping="0.2"/>
  </joint>
  <transmission name="gripper_tran2">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="gripper_joint2">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="gripper_motor2">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <link name="dummy">
    <collision name="dummy_collision">
      <origin rpy="0  0  0" xyz="0    0    0.5"/>
      <geometry>
        <cylinder length="0.014" radius="0.003"/>
      </geometry>
    </collision>
    <visual name="dummy_visual">
      <origin rpy="0  0  0" xyz="0    0    0.5"/>
      <geometry>
        <cylinder length="0.014" radius="0.003"/>
      </geometry>
    </visual>
  </link>

  <link name="dummy_prismatic_link">
    <inertial ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-12-12 10:44:17 -0500

chapulina gravatar image

updated 2017-12-13 11:57:16 -0500

If I understood correctly, your intention is that by turning off gravity, the links will stay fixed in the world, correct?

I haven't played much with turning off gravity for some links in a model, but I suspect that even if that works, your gripper would move once it starts having contact with the models it is grasping.

If my assumption is correct and you want the arm to be fixed, I suggest you use a fixed joint to the world. Here's an SDF example, you should be able to achieve the same result with URDF, I think.

Update

There is a known issue with gravity tags when converting from URDF to SDF:

https://bitbucket.org/osrf/sdformat/i...

edit flag offensive delete link more

Comments

I want to turn off the gravity for almost all links, except the dummy ones, so I can still move it up and down, while it still is in the air

Fiddle gravatar imageFiddle ( 2017-12-13 03:42:45 -0500 )edit

I see, have you tried writing a simple SDF model with some links gravity turned off? That would confirm the problem happens when using URDF.

chapulina gravatar imagechapulina ( 2017-12-13 10:24:47 -0500 )edit

I ran the urdf file through the gz sdf command and the way it handles gravity tags seems a little strange to me: <gravity>1</gravity> <velocity_decay/> <self_collide>0</self_collide> <gravity>0</gravity> Maybe while loading the model Gazebo reads only the first tag? I'd rather use urdf, since I'll need to connect it to the main robot later anyway.

Fiddle gravatar imageFiddle ( 2017-12-13 11:23:04 -0500 )edit

Ahh sorry I only saw the rest of your question now. It looks like this is a known issue: https://bitbucket.org/osrf/sdformat/issues/71/incorrect-urdf-to-sdf-conversion-of

chapulina gravatar imagechapulina ( 2017-12-13 11:51:14 -0500 )edit

Thanks, that works! No I have another little problem, but I'll post it in another question to not make a mess out of this one. http://answers.gazebosim.org/question/18109/movement-of-smaller-links-affecting-the-whole-body/

Fiddle gravatar imageFiddle ( 2017-12-14 03:53:47 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2017-12-12 07:14:47 -0500

Seen: 472 times

Last updated: Dec 13 '17