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

  <node name="camera_info_publisher"
        pkg="rostopic" type="rostopic"
        args="pub -r 30 -s /camera/rgb/camera_info sensor_msgs/CameraInfo
              '{header: {stamp: now, frame_id: camera},
                height: 480,
                width: 640,
                K: [525.0, 0.0, 319.5, 0.0, 525.0, 239.5, 0.0, 0.0, 1.0],
                R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
                P: [525.0, 0.0, 319.5, 0.0, 0.0, 525.0, 239.5, 0.0, 0.0, 0.0, 1.0, 0.0],
                roi: {x_offset: 100, y_offset: 100, height: 200, width: 300}}'"/>

  <node name="roi_to_polygon_rect"
        pkg="nodelet" type="nodelet"
        args="standalone jsk_perception/ROIToRect">
    <remap from="~input" to="camera/rgb/camera_info"/>
  </node>

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