<!-- <launch>

  <node ns="local_costmap" name="voxel_grid_throttle" pkg="topic_tools" type="throttle" args="messages voxel_grid 3.0 voxel_grid_throttled" />
  <node pkg="move_base" type="move_base" respawn="false" name="move_base_node" output="screen">
    <param name="footprint_padding" value="0.01" />
    <param name="controller_frequency" value="10.0" />
    <param name="controller_patience" value="100.0" />
    <param name="base_global_planner" value="SBPLLatticePlanner" />
    <param name="base_local_planner" value="DWAPlannerROS" />
    <param name="SBPLLatticePlanner/primitive_filename" value="$(find sbpl_lattice_planner)/matlab/mprim/pr2.mprim" />
    <rosparam file="$(find sbpl_lattice_planner)/launch/move_base/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find sbpl_lattice_planner)/launch/move_base/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find sbpl_lattice_planner)/launch/move_base/local_costmap_params_close.yaml" command="load" />
    <rosparam file="$(find sbpl_lattice_planner)/launch/move_base/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find sbpl_lattice_planner)/launch/move_base/sbpl_global_params.yaml" command="load" />
    <rosparam file="$(find sbpl_lattice_planner)/launch/move_base/base_local_planner_params_close.yaml" command="load" />
  </node>
</launch> -->

<launch>
    <!--node ns="local_costmap" name="voxel_grid_throttle" pkg="topic_tools" type="throttle" args="messages voxel_grid 3.0 voxel_grid_throttled" /-->
    <arg name="local_planner" default="dwb" doc="Local planner can be either dwa, base, teb or pose"/>
    <arg name="with_virtual_walls" default="true" doc="Enables usage of virtual walls when set. Set to false when running SLAM." />
    <arg name="prefix" default="" doc="Prefix used for robot tf frames" /> <!-- used in the config files -->

    <node pkg="move_base" type="move_base" respawn="false" name="move_base_node" output="screen" clear_params="true">
        <param name="SBPLLatticePlanner/primitive_filename" value="$(find sbpl_lattice_planner)/matlab/mprim/unicycle_highcost_5cm.mprim" />
        <rosparam file="$(find sbpl_lattice_planner)/config/move_base_common_params.yaml" command="load" />
        <rosparam file="$(find sbpl_lattice_planner)/config/sbpl_global_params.yaml" command="load" />
        <rosparam file="$(find sbpl_lattice_planner)/config/$(arg local_planner)_local_planner_params.yaml" command="load" />
        <!-- global costmap params -->
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_common_params.yaml" command="load" ns="global_costmap" subst_value="true" />
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_global_params.yaml" command="load" />
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_global_params_plugins_virtual_walls.yaml" command="load" if="$(arg with_virtual_walls)" />
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_global_params_plugins_no_virtual_walls.yaml" command="load" unless="$(arg with_virtual_walls)" />
        <!-- local costmap params -->
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_common_params.yaml" command="load" ns="local_costmap" subst_value="true" />
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_local_params.yaml" command="load" subst_value="true" />
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_local_params_plugins_virtual_walls.yaml" command="load" if="$(arg with_virtual_walls)" />
        <rosparam file="$(find sbpl_lattice_planner)/config/costmap_local_params_plugins_no_virtual_walls.yaml" command="load" unless="$(arg with_virtual_walls)" />
        <!-- <remap from="map" to="/map" /> -->
        <!-- <remap from="marker" to="move_base_node/DWBLocalPlanner/markers" /> -->
    </node>
</launch>