<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_mask.jpg
      publish_info: true
      encoding: mono8
      frame_id: camera
      fovx: 84.1
      fovy: 53.8
    </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="mask_image_to_roi"
        pkg="nodelet" type="nodelet"
        args="load jsk_perception/MaskImageToROI $(arg MANAGER)"
        respawn="true" >
    <remap from="~input" to="$(arg INPUT_IMAGE)"/>
    <remap from="~input/camera_info" to="$(arg INPUT_IMAGE)/camera_info"/>
  </node>

  <group if="$(arg gui)">
    <node name="rviz"
          pkg="rviz" type="rviz"
          args="-d $(find jsk_perception)/sample/config/sample_mask_image_to_roi.rviz"/>
  </group>
</launch>
