Home | Tutorials | Wiki | Issues
Ask Your Question
0

How to disable gravity only for a specific model in Gazebo?

asked 2016-05-26 22:16:18 -0500

webvenky gravatar image

updated 2016-05-26 22:39:32 -0500

A similar question has been answered. http://answers.ros.org/question/65991...

However, this only works for the .sdf model files. It does not work for urdf. Kindly help.

<link name="base_link" gravity="0 0 0">
    <gravity>0</gravity>
  </link>

  <joint name="base_joint" type="fixed">
    <origin xyz="0 0 0" rpy="0 0 0" />
    <parent link="base_link" />
    <child link="body_link" />
  </joint>

  <link name="body_link">
    <gravity>0</gravity>
    <inertial>
      <mass value="0.1" />
      <origin xyz="0 0 0" />
      <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1" />
    </inertial>

    <visual name="base_visual">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry name="pioneer_geom">
        <mesh filename="package://rotors_description/meshes/simple_airplane1.dae" />
      </geometry>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <mesh filename="package://rotors_description/meshes/simple_airplane1.dae" />
      </geometry>
    </collision>

  </link>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-05-26 22:44:42 -0500

chapulina gravatar image

It looks like your file is in the URDF format (you use origin instead of pose for example).

<gravity> within a link is specified in SDF, but not in URDF. Luckily, the conversion from URDF to SDF is possible. In order to use SDF tags within your URDF link, use the <gazebo> tag, as explained in this tutorial. It should look something like this:

  <gazebo reference="base_link">
    <gravity>0</gravity>
  </gazebo>
edit flag offensive delete link more

Comments

Thanks a lot! It works. :-)

webvenky gravatar imagewebvenky ( 2016-05-26 22:58:13 -0500 )edit

Does it remain static in the world even if something collide with it? I was looking for something more like the <static> tag.

hbaqueiro gravatar imagehbaqueiro ( 2018-11-05 09:41:14 -0500 )edit

No, it will not remain static, it will just not be affected by gravity. There's no way to set only one link to be static, that tag works only on the model level. You can however make a model static and connect it to a non-static model with a joint.

chapulina gravatar imagechapulina ( 2018-11-05 12:12:57 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2016-05-26 22:16:18 -0500

Seen: 7,031 times

Last updated: May 26 '16