<launch>
  <arg name="gui" default="true"/>

  <include file="$(find jsk_perception)/sample/sample_apply_mask_image.launch">
    <arg name="gui" value="false"/>
  </include>
  <arg name="MANAGER" default="sample_manager" />

  <node name="unapply_mask_image"
        pkg="nodelet" type="nodelet"
        args="load jsk_perception/UnapplyMaskImage $(arg MANAGER)"
        respawn="true" >
    <remap from="~input" to="apply_mask_image/output"/>
    <remap from="~input/mask" to="mask_publisher/output"/>
    <rosparam>
      approximate_sync: true
    </rosparam>
  </node>

  <group if="$(arg gui)">
    <node name="tile_image"
          pkg="jsk_perception" type="tile_image.py">
      <rosparam>
        input_topics:
          - /mask_publisher/output
          - /apply_mask_image/output
          - /unapply_mask_image/output
        draw_topic_name: true
        font_scale: 2.0
      </rosparam>
    </node>

    <node name="image_view"
          pkg="image_view" type="image_view">
      <remap from="image" to="tile_image/output"/>
    </node>
  </group>
</launch>
