<launch>
  <arg
    name="model"
    default="$(find rois_description)/robot/robot1.urdf.xacro" />

  <param
    name="/use_sim_time"
    value="true" />

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

  <node
    pkg="gmapping"
    type="slam_gmapping"
    name="gmapping" >
    <remap
      from="/scan"
      to="/robot1/scan" />
    <param
      name="odom_frame"
      value="robot1/odom" />
    <param
      name="base_frame"
      value="robot1/base_footprint" />
  </node>

  <node
    pkg="gazebo_ros"
    type="spawn_model"
    name="spawn_urdf"
    args="-urdf -model roisbot -param robot_description" />

  <node
    pkg="rviz"
    type="rviz"
    name="rviz"
    args="-d $(find rois_gazebo)/rviz/2dmapping.rviz" />

  <node
    pkg="rosbag"
    type="play"
    name="playbag"
    args="--clock $(arg bagfile)"
    output="screen" />
</launch>

