Skip to content

Commit

Permalink
[test] Cleaner namespace assignment.
Browse files Browse the repository at this point in the history
[face_detector][test common] Fix warning in .launch format.
Fix namespace in testcases.
Increase retry. .bag-based perceptional tests are hard to deterministic, so it makes sense to do this.
Set param use_sim_time.
[face_detector][test] hztest can be used for measureing no publishment. hzerror is not needed in that case.
[face_detector][test] Specify test name. Pass all args.
[face_detector][test] pass_all_args might require all args kept out of include tag.
[face_detector][test] Specify test-name.
[face_detector][test] Disable all tests other than rgbd. I couldn't figure out how to use launches other than face_detector.rgbdlaunch, after hours of trial on local machine. I leave that up to someone else.
[face_detector][test] Detection using rgbd works with this config.
[face_detector][test] Shorter test duration (bag files are less than 7 seconds).
[face_detector][test] Shorter test_duration. We only need a second or so as long as we can confirm the designated topic is being published.
[face_detector][test] rosbag play with clock and loop option.
  • Loading branch information
130s committed Feb 18, 2017
1 parent d78a042 commit 73cef7f
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 38 deletions.
16 changes: 8 additions & 8 deletions face_detector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ if(CATKIN_ENABLE_TESTING)
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test
MD5 59126117e049e69d577b7ee27251a6f8)

add_rostest(test/wide-stereo_true_rtest.xml)
add_rostest(test/wide-stereo_false_rtest.xml)
# add_rostest(test/wide-stereo_true_rtest.xml)
# add_rostest(test/wide-stereo_false_rtest.xml)
add_rostest(test/rgbd_true_rtest.xml)
add_rostest(test/rgbd_false_rtest.xml)
add_rostest(test/narrow-stereo_true_rtest.xml)
add_rostest(test/narrow-stereo_false_rtest.xml)
add_rostest(test/action-wide_true_rtest.xml)
add_rostest(test/action-wide_false_rtest.xml)
add_rostest(test/action-rgbd_true_rtest.xml)
add_rostest(test/action-rgbd_false_rtest.xml)
# add_rostest(test/narrow-stereo_true_rtest.xml)
# add_rostest(test/narrow-stereo_false_rtest.xml)
# add_rostest(test/action-wide_true_rtest.xml)
# add_rostest(test/action-wide_false_rtest.xml)
# add_rostest(test/action-rgbd_true_rtest.xml)
# add_rostest(test/action-rgbd_false_rtest.xml)

endif()
6 changes: 3 additions & 3 deletions face_detector/test/action-rgbd_false_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<launch>
<arg name="expected_success" value="false" />
<arg name="testnode_name" default="hztest_action_rgbd_false" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector_action.rgbd.launch" />

<include file="$(find face_detector)/test/common_rtest.xml">
<arg name="expected_success" value="false" />
</include>
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
3 changes: 2 additions & 1 deletion face_detector/test/action-rgbd_true_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<launch>
<arg name="testnode_name" default="hztest_action_rgbd_true" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector_action.rgbd.launch" />

<include file="$(find face_detector)/test/common_rtest.xml" />
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
6 changes: 3 additions & 3 deletions face_detector/test/action-wide_false_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<launch>
<arg name="expected_success" value="false" />
<arg name="testnode_name" default="hztest_action_wide_false" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector_action.wide.launch"/>

<include file="$(find face_detector)/test/common_rtest.xml">
<arg name="expected_success" value="false" />
</include>
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
4 changes: 3 additions & 1 deletion face_detector/test/action-wide_true_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<launch>
<arg name="expected_success" value="false" />
<arg name="testnode_name" default="hztest_action_wide_true" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector_action.wide.launch"/>

<include file="$(find face_detector)/test/common_rtest.xml" />
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
30 changes: 22 additions & 8 deletions face_detector/test/common_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
<launch>
<arg name="expected_success" default="true" />
<arg name="hz" default="30.0" />
<arg name="hztest_duration" default="2.0" />
<arg name="hz_error" default="29.9" />
<arg name="RETRY_TEST" default="5" />
<arg name="testnode_name" default="hztest1" />
<arg name="topicname_hztest" default="face_detector/people_tracker_measurements_array" />

<param name ="use_sim_time" value="true" />

<group unless="$(arg expected_success)">
<node pkg="rosbag" type="play" name="play" args="-r 0.5 $(find face_detector)/test/face_detector_noface_test_diamondback.bag"/>
<param name="hztest1/hz" value="0.0" />
<node pkg="rosbag" type="play" name="play" args="--clock -l -r 0.5 $(find face_detector)/test/face_detector_noface_test_diamondback.bag"/>

