0

I'm trying to write a SDF file for an air hockey table that will later have the model for the air hockey playing robot added to it. The model I have started has a large block for the table and small rectangles for the sides (there's only 3 at the moment). At present, the top and right side fall off the table when spawned in Gazebo. I'm not sure why. The left side doesn't move. I based the mass of the sides on the density of aluminum and the volume of each side piece (everything is in meters and kg). I have the SDF file in the .gazebo folder that comes with ROS 1.0. Any help would be appreciated!

<?xml version="1.0" ?>
<sdf version="1.5">
  <model name="table_sdf">

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

      <pose>0 0 0 0 0 0</pose>
    <self_collide>true</self_collide>
    <link name="base_link">
      <pose>0 0 0  0 0 0</pose>
      <inertial>
        <mass>1065.54</mass>
        <inertia>
          <ixx>1</ixx>
          <iyy>1</iyy>
          <izz>1</izz>
          <ixy>0.0</ixy>
          <ixz>0.0</ixz>
          <iyz>0.0</iyz>
        </inertia>
      </inertial>
      <collision name="tableCollision">
        <geometry>
          <box>
            <size>1.275 2.27 .869</size>
          </box>
        </geometry>
        <surface>
            <contact>
              <ode>
                <max_vel>0</max_vel>
                <min_depth>0.001</min_depth>
              </ode>
            </contact>
        </surface>
      </collision>
      <visual name="tableVisual">
        <geometry>
          <box>
            <size>1.275 2.27 .869</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Wood</name>
          </script>
        </material>
      </visual>
    </link>

    <joint name="LLJ" type="fixed">
            <pose>-.553805 0 .452  0 0 0</pose>
        <parent link="base_link"/>
            <child link="left_side"/>
    </joint>

    <self_collide>true</self_collide>
    <link name="left_side">
      <pose>-.553805 0 .452  0 0 0</pose>
      <inertial>
        <mass>1.287</mass>
        <inertia>
          <ixx>1</ixx>
          <iyy>1</iyy>
          <izz>1</izz>
          <ixy>0.0</ixy>
          <ixz>0.0</ixz>
          <iyz>0.0</iyz>
        </inertia>
      </inertial>
      <collision name="leftSideCollision">
        <geometry>
          <box>
            <size>.00649 2.0978 .03501</size>
          </box>
        </geometry>
        <surface>
            <contact>
              <ode>
                <max_vel>0</max_vel>
                <min_depth>0.001</min_depth>
              </ode>
            </contact>
        </surface>
      </collision>
      <visual name="leftSideVisual">
        <geometry>
          <box>
            <size>.00649 2.0978 .03501</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Wood</name>
          </script>
        </material>
      </visual>
    </link>

    <joint name="RLJ" type="fixed">
            <pose>.553805 0 .452  0 0 0</pose>
        <parent link="base_link"/>
            <child link="right_side"/>
    </joint>

    <self_collide>true</self_collide>
    <link name="right_side">
      <pose>.553805 0 .452  0 0 0</pose>
      <inertial>
        <mass>1.287</mass>
        <inertia>
          <ixx>1</ixx>
          <iyy>1</iyy>
          <izz>1</izz>
          <ixy>0.0</ixy>
          <ixz>0.0</ixz>
          <iyz>0.0</iyz>
        </inertia>
      </inertial>
      <collision name="rightSideCollision">
        <geometry>
          <box>
            <size>.00649 2.0978 .03501</size>
          </box>
        </geometry>
      </collision>
      <visual name="rightSideVisual">
        <geometry>
          <box>
            <size>.00649 2.0978 .03501</size>
          </box>
        </geometry>
        <surface>
            <contact>
              <ode>
                <max_vel>0</max_vel>
                <min_depth>0.001</min_depth>
              </ode>
            </contact>
        </surface>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Wood</name>
          </script>
        </material>
      </visual>
    </link>

    <joint name="topJ" type="fixed">
            <pose>0 1.05131 .452  0 0 0</pose>
        <parent link="base_link"/>
            <child link="top_side"/>
    </joint>

    <self_collide>true</self_collide>
    <link name="top_side">
      <pose>0 1.05131 .452  0 0 0</pose>
      <inertial>
        <mass>.666145</mass>
        <inertia>
          <ixx>1</ixx>
          <iyy>1</iyy>
          <izz>1</izz>
          <ixy>0.0</ixy>
          <ixz>0.0</ixz>
          <iyz>0.0</iyz>
        </inertia>
      </inertial>
      <collision name="topSideCollision">
        <geometry>
          <box>
            <size>1.085846 .00649 .03501</size>
          </box>
        </geometry>
      </collision>
      <visual name="topSideVisual">
        <geometry>
          <box>
            <size>1.085846 .00649 .03501</size>
          </box>
        </geometry>
        <surface>
            <contact>
              <ode>
                <max_vel>0</max_vel>
                <min_depth>0.001</min_depth>
              </ode>
            </contact>
        </surface>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Wood</name>
          </script>
        </material>
      </visual>
    </link>

  </model>
</sdf>
AYellen
  • 1
  • 2
  • Why have you omitted the first 0 in most of the floating point numbers, that would be 0.##...#? This is probably not causing your issues, but why would you expose yourself to the possibility that people have messed up parsing -.553805 from line "-.553805 0 .452 0 0 0" to -0.553805 correctly. Why not just write the leading 0 everywhere? – MRFalcon Apr 17 '20 at 06:14
  • @MRFalcon I left them off because it made it easier to read. Having the 0 in front just made it more cluttered. – AYellen Apr 17 '20 at 16:30

0 Answers0