<launch>
  <!-- Arguments -->
  <arg name="map_file" default="$(find agv_navigation)/maps/gazebo_map.yaml"/>
  <arg name="open_rviz" default="true"/>
  <arg name="move_forward_only" default="false"/>

  <!-- Turtlebot3 -->
  <include file="$(find agv_description)/launch/agv_remote.launch">
  </include>

  <!-- Map server -->
  <node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)"/>

  <!-- AMCL -->
  <include file="$(find agv_navigation)/launch/amcl.launch"/>

  <!-- move_base -->
  <include file="$(find agv_navigation)/launch/move_base.launch">
    <arg name="move_forward_only" value="$(arg move_forward_only)"/>
  </include>

  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find agv_navigation)/rviz/agv_navigation.rviz"/>
  </group>
</launch>