<launch>
  <arg 
    name="rvizconfig" 
    default="$(find rois_gazebo)/rviz/roisbot.rviz" />
  <arg 
    name="world_name"
    default="$(find rois_description)/world/c_corridor.sdf" />
  <arg
    name="use_multi_robot"
    default="true" />
  <arg
    name="robot1_init_x"
    default="0" />
  <arg
    name="robot1_init_y"
    default="0" />
  <arg
    name="robot2_init_x"
    default="10" />
  <arg
    name="robot2_init_y"
    default="0" />
  <arg
    name="robot3_init_x"
    default="0" />
  <arg
    name="robot3_init_y"
    default="10" />

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg 
      name="world_name" 
      value="$(arg world_name)" />
  </include>

  <include file="$(find rois_gazebo)/launch/spawn_model.launch">
    <arg
      name="model_name"
      value="robot1"/>
    <arg
      name="init_x"
      value="$(arg robot1_init_x)" />
    <arg
      name="init_y"
      value="$(arg robot1_init_y)" />
  </include>

  <group if="$(arg use_multi_robot)">
    <include file="$(find rois_gazebo)/launch/spawn_model.launch">
      <arg
        name="model_name"
        value="robot2"/>
      <arg
        name="init_x"
        value="$(arg robot2_init_x)" />
      <arg
        name="init_y"
        value="$(arg robot2_init_y)" />
    </include>

    <include file="$(find rois_gazebo)/launch/spawn_model.launch">
      <arg
        name="model_name"
        value="robot3"/>
      <arg
        name="init_x"
        value="$(arg robot3_init_x)" />
      <arg
        name="init_y"
        value="$(arg robot3_init_y)" />
    </include>
  </group>

  <node 
    name="rviz" 
    type="rviz" 
    pkg="rviz" 
    args="-d $(arg rvizconfig)" />
</launch>
