<launch>

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

  <param name="/use_sim_time" value="true" />
  <node name="rosbag_play"
        pkg="rosbag" type="play"
        args="$(find jsk_perception)/sample/data/2016-11-11-12-53-06_in_lab.bag --clock --loop" />

  <include file="$(find openni2_launch)/launch/openni2.launch">
    <arg name="load_driver" value="false" />
    <arg name="depth_registration" value="true" />
  </include>

  <node name="calc_flow"
        pkg="jsk_perception" type="calc_flow">
    <remap from="camera" to="/camera/rgb" />
    <remap from="/camera/rgb/image" to="/camera/rgb/image_rect_color" />
    <remap from="flow_image" to="~output" />
  </node>

  <group if="$(arg gui)">
    <node name="image_view0"
          pkg="image_view" type="image_view">
      <remap from="image" to="/camera/rgb/image_rect_color" />
    </node>
    <node name="image_view1"
          pkg="image_view" type="image_view">
      <remap from="image" to="calc_flow/output" />
    </node>
  </group>

</launch>
