<?xml version="1.0"?>

<launch>
  <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
    <param name="base_frame" value="base_stabilized" />
    <param name="odom_frame" value="nav"/>
    <param name="output_timing" value="false"/>

    <param name="use_tf_scan_transformation" value="true"/>
    <param name="use_tf_pose_start_estimate" value="false"/>
    <param name="scan_topic" value="scan"/>

    <!-- Map size / start point -->
    <param name="map_resolution" value="0.050"/>
    <param name="map_size" value="2048"/>
    <param name="map_start_x" value="0.5"/>
    <param name="map_start_y" value="0.5" />

    <!-- Map update parameters -->
    <param name="update_factor_free" value="0.4"/>
    <param name="update_factor_occupied" value="0.9" />
    <param name="map_update_distance_thresh" value="0.4"/>
    <param name="map_update_angle_thresh" value="0.06" />

    <!--
      <param name="pub_drawings" value="true"/>
      <param name="pub_debug_output" value="true"/>
    -->
  </node>

  <arg name="disable_poseupdate" default="false" />
  <group if="$(arg disable_poseupdate)">
    <param name="hector_mapping/pub_map_odom_transform" value="true"/>
    <remap from="poseupdate" to="poseupdate_disabled"/>
  </group>
  <group unless="$(arg disable_poseupdate)">
    <param name="hector_mapping/pub_map_odom_transform" value="false"/>
    <node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 map nav 100"/>
  </group>

  <!--
  <node pkg="hector_map_server" type="hector_map_server" name="hector_map_server" output="screen" />
  <node pkg="hector_trajectory_server" type="hector_trajectory_server" name="hector_trajectory_server" output="screen" />

  <node pkg="hector_geotiff" type="geotiff_node" name="hector_geotiff_node" output="screen" launch-prefix="nice -n 15">
    <param name="map_file_path" type="string" value="$(find hector_geotiff)/maps" />
    <param name="map_file_base_name" type="string" value="MappingBox" />
    <param name="geotiff_save_period" type="double" value="45" />
  </node>
  -->

  <node pkg="topic_tools" type="throttle" name="map_throttle" args="messages map 0.1 throttled_map" />
</launch>

