<launch>
  <arg name="init_x" />
  <arg name="init_y" />

  <arg
    name="model_name"
    default="roisbot" />
  <arg
    name="model"
    default="$(find rois_description)/robot/$(arg model_name).urdf.xacro" />
  <arg
    name="init_pos"
    value="-x $(arg init_x) -y $(arg init_y)" />

  <group ns="$(arg model_name)">
    <param
      name="robot_description"
      command="$(find xacro)/xacro --inorder $(arg model)" />

   <rosparam file="$(find rois_gazebo)/config/$(arg model_name)_controller.yaml" />

    <node
      name="robot_state_publisher"
      type="robot_state_publisher"
      pkg="robot_state_publisher"
      respawn="false"
      output="screen">
      <param name="tf_prefix" value="$(arg model_name)" />
    </node>

    <node
      name="controller_spawner"
      type="spawner"
      pkg="controller_manager"
      args="joint_state_controller diff_drive_controller"
      output="screen" />

    <node
      pkg="gazebo_ros"
      type="spawn_model"
      name="spawn_urdf"
      args="-urdf -model $(arg model_name) -param robot_description $(arg init_pos)" />
  </group>
</launch>
