<?xml version="1.0" ?>
<%
  elems = ['xx', 'xy', 'xz', 'xp', 'xq', 'xr',
                 'yy', 'yz', 'yp', 'yq', 'yr',
                       'zz', 'zp', 'zq', 'zr',
                             'pp', 'pq', 'pr',
                                   'qq', 'qr',
                                         'rr']
%>
<sdf version="1.6">
  <world name="fluid_added_mass">
    <plugin
      filename="gz-sim-physics-system"
      name="gz::sim::systems::Physics">
    </plugin>
    <plugin
      filename="gz-sim-scene-broadcaster-system"
      name="gz::sim::systems::SceneBroadcaster">
    </plugin>
    <plugin
      filename="gz-sim-apply-link-wrench-system"
      name="gz::sim::systems::ApplyLinkWrench">

<%
  elems.each do |elem|
%>
      <persistent>
        <entity_name>box_<%= elem %></entity_name>
        <entity_type>model</entity_type>
        <force>1 0 0</force>
      </persistent>
<%
  end
%>

    </plugin>

    <gravity>0 0 0</gravity>

    <light type="directional" name="sun">
      <cast_shadows>true</cast_shadows>
      <pose>0 0 10 0 0 0</pose>
      <diffuse>0.8 0.8 0.8 1</diffuse>
      <specular>0.2 0.2 0.2 1</specular>
      <attenuation>
        <range>1000</range>
        <constant>0.9</constant>
        <linear>0.01</linear>
        <quadratic>0.001</quadratic>
      </attenuation>
      <direction>-0.5 0.1 -0.9</direction>
    </light>

<%
  pos_x = -2.0
  elems.each do |elem|
    pos_x += 2.0
%>
    <model name="box_<%= elem %>">
      <pose>0 <%= pos_x %> 0.5 0 0 0</pose>
      <link name="link">
        <inertial>
          <inertia>
            <ixx>0.1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>0.1</iyy>
            <iyz>0</iyz>
            <izz>0.1</izz>
          </inertia>
          <mass>1.0</mass>
          <fluid_added_mass>
            <<%= elem %>>0.261666</<%= elem %>>
          </fluid_added_mass>
        </inertial>
        <collision name="collision">
          <geometry>
            <box>
              <size>1.0 1.0 1.0</size>
            </box>
          </geometry>
        </collision>

        <visual name="visual">
          <geometry>
            <box>
              <size>1.0 1.0 1.0</size>
            </box>
          </geometry>
          <material>
            <ambient>0 1 1 1</ambient>
            <diffuse>0 1 1 1</diffuse>
            <specular>1 0 1 1</specular>
          </material>
        </visual>
      </link>
    </model>
<%
  end
%>
  </world>
</sdf>
