<launch>
  <arg name="gui" 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
      publish_info: false
    </rosparam>
  </node>
  <arg name="INPUT_IMAGE" default="image_publisher/output" />

  <node name="non_maximum_suppression"
        pkg="jsk_perception" type="non_maximum_suppression.py">
    <remap from="non_maximum_suppression" to="~nms_server"/>
  </node>

  <node name="sliding_window_object_detector"
        pkg="nodelet" type="nodelet"
        args="standalone jsk_perception/SlidingWindowObjectDetector">
    <remap from="~input" to="$(arg INPUT_IMAGE)"/>
    <remap from="~non_maximum_suppression" to="non_maximum_suppression/nms_server"/>
    <rosparam subst_value="true">
      run_type: DETECTOR
      trainer_manifest: $(find jsk_perception)/sample/config/sample_sliding_window_object_detector_manifest.xml
      override_manifest: true
      trainer_path: $(find jsk_perception)/trained_data/svm_apc2016_objects.xml
      image_downsize: 2
      scaling_factor: -0.05
      stack_size: 5
      sliding_window_increment: 25
    </rosparam>
  </node>

  <group if="$(arg gui)">
    <node name="tile_image"
          pkg="jsk_perception" type="tile_image.py">
      <rosparam>
        input_topics:
          - /image_publisher/output
          - /sliding_window_object_detector/output/image
        draw_topic_name: true
        font_scale: 1.0
      </rosparam>
    </node>

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