<?xml version="1.0"?>

<launch>

  <arg name="enable_kinect" value="true"/>
  <arg name="enable_slam" value="false"/>
  <arg name="enable_joystick" value="true"/>
   
  <!-- Start Gazebo with wg world running in (max) realtime -->
  <include file="$(find hector_gazebo_worlds)/launch/willow_garage.launch"/>
  
  <group unless="$(arg enable_kinect)">
	  <!-- Spawn simulated quadrotor uav -->
	  <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor.launch" >
	    <arg name="model" value="$(find hector_quadrotor_description)/urdf/quadrotor_hokuyo_utm30lx.gazebo.xacro"/> 
	  </include>
  </group>

  <group if="$(arg enable_kinect)">
	  <!-- Spawn simulated quadrotor uav with kinect -->
	  <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor_with_kinect.launch" >
	    <!--arg name="model" value="$(find hector_quadrotor_description)/urdf/quadrotor_hokuyo_utm30lx.gazebo.xacro"/--> 
	  </include>
  </group>
   
  <!-- Start SLAM system -->
  <group if="$(arg enable_slam)">
	  <include file="$(find hector_mapping)/launch/mapping_default.launch">
	    <arg name="odom_frame" value="world"/>
	  </include>
	 
	  <!-- Start GeoTIFF mapper -->
	  <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
	    <arg name="trajectory_publish_rate" value="4"/> 
	  </include>
  </group>

  <group if="$(arg enable_joystick)">
	  <!-- Spawn simulated quadrotor uav with kinect -->
	  <include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor_with_kinect.launch" >
	    <!--arg name="model" value="$(find hector_quadrotor_description)/urdf/quadrotor_hokuyo_utm30lx.gazebo.xacro"/--> 
	  </include>
  </group>
  
  <!-- Start rviz visualization with preset config -->
  <node pkg="rviz" type="rviz" name="rviz" args="-d $(find hector_quadrotor_demo)/rviz_cfg/indoor_slam.rviz"/>
   
</launch>
