Skip to content

Commit

Permalink
add zdepth test
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Jan 26, 2023
1 parent 4824c7c commit 2c9838c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
12 changes: 12 additions & 0 deletions zdepth_image_transport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,15 @@ install(DIRECTORY include/${PROJECT_NAME}/
install(FILES zdepth_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

if(CATKIN_ENABLE_TESTING)
if("$ENV{ROS_DISTRO}" STRGREATER "kinetic")
find_package(roslaunch REQUIRED)
find_package(roslint REQUIRED)
find_package(rostest REQUIRED)
add_rostest(test/zdepth_image_transport_16uc1.test)
add_rostest(test/zdepth_image_transport_32fc1.test)
roslaunch_add_file_check(test/zdepth_image_transport_16uc1.test)
roslaunch_add_file_check(test/zdepth_image_transport_32fc1.test)
endif()
endif()
6 changes: 6 additions & 0 deletions zdepth_image_transport/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>zdepth</exec_depend>

<test_depend>depth_image_publisher</test_depend>
<test_depend>roslaunch</test_depend>
<test_depend>roslint</test_depend>
<test_depend>rostest</test_depend>

<export>
<image_transport plugin="${prefix}/zdepth_plugins.xml"/>
</export>
Expand Down
15 changes: 15 additions & 0 deletions zdepth_image_transport/test/zdepth_image_transport_16uc1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<launch>
<node name="depth_image_publisher" pkg="depth_image_publisher" type="depth_image_publisher"
args="$(find depth_image_publisher)/sample/sample_16uc1.png">
<param name="encoding" value="16UC1" />
</node>

<test name="zdepth_hztest_16uc1" test-name="zdepth_hztest_test_16uc1"
pkg="rostest" type="hztest">
<param name="topic" value="depth_image_publisher/image_raw/zdepth" />
<param name="hz" value="10.0" />
<param name="hzerror" value="1.0" />
<param name="test_duration" value="1.0" />
</test>

</launch>
15 changes: 15 additions & 0 deletions zdepth_image_transport/test/zdepth_image_transport_32fc1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<launch>
<node name="depth_image_publisher" pkg="depth_image_publisher" type="depth_image_publisher"
args="$(find depth_image_publisher)/sample/sample_16uc1.png">
<param name="encoding" value="32FC1" />
</node>

<test name="zdepth_hztest_32fc1" test-name="zdepth_hztest_test_32fc1"
pkg="rostest" type="hztest">
<param name="topic" value="depth_image_publisher/image_raw/zdepth" />
<param name="hz" value="10.0" />
<param name="hzerror" value="1.0" />
<param name="test_duration" value="1.0" />
</test>

</launch>

0 comments on commit 2c9838c

Please sign in to comment.