<launch>
  <arg name="gui" default="true" />
  <node name="play_vslam_bag" pkg="rosbag" type="play" args="-l $(find opencv_apps)/test/vslam_tutorial.bag -s 5 --topics /narrow_stereo/left/image_rect" />

  <group ns="narrow_stereo/left" >
    <node name="image_view" pkg="image_view" type="image_view" args="image:=image_rect" if="$(arg gui)" />

    <!-- simple_flow.cpp -->
    <include file="$(find opencv_apps)/launch/simple_flow.launch" >
      <arg name="use_camera_info" value="false" />
      <arg name="debug_view" value="$(arg gui)" />
      <arg name="image" value="image_rect" />
      <arg name="scale" value="8" />
    </include>

    <!-- Test Codes -->
    <node name="simple_flow_saver" pkg="image_view" type="image_saver" args="image:=simple_flow/image" >
      <param name="filename_format" value="$(find opencv_apps)/test/simple_flow.png"/>
    </node>
    <param name="simple_flow_test/topic" value="simple_flow/flows" />    <!-- opencv_apps/FlowArrayStamped -->
    <test test-name="simple_flow_test" pkg="rostest" type="hztest" name="simple_flow_test" >
      <param name="hz" value="5" />
      <param name="hzerror" value="4.5" />
      <param name="test_duration" value="5.0" /> 
    </test>
  </group>
</launch>
