<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)" />

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

    <!-- Test Codes -->
    <node name="phase_corr_saver" pkg="image_view" type="image_saver" args="image:=phase_corr/image" >
      <param name="filename_format" value="$(find opencv_apps)/test/phase_corr.png"/>
    </node>
    <param name="phase_corr_test/topic" value="phase_corr/shift" />    <!-- opencv_apps/Point2DStamped -->
    <test test-name="phase_corr_test" pkg="rostest" type="hztest" name="phase_corr_test" >
      <param name="hz" value="15" />
      <param name="hzerror" value="14" />
      <param name="test_duration" value="5.0" /> 
    </test>
  </group>
</launch>