<test test-name="hztest_noface_$(arg testnode_name)" pkg="rostest" type="hztest" name="$(arg testnode_name)" retry="$(arg RETRY_TEST)">
<param name="topic" value="face_detector/people_tracker_measurements_array" />
<param name="hz" value="0.0" />
<param name="test_duration" value="$(arg hztest_duration)" />
</test>
</group>
<group if="$(arg expected_success)">
<node pkg="rosbag" type="play" name="play" args="-r 0.5 $(find face_detector)/test/face_detector_withface_test_diamondback.bag"/>
<param name="hztest1/hz" value="30.0" />
<param name="hztest1/hzerror" value="29.9" />

<test test-name="hztest_withface_$(arg topicname_hztest)" pkg="rostest" type="hztest" name="$(arg testnode_name)" retry="$(arg RETRY_TEST)">
<param name="topic" value="$(arg topicname_hztest)" />
<param name="hz" value="$(arg hz)" />
<param name="hzerror" value="$(arg hz_error)" />
<param name="test_duration" value="$(arg hztest_duration)" />
</test>
</group>

<param name="hztest1/topic" value="face_detector/people_tracker_measurements_array" />
<param name="hztest1/test_duration" value="15.0" />
<test test-name="hztest_test" pkg="rostest" type="hztest" name="hztest1" />
</launch>
6 changes: 3 additions & 3 deletions face_detector/test/narrow-stereo_false_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<launch>
<arg name="expected_success" value="false" />
<arg name="testnode_name" default="hztest_narrow_stereo_false" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector.narrow.launch"/>

<include file="$(find face_detector)/test/common_rtest.xml">
<arg name="expected_success" value="false" />
</include>
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
3 changes: 2 additions & 1 deletion face_detector/test/narrow-stereo_true_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<launch>
<arg name="testnode_name" default="hztest_narrow_stereo_true" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector.narrow.launch"/>

<include file="$(find face_detector)/test/common_rtest.xml" />
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
15 changes: 11 additions & 4 deletions face_detector/test/rgbd_false_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<launch>
<arg name="expected_success" value="false" />
<arg name="testnode_name" default="hztest_rgbd_false" />
<arg name="topicname_hztest" default="/face_detector/faces_cloud" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector.rgbd.launch"/>
<include file="$(find face_detector)/launch/face_detector.rgbd.launch">
<arg name="camera" value="wide_stereo" />
<arg name="rgb_ns" value="right" />
<arg name="image_topic" value="image_raw" />
<arg name="depth_ns" value="right" />
<arg name="depth_topic" value="image_raw" />
</include>

<include file="$(find face_detector)/test/common_rtest.xml">
<arg name="expected_success" value="false" />
</include>
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
14 changes: 12 additions & 2 deletions face_detector/test/rgbd_true_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<launch>
<arg name="hz" default="500.0" />
<arg name="hz_error" default="499.9" />
<arg name="testnode_name" default="hztest_rgbd_true" />
<arg name="topicname_hztest" default="/face_detector/faces_cloud" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector.rgbd.launch"/>
<include file="$(find face_detector)/launch/face_detector.rgbd.launch">
<arg name="camera" value="wide_stereo" />
<arg name="rgb_ns" value="right" />
<arg name="image_topic" value="image_raw" />
<arg name="depth_ns" value="right" />
<arg name="depth_topic" value="image_raw" />
</include>

<include file="$(find face_detector)/test/common_rtest.xml" />
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
6 changes: 3 additions & 3 deletions face_detector/test/wide-stereo_false_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<launch>
<arg name="expected_success" value="false" />
<arg name="testnode_name" default="hztest_wide_stereo_false" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector.wide.launch"/>

<include file="$(find face_detector)/test/common_rtest.xml">
<arg name="expected_success" value="false" />
</include>
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>
3 changes: 2 additions & 1 deletion face_detector/test/wide-stereo_true_rtest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<launch>
<arg name="testnode_name" default="hztest_wide_stereo_true" />

<node ns="wide_stereo" pkg="stereo_image_proc" type="stereo_image_proc" name="stereo" />

<include file="$(find face_detector)/launch/face_detector.wide.launch"/>

<include file="$(find face_detector)/test/common_rtest.xml" />
<include file="$(find face_detector)/test/common_rtest.xml" pass_all_args="true" />
</launch>

0 comments on commit 73cef7f

Please sign in to comment.