<launch>

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

  <node name="image_publisher"
        pkg="jsk_perception" type="image_publisher.py">
    <rosparam subst_value="true">
      file_name: $(find jsk_perception)/sample/kiva_pod_image_color.jpg
      encoding: bgr8
      publish_info: false
    </rosparam>
  </node>
  <arg name="INPUT_IMAGE" default="image_publisher/output" />
  <arg name="MANAGER" default="sample_manager" />
  <node name="$(arg MANAGER)"
        pkg="nodelet" type="nodelet" args="manager"
        if="$(arg launch_manager)"
        output="screen" />

  <node name="depth_publisher"
        pkg="jsk_perception" type="image_publisher.py">
    <rosparam subst_value="true">
      file_name: $(find jsk_perception)/sample/kiva_pod_image_depth.jpg
      encoding: 32FC1
      publish_info: false
    </rosparam>
  </node>
  <arg name="DEPTH_IMAGE" default="depth_publisher/output" />

  <node name="colorize_float_image"
        pkg="nodelet" type="nodelet"
        args="load jsk_perception/ColorizeFloatImage $(arg MANAGER)"
        respawn="true">
    <remap from="~input" to="$(arg DEPTH_IMAGE)" />
  </node>

  <node name="overlay_image_color_on_mono"
        pkg="nodelet" type="nodelet"
        args="load jsk_perception/OverlayImageColorOnMono $(arg MANAGER)"
        respawn="true" >
    <remap from="~input/color" to="colorize_float_image/output" />
    <remap from="~input/mono" to="$(arg INPUT_IMAGE)" />
    <rosparam>
      approximate_sync: true
    </rosparam>
  </node>

  <group if="$(arg gui)">
    <node name="image_view0"
          pkg="image_view" type="image_view">
      <remap from="image" to="colorize_float_image/output" />
    </node>
    <node name="image_view1"
          pkg="image_view" type="image_view">
      <remap from="image" to="$(arg INPUT_IMAGE)" />
    </node>
    <node name="image_view2"
          pkg="image_view" type="image_view">
      <remap from="image" to="overlay_image_color_on_mono/output" />
    </node>
  </group>

</launch>
