From 83fe6513dd09ee3fdb01c46c98d5b188737e83e4 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 17:14:49 +0900 Subject: [PATCH 01/10] Organize cmake setup order 1. Initialization 2. Download 3. Catkin setup 4. Build 5. Install 6. Test --- jsk_perception/CMakeLists.txt | 50 ++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index bb72ad8f7e..7acaeab153 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -1,6 +1,12 @@ cmake_minimum_required(VERSION 2.8.3) project(jsk_perception) +# ------------------------------------------------------------------------------------ +# Initialization +# 1. Resolve dependencies with find_package +# 2. Set build flags +# ------------------------------------------------------------------------------------ + # Use ccache if installed to make it fast to generate object files find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) @@ -58,6 +64,27 @@ add_definitions("-g -O2") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z defs") endif() + +# ------------------------------------------------------------------------------------ +# Download +# ------------------------------------------------------------------------------------ + +# download and install sample data +add_custom_target(install_sample_data ALL COMMAND ${PROJECT_SOURCE_DIR}/scripts/install_sample_data.py) +# download and install trained data +add_custom_target(install_trained_data ALL COMMAND ${PROJECT_SOURCE_DIR}/scripts/install_trained_data.py) + +execute_process( + COMMAND cmake -E chdir ${CMAKE_CURRENT_BINARY_DIR} + make -f ${PROJECT_SOURCE_DIR}/Makefile.slic + INSTALL_DIR=${CATKIN_DEVEL_PREFIX} + MK_DIR=${mk_PREFIX}/share/mk installed + RESULT_VARIABLE _make_failed) + +# ------------------------------------------------------------------------------------ +# Catkin setup +# ------------------------------------------------------------------------------------ + # Dynamic reconfigure support generate_dynamic_reconfigure_options( cfg/RectArrayActualSizeFilter.cfg @@ -109,12 +136,9 @@ catkin_package( LIBRARIES jsk_perception oriented_gradient ) -execute_process( - COMMAND cmake -E chdir ${CMAKE_CURRENT_BINARY_DIR} - make -f ${PROJECT_SOURCE_DIR}/Makefile.slic - INSTALL_DIR=${CATKIN_DEVEL_PREFIX} - MK_DIR=${mk_PREFIX}/share/mk installed - RESULT_VARIABLE _make_failed) +# ------------------------------------------------------------------------------------ +# Build +# ------------------------------------------------------------------------------------ include_directories(include ${catkin_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/build/patched-SLIC-Superpixels) @@ -132,8 +156,6 @@ add_library(oriented_gradient src/oriented_gradient.cpp) add_executable(oriented_gradient_node src/oriented_gradient_node.cpp) add_executable(sliding_window_object_detector_trainer_node src/sliding_window_object_detector_trainer_node.cpp) -set(jsk_perception_nodes_without_test "") - file(GLOB jsk_perception_node_scripts ${PROJECT_SOURCE_DIR}/node_scripts/*) foreach(_node_script ${jsk_perception_node_scripts}) get_filename_component(_node_name ${_node_script} NAME_WE) @@ -284,10 +306,9 @@ add_custom_target(eusmodel_template ALL DEPENDS ${PROJECT_SOURCE_DIR}/launch/eusmodel_detection_elevator-panels-eng8.launch ${PROJECT_SOURCE_DIR}/launch/eusmodel_detection_elevator-panels-eng2.launch) -# download and install sample data -add_custom_target(install_sample_data ALL COMMAND ${PROJECT_SOURCE_DIR}/scripts/install_sample_data.py) -# download and install trained data -add_custom_target(install_trained_data ALL COMMAND ${PROJECT_SOURCE_DIR}/scripts/install_trained_data.py) +# ------------------------------------------------------------------------------------ +# Install +# ------------------------------------------------------------------------------------ install(TARGETS camshiftdemo virtual_camera_mono point_pose_extractor white_balance_converter hough_lines rectangle_detector calc_flow color_histogram_sliding_matcher oriented_gradient oriented_gradient_node ${PROJECT_NAME} ${jsk_perception_nodelet_executables} @@ -309,7 +330,10 @@ install(DIRECTORY include/${PROJECT_NAME}/ install(FILES jsk_perception_nodelets.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) -message(AUTHOR_WARNING "Node/Nodelets without rostest: ${jsk_perception_nodes_without_test}") +# ------------------------------------------------------------------------------------ +# Test +# ------------------------------------------------------------------------------------ +message(AUTHOR_WARNING "Node/Nodelets without rostest: ${${PROJECT_NAME}_nodes_without_test}") if(CATKIN_ENABLE_TESTING) find_package(roslaunch REQUIRED) From 9fe188dd898ff5bafd69116433cf86274d5e212a Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:08:07 +0900 Subject: [PATCH 02/10] Fix node executables installation by introducing macro --- jsk_perception/CMakeLists.txt | 71 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index 7acaeab153..bf1c059b5d 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -140,21 +140,9 @@ catkin_package( # Build # ------------------------------------------------------------------------------------ -include_directories(include ${catkin_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/build/patched-SLIC-Superpixels) +# Build nodelet executables -link_directories(${catkin_LIBRARY_DIRS}) -add_executable(camshiftdemo src/camshiftdemo.cpp) -add_executable(linemod src/linemod.cpp) -add_executable(virtual_camera_mono src/virtual_camera_mono.cpp) -add_executable(point_pose_extractor src/point_pose_extractor.cpp) -add_executable(white_balance_converter src/white_balance_converter.cpp) -add_executable(hough_lines src/hough_lines.cpp) -add_executable(rectangle_detector src/rectangle_detector.cpp) -add_executable(calc_flow src/calc_flow.cpp) -add_executable(color_histogram_sliding_matcher src/color_histogram_sliding_matcher.cpp) -add_library(oriented_gradient src/oriented_gradient.cpp) -add_executable(oriented_gradient_node src/oriented_gradient_node.cpp) -add_executable(sliding_window_object_detector_trainer_node src/sliding_window_object_detector_trainer_node.cpp) +include_directories(include ${catkin_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/build/patched-SLIC-Superpixels) file(GLOB jsk_perception_node_scripts ${PROJECT_SOURCE_DIR}/node_scripts/*) foreach(_node_script ${jsk_perception_node_scripts}) @@ -265,29 +253,32 @@ if(${OpenCV_VERSION} VERSION_GREATER "2.4.8") endif() add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) +# Build node executables -target_link_libraries(camshiftdemo ${catkin_LIBRARIES}) -target_link_libraries(linemod ${catkin_LIBRARIES}) -target_link_libraries(virtual_camera_mono ${catkin_LIBRARIES}) -target_link_libraries(point_pose_extractor ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -target_link_libraries(edge_detector ${catkin_LIBRARIES}) -target_link_libraries(white_balance_converter ${catkin_LIBRARIES}) -target_link_libraries(hough_lines ${catkin_LIBRARIES}) -target_link_libraries(rectangle_detector ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -target_link_libraries(calc_flow ${catkin_LIBRARIES}) -target_link_libraries(color_histogram_sliding_matcher ${catkin_LIBRARIES}) -target_link_libraries(oriented_gradient_node ${catkin_LIBRARIES} ${Boost_LIBRARIES} oriented_gradient) -target_link_libraries(oriented_gradient ${catkin_LIBRARIES} ${Boost_LIBRARIES} oriented_gradient) -target_link_libraries(sliding_window_object_detector_trainer_node ${PROJECT_NAME} ${catkin_LIBRARIES}) - -add_dependencies(camshiftdemo ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) -add_dependencies(virtual_camera_mono ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) -add_dependencies(point_pose_extractor ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp libsiftfast) -add_dependencies(white_balance_converter ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) -add_dependencies(hough_lines ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) -add_dependencies(rectangle_detector ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) -add_dependencies(color_histogram_sliding_matcher ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) +macro(_add_node _node_cpp _node_exec_name) + cmake_parse_arguments(ARG "" "" "DEPENDS;LIBRARIES" ${ARGN}) + add_executable(${_node_exec_name} ${_node_cpp}) + target_link_libraries(${_node_exec_name} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${ARG_LIBRARIES}) + add_dependencies(${_node_exec_name} ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp ${ARG_DEPENDS}) + list(APPEND ${PROJECT_NAME}_node_executables ${_node_exec_name}) +endmacro() +add_library(oriented_gradient src/oriented_gradient.cpp) +target_link_libraries(oriented_gradient ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + +_add_node(src/camshiftdemo.cpp camshiftdemo) +_add_node(src/linemod.cpp linemod) +_add_node(src/virtual_camera_mono.cpp virtual_camera_mono) +_add_node(src/point_pose_extractor.cpp point_pose_extractor DEPENDS libsiftfast) +_add_node(src/white_balance_converter.cpp white_balance_converter) +_add_node(src/hough_lines.cpp hough_lines) +_add_node(src/rectangle_detector.cpp rectangle_detector) +_add_node(src/calc_flow.cpp calc_flow) +_add_node(src/color_histogram_sliding_matcher.cpp color_histogram_sliding_matcher) +_add_node(src/oriented_gradient_node.cpp oriented_gradient_node + DEPENDS oriented_gradient LIBRARIES oriented_gradient) +_add_node(src/sliding_window_object_detector_trainer_node.cpp sliding_window_object_detector_trainer_node + DEPENDS ${PROJECT_NAME} LIBRARIES ${PROJECT_NAME}) add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/launch/eusmodel_detection_elevator-panels-eng8.launch @@ -310,8 +301,14 @@ add_custom_target(eusmodel_template ALL DEPENDS # Install # ------------------------------------------------------------------------------------ -install(TARGETS camshiftdemo virtual_camera_mono point_pose_extractor white_balance_converter hough_lines rectangle_detector calc_flow color_histogram_sliding_matcher oriented_gradient oriented_gradient_node ${PROJECT_NAME} - ${jsk_perception_nodelet_executables} +install(TARGETS + # Libraries + ${PROJECT_NAME} + oriented_gradient + # Node executables + ${${PROJECT_NAME}_node_executables} + # Nodelet executables + ${${PROJECT_NAME}_nodelet_executables} ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} From ab9fb8e56dfd5598a299b7125428072f067304f5 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:10:54 +0900 Subject: [PATCH 03/10] Fix missing CATKIN_DEPENDS of posedetection_msgs --- jsk_perception/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index bf1c059b5d..fc86d7d40a 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -130,7 +130,14 @@ generate_messages( ) catkin_package( - CATKIN_DEPENDS std_msgs sensor_msgs geometry_msgs message_runtime jsk_recognition_msgs jsk_recognition_utils + CATKIN_DEPENDS + geometry_msgs + jsk_recognition_msgs + jsk_recognition_utils + message_runtime + posedetection_msgs + sensor_msgs + std_msgs DEPENDS INCLUDE_DIRS include LIBRARIES jsk_perception oriented_gradient From f86afaedd57dfb2fb784a176e2104c9bfe142731 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:19:09 +0900 Subject: [PATCH 04/10] Fix if block syntax - Use endif() - Use quote "" for VERSION_GREATER --- jsk_perception/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index fc86d7d40a..d4e0ea9c44 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -12,7 +12,7 @@ find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif(CCACHE_FOUND) +endif() find_package(catkin REQUIRED COMPONENTS angles @@ -48,10 +48,10 @@ message("OPENCV ${OpenCV_VERSION} FOUND") find_package(Eigen REQUIRED) pkg_check_modules(yaml_cpp yaml-cpp REQUIRED) -IF(${yaml_cpp_VERSION} VERSION_LESS "0.5.0") +if(${yaml_cpp_VERSION} VERSION_LESS "0.5.0") ## indigo yaml-cpp : 0.5.0 / hydro yaml-cpp : 0.3.0 add_definitions("-DUSE_OLD_YAML") -ENDIF() +endif() find_package(OpenMP) if(OPENMP_FOUND) @@ -253,8 +253,8 @@ target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${robot_self_filter_LI if(robot_self_filter_FOUND) include_directories(${robot_self_filter_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} ${robot_self_filter_LIBRARIES}) -endif(robot_self_filter_FOUND) -if(${OpenCV_VERSION} VERSION_GREATER "2.4.8") +endif() +if("${OpenCV_VERSION}" VERSION_GREATER "2.4.8") # This condition is to avoid changing current behavior target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES}) endif() From 72bab9fd44e226ad3d0828b2fa5707374ec53fc9 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:20:26 +0900 Subject: [PATCH 05/10] Sort service files --- jsk_perception/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index d4e0ea9c44..d36b4b849e 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -123,7 +123,13 @@ generate_dynamic_reconfigure_options( cfg/LabelToMaskImage.cfg ) -add_service_files(FILES EuclideanSegment.srv SetTemplate.srv WhiteBalancePoints.srv WhiteBalance.srv NonMaximumSuppression.srv) +add_service_files(FILES + EuclideanSegment.srv + NonMaximumSuppression.srv + SetTemplate.srv + WhiteBalancePoints.srv + WhiteBalance.srv +) generate_messages( DEPENDENCIES std_msgs sensor_msgs geometry_msgs jsk_recognition_msgs From 3413175f7a09d422258b19ab179d55db73ee5dfb Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:22:27 +0900 Subject: [PATCH 06/10] Refactor: jsk_perception_nodelet -> _add_nodelet --- jsk_perception/CMakeLists.txt | 126 +++++++++++++++++----------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index d36b4b849e..5ae02f5caa 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -166,75 +166,75 @@ foreach(_node_script ${jsk_perception_node_scripts}) endif() endforeach() -macro(jsk_perception_nodelet _nodelet_cpp _nodelet_class _single_nodelet_exec_name) - if(NOT EXISTS ${PROJECT_SOURCE_DIR}/test/${_single_nodelet_exec_name}.test) - list(APPEND jsk_perception_nodes_without_test ${_nodelet_cpp}) +macro(_add_nodelet _nodelet_cpp _nodelet_class _single_nodelet_exec_name) + if(NOT EXISTS "${PROJECT_SOURCE_DIR}/test/${_single_nodelet_exec_name}.test") + list(APPEND ${PROJECT_NAME}_nodes_without_test ${_nodelet_cpp}) endif() jsk_nodelet(${_nodelet_cpp} ${_nodelet_class} ${_single_nodelet_exec_name} jsk_perception_nodelet_sources jsk_perception_nodelet_executables) endmacro() -jsk_perception_nodelet(src/bounding_box_to_rect.cpp "jsk_perception/BoundingBoxToRect" "bounding_box_to_rect") -jsk_perception_nodelet(src/rect_array_actual_size_filter.cpp "jsk_perception/RectArrayActualSizeFilter" "rect_array_actual_size_filter") -jsk_perception_nodelet(src/rect_array_to_density_image.cpp "jsk_perception/RectArrayToDensityImage" "rect_array_to_density_image") -jsk_perception_nodelet(src/polygon_array_color_likelihood.cpp "jsk_perception/PolygonArrayColorLikelihood" "polygon_array_color_likelihood") -jsk_perception_nodelet(src/polygon_array_color_histogram.cpp "jsk_perception/PolygonArrayColorHistogram" "polygon_array_color_histogram") -jsk_perception_nodelet(src/edge_detector.cpp "jsk_perception/EdgeDetector" "edge_detector") -jsk_perception_nodelet(src/sparse_image_encoder.cpp "jsk_perception/SparseImageEncoder" "sparse_image_encoder") -jsk_perception_nodelet(src/sparse_image_decoder.cpp "jsk_perception/SparseImageDecoder" "sparse_image_decoder") -jsk_perception_nodelet(src/color_histogram.cpp "jsk_perception/ColorHistogram" "color_histogram") -jsk_perception_nodelet(src/background_substraction_nodelet.cpp "jsk_perception/BackgroundSubstraction" "background_substraction") -jsk_perception_nodelet(src/hough_circles.cpp "jsk_perception/HoughCircleDetector" "hough_circles") -jsk_perception_nodelet(src/fisheye_to_panorama.cpp "jsk_perception/FisheyeToPanorama" "fisheye_to_panorama") -jsk_perception_nodelet(src/grabcut_nodelet.cpp "jsk_perception/GrabCut" "grabcut") -jsk_perception_nodelet(src/slic_superpixels.cpp "jsk_perception/SLICSuperPixels" "slic_super_pixels") -jsk_perception_nodelet(src/rgb_decomposer.cpp "jsk_perception/RGBDecomposer" "rgb_decomposer") -jsk_perception_nodelet(src/hsv_decomposer.cpp "jsk_perception/HSVDecomposer" "hsv_decomposer") -jsk_perception_nodelet(src/lab_decomposer.cpp "jsk_perception/LabDecomposer" "lab_decomposer") -jsk_perception_nodelet(src/ycc_decomposer.cpp "jsk_perception/YCCDecomposer" "ycc_decomposer") -jsk_perception_nodelet(src/contour_finder.cpp "jsk_perception/ContourFinder" "contour_finder") -jsk_perception_nodelet(src/snake_segmentation.cpp "jsk_perception/SnakeSegmentation" "snake_segmentation") -jsk_perception_nodelet(src/colorize_labels.cpp "jsk_perception/ColorizeLabels" "colorize_labels") -jsk_perception_nodelet(src/colorize_float_image.cpp "jsk_perception/ColorizeFloatImage" "colorize_float_image") -jsk_perception_nodelet(src/overlay_image_color_on_mono.cpp "jsk_perception/OverlayImageColorOnMono" "overlay_image_color_on_mono") -jsk_perception_nodelet(src/grid_label.cpp "jsk_perception/GridLabel" "grid_label") -jsk_perception_nodelet(src/color_histogram_label_match.cpp "jsk_perception/ColorHistogramLabelMatch" "color_histogram_label_match") -jsk_perception_nodelet(src/apply_mask_image.cpp "jsk_perception/ApplyMaskImage" "apply_mask_image") -jsk_perception_nodelet(src/unapply_mask_image.cpp "jsk_perception/UnapplyMaskImage" "unapply_mask_image") -jsk_perception_nodelet(src/single_channel_histogram.cpp "jsk_perception/SingleChannelHistogram" "single_channel_histogram") -jsk_perception_nodelet(src/blob_detector.cpp "jsk_perception/BlobDetector" "blob_detector") -jsk_perception_nodelet(src/add_mask_image.cpp "jsk_perception/AddMaskImage" "add_mask_image") -jsk_perception_nodelet(src/multiply_mask_image.cpp "jsk_perception/MultiplyMaskImage" "multiply_mask_image") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/ErodeMaskImage" "erode_mask_image") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/DilateMaskImage" "dilate_mask_image") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/Opening" "opening") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/Closing" "closing") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/MorphologicalGradient" "morphological_gradient") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/TopHat" "top_hat") -jsk_perception_nodelet(src/morphological_operator.cpp "jsk_perception/BlackHat" "black_hat") -jsk_perception_nodelet(src/label_to_mask_image.cpp "jsk_perception/LabelToMaskImage" "label_to_mask_image") -jsk_perception_nodelet(src/rect_to_mask_image.cpp "jsk_perception/RectToMaskImage" "rect_to_mask_image") -jsk_perception_nodelet(src/mask_image_to_roi.cpp "jsk_perception/MaskImageToROI" "mask_image_to_roi") -jsk_perception_nodelet(src/mask_image_to_rect.cpp "jsk_perception/MaskImageToRect" "mask_image_to_rect") -jsk_perception_nodelet(src/bounding_rect_mask_image.cpp "jsk_perception/BoundingRectMaskImage" "bounding_rect_mask_image") -jsk_perception_nodelet(src/bounding_object_mask_image.cpp "jsk_perception/BoundingObjectMaskImage" "bounding_object_mask_image") -jsk_perception_nodelet(src/roi_to_rect.cpp "jsk_perception/ROIToRect" "roi_to_rect") -jsk_perception_nodelet(src/roi_to_mask_image.cpp "jsk_perception/ROIToMaskImage" "roi_to_mask_image") -jsk_perception_nodelet(src/polygon_to_mask_image.cpp "jsk_perception/PolygonToMaskImage" "polygon_to_mask_image") -jsk_perception_nodelet(src/polygon_array_to_label_image.cpp "jsk_perception/PolygonArrayToLabelImage" "polygon_array_to_label_image") -jsk_perception_nodelet(src/rect_to_roi.cpp "jsk_perception/RectToROI" "rect_to_roi") -jsk_perception_nodelet(src/convex_hull_mask_image.cpp "jsk_perception/ConvexHullMaskImage" "convex_hull_mask_image") -jsk_perception_nodelet(src/mask_image_generator.cpp "jsk_perception/MaskImageGenerator" "mask_image_generator") -jsk_perception_nodelet(src/project_image_point.cpp "jsk_perception/ProjectImagePoint" "project_image_point") -jsk_perception_nodelet(src/sliding_window_object_detector.cpp "jsk_perception/SlidingWindowObjectDetector" "sliding_window_object_detector") -jsk_perception_nodelet(src/gaussian_blur.cpp "jsk_perception/GaussianBlur" "gaussian_blur") -jsk_perception_nodelet(src/kmeans.cpp "jsk_perception/KMeans" "kmeans") -if(${OpenCV_VERSION} VERSION_GREATER "2.9.9") # >= 3.0.0 - jsk_perception_nodelet(src/bing.cpp "jsk_perception/Bing" "bing") +_add_nodelet(src/bounding_box_to_rect.cpp "jsk_perception/BoundingBoxToRect" "bounding_box_to_rect") +_add_nodelet(src/rect_array_actual_size_filter.cpp "jsk_perception/RectArrayActualSizeFilter" "rect_array_actual_size_filter") +_add_nodelet(src/rect_array_to_density_image.cpp "jsk_perception/RectArrayToDensityImage" "rect_array_to_density_image") +_add_nodelet(src/polygon_array_color_likelihood.cpp "jsk_perception/PolygonArrayColorLikelihood" "polygon_array_color_likelihood") +_add_nodelet(src/polygon_array_color_histogram.cpp "jsk_perception/PolygonArrayColorHistogram" "polygon_array_color_histogram") +_add_nodelet(src/edge_detector.cpp "jsk_perception/EdgeDetector" "edge_detector") +_add_nodelet(src/sparse_image_encoder.cpp "jsk_perception/SparseImageEncoder" "sparse_image_encoder") +_add_nodelet(src/sparse_image_decoder.cpp "jsk_perception/SparseImageDecoder" "sparse_image_decoder") +_add_nodelet(src/color_histogram.cpp "jsk_perception/ColorHistogram" "color_histogram") +_add_nodelet(src/background_substraction_nodelet.cpp "jsk_perception/BackgroundSubstraction" "background_substraction") +_add_nodelet(src/hough_circles.cpp "jsk_perception/HoughCircleDetector" "hough_circles") +_add_nodelet(src/fisheye_to_panorama.cpp "jsk_perception/FisheyeToPanorama" "fisheye_to_panorama") +_add_nodelet(src/grabcut_nodelet.cpp "jsk_perception/GrabCut" "grabcut") +_add_nodelet(src/slic_superpixels.cpp "jsk_perception/SLICSuperPixels" "slic_super_pixels") +_add_nodelet(src/rgb_decomposer.cpp "jsk_perception/RGBDecomposer" "rgb_decomposer") +_add_nodelet(src/hsv_decomposer.cpp "jsk_perception/HSVDecomposer" "hsv_decomposer") +_add_nodelet(src/lab_decomposer.cpp "jsk_perception/LabDecomposer" "lab_decomposer") +_add_nodelet(src/ycc_decomposer.cpp "jsk_perception/YCCDecomposer" "ycc_decomposer") +_add_nodelet(src/contour_finder.cpp "jsk_perception/ContourFinder" "contour_finder") +_add_nodelet(src/snake_segmentation.cpp "jsk_perception/SnakeSegmentation" "snake_segmentation") +_add_nodelet(src/colorize_labels.cpp "jsk_perception/ColorizeLabels" "colorize_labels") +_add_nodelet(src/colorize_float_image.cpp "jsk_perception/ColorizeFloatImage" "colorize_float_image") +_add_nodelet(src/overlay_image_color_on_mono.cpp "jsk_perception/OverlayImageColorOnMono" "overlay_image_color_on_mono") +_add_nodelet(src/grid_label.cpp "jsk_perception/GridLabel" "grid_label") +_add_nodelet(src/color_histogram_label_match.cpp "jsk_perception/ColorHistogramLabelMatch" "color_histogram_label_match") +_add_nodelet(src/apply_mask_image.cpp "jsk_perception/ApplyMaskImage" "apply_mask_image") +_add_nodelet(src/unapply_mask_image.cpp "jsk_perception/UnapplyMaskImage" "unapply_mask_image") +_add_nodelet(src/single_channel_histogram.cpp "jsk_perception/SingleChannelHistogram" "single_channel_histogram") +_add_nodelet(src/blob_detector.cpp "jsk_perception/BlobDetector" "blob_detector") +_add_nodelet(src/add_mask_image.cpp "jsk_perception/AddMaskImage" "add_mask_image") +_add_nodelet(src/multiply_mask_image.cpp "jsk_perception/MultiplyMaskImage" "multiply_mask_image") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/ErodeMaskImage" "erode_mask_image") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/DilateMaskImage" "dilate_mask_image") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/Opening" "opening") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/Closing" "closing") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/MorphologicalGradient" "morphological_gradient") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/TopHat" "top_hat") +_add_nodelet(src/morphological_operator.cpp "jsk_perception/BlackHat" "black_hat") +_add_nodelet(src/label_to_mask_image.cpp "jsk_perception/LabelToMaskImage" "label_to_mask_image") +_add_nodelet(src/rect_to_mask_image.cpp "jsk_perception/RectToMaskImage" "rect_to_mask_image") +_add_nodelet(src/mask_image_to_roi.cpp "jsk_perception/MaskImageToROI" "mask_image_to_roi") +_add_nodelet(src/mask_image_to_rect.cpp "jsk_perception/MaskImageToRect" "mask_image_to_rect") +_add_nodelet(src/bounding_rect_mask_image.cpp "jsk_perception/BoundingRectMaskImage" "bounding_rect_mask_image") +_add_nodelet(src/bounding_object_mask_image.cpp "jsk_perception/BoundingObjectMaskImage" "bounding_object_mask_image") +_add_nodelet(src/roi_to_rect.cpp "jsk_perception/ROIToRect" "roi_to_rect") +_add_nodelet(src/roi_to_mask_image.cpp "jsk_perception/ROIToMaskImage" "roi_to_mask_image") +_add_nodelet(src/polygon_to_mask_image.cpp "jsk_perception/PolygonToMaskImage" "polygon_to_mask_image") +_add_nodelet(src/polygon_array_to_label_image.cpp "jsk_perception/PolygonArrayToLabelImage" "polygon_array_to_label_image") +_add_nodelet(src/rect_to_roi.cpp "jsk_perception/RectToROI" "rect_to_roi") +_add_nodelet(src/convex_hull_mask_image.cpp "jsk_perception/ConvexHullMaskImage" "convex_hull_mask_image") +_add_nodelet(src/mask_image_generator.cpp "jsk_perception/MaskImageGenerator" "mask_image_generator") +_add_nodelet(src/project_image_point.cpp "jsk_perception/ProjectImagePoint" "project_image_point") +_add_nodelet(src/sliding_window_object_detector.cpp "jsk_perception/SlidingWindowObjectDetector" "sliding_window_object_detector") +_add_nodelet(src/gaussian_blur.cpp "jsk_perception/GaussianBlur" "gaussian_blur") +_add_nodelet(src/kmeans.cpp "jsk_perception/KMeans" "kmeans") +if("${OpenCV_VERSION}" VERSION_GREATER "2.9.9") # >= 3.0.0 + _add_nodelet(src/bing.cpp "jsk_perception/Bing" "bing") endif() -jsk_perception_nodelet(src/tabletop_color_difference_likelihood.cpp "jsk_perception/TabletopColorDifferenceLikelihood" "tabletop_color_difference_likelihood") +_add_nodelet(src/tabletop_color_difference_likelihood.cpp "jsk_perception/TabletopColorDifferenceLikelihood" "tabletop_color_difference_likelihood") if(OPENMP_FOUND) - jsk_perception_nodelet(src/saliency_map_generator_node.cpp "jsk_perception/SaliencyMapGenerator" "saliency_map_generator") - jsk_perception_nodelet(src/skeletonization_nodelet.cpp "jsk_perception/Skeletonization" "skeletonization") + _add_nodelet(src/saliency_map_generator_node.cpp "jsk_perception/SaliencyMapGenerator" "saliency_map_generator") + _add_nodelet(src/skeletonization_nodelet.cpp "jsk_perception/Skeletonization" "skeletonization") endif() # robot_self_filter is released on version greater than indigo From 4d2a009bb768de919194251da0fb1bac3670ab63 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:23:04 +0900 Subject: [PATCH 07/10] Refactor: jsk_perception -> ${PROJECT_NAME} --- jsk_perception/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index 5ae02f5caa..b7b17a7a21 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -146,7 +146,7 @@ catkin_package( std_msgs DEPENDS INCLUDE_DIRS include - LIBRARIES jsk_perception oriented_gradient + LIBRARIES ${PROJECT_NAME} oriented_gradient ) # ------------------------------------------------------------------------------------ @@ -157,12 +157,12 @@ catkin_package( include_directories(include ${catkin_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/build/patched-SLIC-Superpixels) -file(GLOB jsk_perception_node_scripts ${PROJECT_SOURCE_DIR}/node_scripts/*) -foreach(_node_script ${jsk_perception_node_scripts}) +file(GLOB ${PROJECT_NAME}_node_scripts ${PROJECT_SOURCE_DIR}/node_scripts/*) +foreach(_node_script ${${PROJECT_NAME}_node_scripts}) get_filename_component(_node_name ${_node_script} NAME_WE) get_filename_component(_basename ${_node_script} NAME) if(NOT EXISTS ${PROJECT_SOURCE_DIR}/test/${_node_name}.test) - list(APPEND jsk_perception_nodes_without_test node_scripts/${_basename}) + list(APPEND ${PROJECT_NAME}_nodes_without_test node_scripts/${_basename}) endif() endforeach() @@ -171,7 +171,7 @@ macro(_add_nodelet _nodelet_cpp _nodelet_class _single_nodelet_exec_name) list(APPEND ${PROJECT_NAME}_nodes_without_test ${_nodelet_cpp}) endif() jsk_nodelet(${_nodelet_cpp} ${_nodelet_class} ${_single_nodelet_exec_name} - jsk_perception_nodelet_sources jsk_perception_nodelet_executables) + ${PROJECT_NAME}_nodelet_sources ${PROJECT_NAME}_nodelet_executables) endmacro() _add_nodelet(src/bounding_box_to_rect.cpp "jsk_perception/BoundingBoxToRect" "bounding_box_to_rect") _add_nodelet(src/rect_array_actual_size_filter.cpp "jsk_perception/RectArrayActualSizeFilter" "rect_array_actual_size_filter") @@ -247,11 +247,11 @@ endif() if(robot_self_filter_FOUND) message(AUTHOR_WARNING "robot_self_filter is found.") - jsk_perception_nodelet(src/robot_to_mask_image.cpp "jsk_perception/RobotToMaskImage" "robot_to_mask_image") -endif(robot_self_filter_FOUND) + _add_nodelet(src/robot_to_mask_image.cpp "jsk_perception/RobotToMaskImage" "robot_to_mask_image") +endif() # compiling jsk_perception library for nodelet -add_library(${PROJECT_NAME} SHARED ${jsk_perception_nodelet_sources} +add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_nodelet_sources} ${CMAKE_CURRENT_BINARY_DIR}/build/patched-SLIC-Superpixels/slic.cpp src/histogram_of_oriented_gradients.cpp ) @@ -338,7 +338,7 @@ install(DIRECTORY sample launch euslisp install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) -install(FILES jsk_perception_nodelets.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) +install(FILES ${PROJECT_NAME}_nodelets.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) # ------------------------------------------------------------------------------------ # Test From f41bebb6695399516c0fea81d436f084bb57244d Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sun, 7 Aug 2016 18:23:16 +0900 Subject: [PATCH 08/10] Refactor: jsk_perception_add_rostest -> _add_rostest --- jsk_perception/CMakeLists.txt | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index b7b17a7a21..504c580fc1 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -359,43 +359,43 @@ if(CATKIN_ENABLE_TESTING) roslint_python() if("$ENV{ROS_DISTRO}" STRGREATER "hydro") # roslaunch_add_file_check in hydro is too strict - macro(jsk_perception_add_rostest rostest_file) + macro(_add_rostest rostest_file) add_rostest(${rostest_file}) roslaunch_add_file_check(${rostest_file}) endmacro() # FIXME: jsk_tools/test_topic_published.py does not work on hydro travis/jenkins # https://github.com/jsk-ros-pkg/jsk_common/pull/1293#issuecomment-164158260 - jsk_perception_add_rostest(test/add_mask_image.test) - jsk_perception_add_rostest(test/apply_mask_image.test) - jsk_perception_add_rostest(test/blob_detector.test) - jsk_perception_add_rostest(test/bof_histogram_extractor.test) - jsk_perception_add_rostest(test/bounding_object_mask_image.test) - jsk_perception_add_rostest(test/bounding_rect_mask_image.test) - jsk_perception_add_rostest(test/color_histogram.test) - jsk_perception_add_rostest(test/colorize_labels.test) - jsk_perception_add_rostest(test/colorize_float_image.test) - jsk_perception_add_rostest(test/draw_rect_array.test) - jsk_perception_add_rostest(test/extract_image_channel.test) - jsk_perception_add_rostest(test/image_cluster_indices_decomposer.test) - jsk_perception_add_rostest(test/image_publisher.test) - jsk_perception_add_rostest(test/image_to_label.test) - jsk_perception_add_rostest(test/mask_image_to_label.test) - jsk_perception_add_rostest(test/kmeans.test) - jsk_perception_add_rostest(test/label_to_mask_image.test) - jsk_perception_add_rostest(test/rect_array_to_image_marker.test) - jsk_perception_add_rostest(test/convex_hull_mask_image.test) - jsk_perception_add_rostest(test/overlay_image_color_on_mono.test) - jsk_perception_add_rostest(test/selective_search.test) - jsk_perception_add_rostest(test/slic_super_pixels.test) - jsk_perception_add_rostest(test/sklearn_classifier.test) - jsk_perception_add_rostest(test/split_fore_background.test) - jsk_perception_add_rostest(test/tile_image.test) - jsk_perception_add_rostest(test/label_image_decomposer.test) + _add_rostest(test/add_mask_image.test) + _add_rostest(test/apply_mask_image.test) + _add_rostest(test/blob_detector.test) + _add_rostest(test/bof_histogram_extractor.test) + _add_rostest(test/bounding_object_mask_image.test) + _add_rostest(test/bounding_rect_mask_image.test) + _add_rostest(test/color_histogram.test) + _add_rostest(test/colorize_labels.test) + _add_rostest(test/colorize_float_image.test) + _add_rostest(test/draw_rect_array.test) + _add_rostest(test/extract_image_channel.test) + _add_rostest(test/image_cluster_indices_decomposer.test) + _add_rostest(test/image_publisher.test) + _add_rostest(test/image_to_label.test) + _add_rostest(test/mask_image_to_label.test) + _add_rostest(test/kmeans.test) + _add_rostest(test/label_to_mask_image.test) + _add_rostest(test/rect_array_to_image_marker.test) + _add_rostest(test/convex_hull_mask_image.test) + _add_rostest(test/overlay_image_color_on_mono.test) + _add_rostest(test/selective_search.test) + _add_rostest(test/slic_super_pixels.test) + _add_rostest(test/sklearn_classifier.test) + _add_rostest(test/split_fore_background.test) + _add_rostest(test/tile_image.test) + _add_rostest(test/label_image_decomposer.test) # FIXME: Does not work on Travis/Jenkins # jsk_perception_add_rostest(test/fcn_object_segmentation.test) # jsk_perception_add_rostest(test/vgg16_object_recognition.test install_trained_data) if(TARGET bing) - jsk_perception_add_rostest(test/bing.test) + _add_rostest(test/bing.test) endif() endif() add_rostest(test/sparse_image.test) From 1f97d78b067bd56d87a1a6495e0d4f3c02f35133 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Wed, 31 Aug 2016 00:26:10 +0900 Subject: [PATCH 09/10] Add jsk_ prefix for local macros --- jsk_perception/CMakeLists.txt | 212 +++++++++++++++++----------------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index 504c580fc1..0009e115d7 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -166,75 +166,75 @@ foreach(_node_script ${${PROJECT_NAME}_node_scripts}) endif() endforeach() -macro(_add_nodelet _nodelet_cpp _nodelet_class _single_nodelet_exec_name) +macro(jsk_add_nodelet _nodelet_cpp _nodelet_class _single_nodelet_exec_name) if(NOT EXISTS "${PROJECT_SOURCE_DIR}/test/${_single_nodelet_exec_name}.test") list(APPEND ${PROJECT_NAME}_nodes_without_test ${_nodelet_cpp}) endif() jsk_nodelet(${_nodelet_cpp} ${_nodelet_class} ${_single_nodelet_exec_name} ${PROJECT_NAME}_nodelet_sources ${PROJECT_NAME}_nodelet_executables) endmacro() -_add_nodelet(src/bounding_box_to_rect.cpp "jsk_perception/BoundingBoxToRect" "bounding_box_to_rect") -_add_nodelet(src/rect_array_actual_size_filter.cpp "jsk_perception/RectArrayActualSizeFilter" "rect_array_actual_size_filter") -_add_nodelet(src/rect_array_to_density_image.cpp "jsk_perception/RectArrayToDensityImage" "rect_array_to_density_image") -_add_nodelet(src/polygon_array_color_likelihood.cpp "jsk_perception/PolygonArrayColorLikelihood" "polygon_array_color_likelihood") -_add_nodelet(src/polygon_array_color_histogram.cpp "jsk_perception/PolygonArrayColorHistogram" "polygon_array_color_histogram") -_add_nodelet(src/edge_detector.cpp "jsk_perception/EdgeDetector" "edge_detector") -_add_nodelet(src/sparse_image_encoder.cpp "jsk_perception/SparseImageEncoder" "sparse_image_encoder") -_add_nodelet(src/sparse_image_decoder.cpp "jsk_perception/SparseImageDecoder" "sparse_image_decoder") -_add_nodelet(src/color_histogram.cpp "jsk_perception/ColorHistogram" "color_histogram") -_add_nodelet(src/background_substraction_nodelet.cpp "jsk_perception/BackgroundSubstraction" "background_substraction") -_add_nodelet(src/hough_circles.cpp "jsk_perception/HoughCircleDetector" "hough_circles") -_add_nodelet(src/fisheye_to_panorama.cpp "jsk_perception/FisheyeToPanorama" "fisheye_to_panorama") -_add_nodelet(src/grabcut_nodelet.cpp "jsk_perception/GrabCut" "grabcut") -_add_nodelet(src/slic_superpixels.cpp "jsk_perception/SLICSuperPixels" "slic_super_pixels") -_add_nodelet(src/rgb_decomposer.cpp "jsk_perception/RGBDecomposer" "rgb_decomposer") -_add_nodelet(src/hsv_decomposer.cpp "jsk_perception/HSVDecomposer" "hsv_decomposer") -_add_nodelet(src/lab_decomposer.cpp "jsk_perception/LabDecomposer" "lab_decomposer") -_add_nodelet(src/ycc_decomposer.cpp "jsk_perception/YCCDecomposer" "ycc_decomposer") -_add_nodelet(src/contour_finder.cpp "jsk_perception/ContourFinder" "contour_finder") -_add_nodelet(src/snake_segmentation.cpp "jsk_perception/SnakeSegmentation" "snake_segmentation") -_add_nodelet(src/colorize_labels.cpp "jsk_perception/ColorizeLabels" "colorize_labels") -_add_nodelet(src/colorize_float_image.cpp "jsk_perception/ColorizeFloatImage" "colorize_float_image") -_add_nodelet(src/overlay_image_color_on_mono.cpp "jsk_perception/OverlayImageColorOnMono" "overlay_image_color_on_mono") -_add_nodelet(src/grid_label.cpp "jsk_perception/GridLabel" "grid_label") -_add_nodelet(src/color_histogram_label_match.cpp "jsk_perception/ColorHistogramLabelMatch" "color_histogram_label_match") -_add_nodelet(src/apply_mask_image.cpp "jsk_perception/ApplyMaskImage" "apply_mask_image") -_add_nodelet(src/unapply_mask_image.cpp "jsk_perception/UnapplyMaskImage" "unapply_mask_image") -_add_nodelet(src/single_channel_histogram.cpp "jsk_perception/SingleChannelHistogram" "single_channel_histogram") -_add_nodelet(src/blob_detector.cpp "jsk_perception/BlobDetector" "blob_detector") -_add_nodelet(src/add_mask_image.cpp "jsk_perception/AddMaskImage" "add_mask_image") -_add_nodelet(src/multiply_mask_image.cpp "jsk_perception/MultiplyMaskImage" "multiply_mask_image") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/ErodeMaskImage" "erode_mask_image") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/DilateMaskImage" "dilate_mask_image") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/Opening" "opening") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/Closing" "closing") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/MorphologicalGradient" "morphological_gradient") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/TopHat" "top_hat") -_add_nodelet(src/morphological_operator.cpp "jsk_perception/BlackHat" "black_hat") -_add_nodelet(src/label_to_mask_image.cpp "jsk_perception/LabelToMaskImage" "label_to_mask_image") -_add_nodelet(src/rect_to_mask_image.cpp "jsk_perception/RectToMaskImage" "rect_to_mask_image") -_add_nodelet(src/mask_image_to_roi.cpp "jsk_perception/MaskImageToROI" "mask_image_to_roi") -_add_nodelet(src/mask_image_to_rect.cpp "jsk_perception/MaskImageToRect" "mask_image_to_rect") -_add_nodelet(src/bounding_rect_mask_image.cpp "jsk_perception/BoundingRectMaskImage" "bounding_rect_mask_image") -_add_nodelet(src/bounding_object_mask_image.cpp "jsk_perception/BoundingObjectMaskImage" "bounding_object_mask_image") -_add_nodelet(src/roi_to_rect.cpp "jsk_perception/ROIToRect" "roi_to_rect") -_add_nodelet(src/roi_to_mask_image.cpp "jsk_perception/ROIToMaskImage" "roi_to_mask_image") -_add_nodelet(src/polygon_to_mask_image.cpp "jsk_perception/PolygonToMaskImage" "polygon_to_mask_image") -_add_nodelet(src/polygon_array_to_label_image.cpp "jsk_perception/PolygonArrayToLabelImage" "polygon_array_to_label_image") -_add_nodelet(src/rect_to_roi.cpp "jsk_perception/RectToROI" "rect_to_roi") -_add_nodelet(src/convex_hull_mask_image.cpp "jsk_perception/ConvexHullMaskImage" "convex_hull_mask_image") -_add_nodelet(src/mask_image_generator.cpp "jsk_perception/MaskImageGenerator" "mask_image_generator") -_add_nodelet(src/project_image_point.cpp "jsk_perception/ProjectImagePoint" "project_image_point") -_add_nodelet(src/sliding_window_object_detector.cpp "jsk_perception/SlidingWindowObjectDetector" "sliding_window_object_detector") -_add_nodelet(src/gaussian_blur.cpp "jsk_perception/GaussianBlur" "gaussian_blur") -_add_nodelet(src/kmeans.cpp "jsk_perception/KMeans" "kmeans") +jsk_add_nodelet(src/bounding_box_to_rect.cpp "jsk_perception/BoundingBoxToRect" "bounding_box_to_rect") +jsk_add_nodelet(src/rect_array_actual_size_filter.cpp "jsk_perception/RectArrayActualSizeFilter" "rect_array_actual_size_filter") +jsk_add_nodelet(src/rect_array_to_density_image.cpp "jsk_perception/RectArrayToDensityImage" "rect_array_to_density_image") +jsk_add_nodelet(src/polygon_array_color_likelihood.cpp "jsk_perception/PolygonArrayColorLikelihood" "polygon_array_color_likelihood") +jsk_add_nodelet(src/polygon_array_color_histogram.cpp "jsk_perception/PolygonArrayColorHistogram" "polygon_array_color_histogram") +jsk_add_nodelet(src/edge_detector.cpp "jsk_perception/EdgeDetector" "edge_detector") +jsk_add_nodelet(src/sparse_image_encoder.cpp "jsk_perception/SparseImageEncoder" "sparse_image_encoder") +jsk_add_nodelet(src/sparse_image_decoder.cpp "jsk_perception/SparseImageDecoder" "sparse_image_decoder") +jsk_add_nodelet(src/color_histogram.cpp "jsk_perception/ColorHistogram" "color_histogram") +jsk_add_nodelet(src/background_substraction_nodelet.cpp "jsk_perception/BackgroundSubstraction" "background_substraction") +jsk_add_nodelet(src/hough_circles.cpp "jsk_perception/HoughCircleDetector" "hough_circles") +jsk_add_nodelet(src/fisheye_to_panorama.cpp "jsk_perception/FisheyeToPanorama" "fisheye_to_panorama") +jsk_add_nodelet(src/grabcut_nodelet.cpp "jsk_perception/GrabCut" "grabcut") +jsk_add_nodelet(src/slic_superpixels.cpp "jsk_perception/SLICSuperPixels" "slic_super_pixels") +jsk_add_nodelet(src/rgb_decomposer.cpp "jsk_perception/RGBDecomposer" "rgb_decomposer") +jsk_add_nodelet(src/hsv_decomposer.cpp "jsk_perception/HSVDecomposer" "hsv_decomposer") +jsk_add_nodelet(src/lab_decomposer.cpp "jsk_perception/LabDecomposer" "lab_decomposer") +jsk_add_nodelet(src/ycc_decomposer.cpp "jsk_perception/YCCDecomposer" "ycc_decomposer") +jsk_add_nodelet(src/contour_finder.cpp "jsk_perception/ContourFinder" "contour_finder") +jsk_add_nodelet(src/snake_segmentation.cpp "jsk_perception/SnakeSegmentation" "snake_segmentation") +jsk_add_nodelet(src/colorize_labels.cpp "jsk_perception/ColorizeLabels" "colorize_labels") +jsk_add_nodelet(src/colorize_float_image.cpp "jsk_perception/ColorizeFloatImage" "colorize_float_image") +jsk_add_nodelet(src/overlay_image_color_on_mono.cpp "jsk_perception/OverlayImageColorOnMono" "overlay_image_color_on_mono") +jsk_add_nodelet(src/grid_label.cpp "jsk_perception/GridLabel" "grid_label") +jsk_add_nodelet(src/color_histogram_label_match.cpp "jsk_perception/ColorHistogramLabelMatch" "color_histogram_label_match") +jsk_add_nodelet(src/apply_mask_image.cpp "jsk_perception/ApplyMaskImage" "apply_mask_image") +jsk_add_nodelet(src/unapply_mask_image.cpp "jsk_perception/UnapplyMaskImage" "unapply_mask_image") +jsk_add_nodelet(src/single_channel_histogram.cpp "jsk_perception/SingleChannelHistogram" "single_channel_histogram") +jsk_add_nodelet(src/blob_detector.cpp "jsk_perception/BlobDetector" "blob_detector") +jsk_add_nodelet(src/add_mask_image.cpp "jsk_perception/AddMaskImage" "add_mask_image") +jsk_add_nodelet(src/multiply_mask_image.cpp "jsk_perception/MultiplyMaskImage" "multiply_mask_image") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/ErodeMaskImage" "erode_mask_image") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/DilateMaskImage" "dilate_mask_image") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/Opening" "opening") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/Closing" "closing") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/MorphologicalGradient" "morphological_gradient") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/TopHat" "top_hat") +jsk_add_nodelet(src/morphological_operator.cpp "jsk_perception/BlackHat" "black_hat") +jsk_add_nodelet(src/label_to_mask_image.cpp "jsk_perception/LabelToMaskImage" "label_to_mask_image") +jsk_add_nodelet(src/rect_to_mask_image.cpp "jsk_perception/RectToMaskImage" "rect_to_mask_image") +jsk_add_nodelet(src/mask_image_to_roi.cpp "jsk_perception/MaskImageToROI" "mask_image_to_roi") +jsk_add_nodelet(src/mask_image_to_rect.cpp "jsk_perception/MaskImageToRect" "mask_image_to_rect") +jsk_add_nodelet(src/bounding_rect_mask_image.cpp "jsk_perception/BoundingRectMaskImage" "bounding_rect_mask_image") +jsk_add_nodelet(src/bounding_object_mask_image.cpp "jsk_perception/BoundingObjectMaskImage" "bounding_object_mask_image") +jsk_add_nodelet(src/roi_to_rect.cpp "jsk_perception/ROIToRect" "roi_to_rect") +jsk_add_nodelet(src/roi_to_mask_image.cpp "jsk_perception/ROIToMaskImage" "roi_to_mask_image") +jsk_add_nodelet(src/polygon_to_mask_image.cpp "jsk_perception/PolygonToMaskImage" "polygon_to_mask_image") +jsk_add_nodelet(src/polygon_array_to_label_image.cpp "jsk_perception/PolygonArrayToLabelImage" "polygon_array_to_label_image") +jsk_add_nodelet(src/rect_to_roi.cpp "jsk_perception/RectToROI" "rect_to_roi") +jsk_add_nodelet(src/convex_hull_mask_image.cpp "jsk_perception/ConvexHullMaskImage" "convex_hull_mask_image") +jsk_add_nodelet(src/mask_image_generator.cpp "jsk_perception/MaskImageGenerator" "mask_image_generator") +jsk_add_nodelet(src/project_image_point.cpp "jsk_perception/ProjectImagePoint" "project_image_point") +jsk_add_nodelet(src/sliding_window_object_detector.cpp "jsk_perception/SlidingWindowObjectDetector" "sliding_window_object_detector") +jsk_add_nodelet(src/gaussian_blur.cpp "jsk_perception/GaussianBlur" "gaussian_blur") +jsk_add_nodelet(src/kmeans.cpp "jsk_perception/KMeans" "kmeans") if("${OpenCV_VERSION}" VERSION_GREATER "2.9.9") # >= 3.0.0 - _add_nodelet(src/bing.cpp "jsk_perception/Bing" "bing") + jsk_add_nodelet(src/bing.cpp "jsk_perception/Bing" "bing") endif() -_add_nodelet(src/tabletop_color_difference_likelihood.cpp "jsk_perception/TabletopColorDifferenceLikelihood" "tabletop_color_difference_likelihood") +jsk_add_nodelet(src/tabletop_color_difference_likelihood.cpp "jsk_perception/TabletopColorDifferenceLikelihood" "tabletop_color_difference_likelihood") if(OPENMP_FOUND) - _add_nodelet(src/saliency_map_generator_node.cpp "jsk_perception/SaliencyMapGenerator" "saliency_map_generator") - _add_nodelet(src/skeletonization_nodelet.cpp "jsk_perception/Skeletonization" "skeletonization") + jsk_add_nodelet(src/saliency_map_generator_node.cpp "jsk_perception/SaliencyMapGenerator" "saliency_map_generator") + jsk_add_nodelet(src/skeletonization_nodelet.cpp "jsk_perception/Skeletonization" "skeletonization") endif() # robot_self_filter is released on version greater than indigo @@ -247,7 +247,7 @@ endif() if(robot_self_filter_FOUND) message(AUTHOR_WARNING "robot_self_filter is found.") - _add_nodelet(src/robot_to_mask_image.cpp "jsk_perception/RobotToMaskImage" "robot_to_mask_image") + jsk_add_nodelet(src/robot_to_mask_image.cpp "jsk_perception/RobotToMaskImage" "robot_to_mask_image") endif() # compiling jsk_perception library for nodelet @@ -268,7 +268,7 @@ add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_gencpp) # Build node executables -macro(_add_node _node_cpp _node_exec_name) +macro(jsk_add_node _node_cpp _node_exec_name) cmake_parse_arguments(ARG "" "" "DEPENDS;LIBRARIES" ${ARGN}) add_executable(${_node_exec_name} ${_node_cpp}) target_link_libraries(${_node_exec_name} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${ARG_LIBRARIES}) @@ -279,19 +279,19 @@ endmacro() add_library(oriented_gradient src/oriented_gradient.cpp) target_link_libraries(oriented_gradient ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -_add_node(src/camshiftdemo.cpp camshiftdemo) -_add_node(src/linemod.cpp linemod) -_add_node(src/virtual_camera_mono.cpp virtual_camera_mono) -_add_node(src/point_pose_extractor.cpp point_pose_extractor DEPENDS libsiftfast) -_add_node(src/white_balance_converter.cpp white_balance_converter) -_add_node(src/hough_lines.cpp hough_lines) -_add_node(src/rectangle_detector.cpp rectangle_detector) -_add_node(src/calc_flow.cpp calc_flow) -_add_node(src/color_histogram_sliding_matcher.cpp color_histogram_sliding_matcher) -_add_node(src/oriented_gradient_node.cpp oriented_gradient_node - DEPENDS oriented_gradient LIBRARIES oriented_gradient) -_add_node(src/sliding_window_object_detector_trainer_node.cpp sliding_window_object_detector_trainer_node - DEPENDS ${PROJECT_NAME} LIBRARIES ${PROJECT_NAME}) +jsk_add_node(src/camshiftdemo.cpp camshiftdemo) +jsk_add_node(src/linemod.cpp linemod) +jsk_add_node(src/virtual_camera_mono.cpp virtual_camera_mono) +jsk_add_node(src/point_pose_extractor.cpp point_pose_extractor DEPENDS libsiftfast) +jsk_add_node(src/white_balance_converter.cpp white_balance_converter) +jsk_add_node(src/hough_lines.cpp hough_lines) +jsk_add_node(src/rectangle_detector.cpp rectangle_detector) +jsk_add_node(src/calc_flow.cpp calc_flow) +jsk_add_node(src/color_histogram_sliding_matcher.cpp color_histogram_sliding_matcher) +jsk_add_node(src/oriented_gradient_node.cpp oriented_gradient_node + DEPENDS oriented_gradient LIBRARIES oriented_gradient) +jsk_add_node(src/sliding_window_object_detector_trainer_node.cpp sliding_window_object_detector_trainer_node + DEPENDS ${PROJECT_NAME} LIBRARIES ${PROJECT_NAME}) add_custom_command( OUTPUT ${PROJECT_SOURCE_DIR}/launch/eusmodel_detection_elevator-panels-eng8.launch @@ -359,44 +359,44 @@ if(CATKIN_ENABLE_TESTING) roslint_python() if("$ENV{ROS_DISTRO}" STRGREATER "hydro") # roslaunch_add_file_check in hydro is too strict - macro(_add_rostest rostest_file) + macro(jsk_add_rostest rostest_file) add_rostest(${rostest_file}) roslaunch_add_file_check(${rostest_file}) endmacro() # FIXME: jsk_tools/test_topic_published.py does not work on hydro travis/jenkins # https://github.com/jsk-ros-pkg/jsk_common/pull/1293#issuecomment-164158260 - _add_rostest(test/add_mask_image.test) - _add_rostest(test/apply_mask_image.test) - _add_rostest(test/blob_detector.test) - _add_rostest(test/bof_histogram_extractor.test) - _add_rostest(test/bounding_object_mask_image.test) - _add_rostest(test/bounding_rect_mask_image.test) - _add_rostest(test/color_histogram.test) - _add_rostest(test/colorize_labels.test) - _add_rostest(test/colorize_float_image.test) - _add_rostest(test/draw_rect_array.test) - _add_rostest(test/extract_image_channel.test) - _add_rostest(test/image_cluster_indices_decomposer.test) - _add_rostest(test/image_publisher.test) - _add_rostest(test/image_to_label.test) - _add_rostest(test/mask_image_to_label.test) - _add_rostest(test/kmeans.test) - _add_rostest(test/label_to_mask_image.test) - _add_rostest(test/rect_array_to_image_marker.test) - _add_rostest(test/convex_hull_mask_image.test) - _add_rostest(test/overlay_image_color_on_mono.test) - _add_rostest(test/selective_search.test) - _add_rostest(test/slic_super_pixels.test) - _add_rostest(test/sklearn_classifier.test) - _add_rostest(test/split_fore_background.test) - _add_rostest(test/tile_image.test) - _add_rostest(test/label_image_decomposer.test) + jsk_add_rostest(test/add_mask_image.test) + jsk_add_rostest(test/apply_mask_image.test) + jsk_add_rostest(test/blob_detector.test) + jsk_add_rostest(test/bof_histogram_extractor.test) + jsk_add_rostest(test/bounding_object_mask_image.test) + jsk_add_rostest(test/bounding_rect_mask_image.test) + jsk_add_rostest(test/color_histogram.test) + jsk_add_rostest(test/colorize_labels.test) + jsk_add_rostest(test/colorize_float_image.test) + jsk_add_rostest(test/draw_rect_array.test) + jsk_add_rostest(test/extract_image_channel.test) + jsk_add_rostest(test/image_cluster_indices_decomposer.test) + jsk_add_rostest(test/image_publisher.test) + jsk_add_rostest(test/image_to_label.test) + jsk_add_rostest(test/mask_image_to_label.test) + jsk_add_rostest(test/kmeans.test) + jsk_add_rostest(test/label_to_mask_image.test) + jsk_add_rostest(test/rect_array_to_image_marker.test) + jsk_add_rostest(test/convex_hull_mask_image.test) + jsk_add_rostest(test/overlay_image_color_on_mono.test) + jsk_add_rostest(test/selective_search.test) + jsk_add_rostest(test/slic_super_pixels.test) + jsk_add_rostest(test/sklearn_classifier.test) + jsk_add_rostest(test/split_fore_background.test) + jsk_add_rostest(test/tile_image.test) + jsk_add_rostest(test/label_image_decomposer.test) # FIXME: Does not work on Travis/Jenkins - # jsk_perception_add_rostest(test/fcn_object_segmentation.test) - # jsk_perception_add_rostest(test/vgg16_object_recognition.test install_trained_data) + # jsk_add_rostest(test/fcn_object_segmentation.test) + # jsk_add_rostest(test/vgg16_object_recognition.test install_trained_data) if(TARGET bing) - _add_rostest(test/bing.test) + jsk_add_rostest(test/bing.test) endif() endif() - add_rostest(test/sparse_image.test) + jsk_add_rostest(test/sparse_image.test) endif() From 18e0f07c56143e456a4e8180946dc1fef36d8acb Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Thu, 1 Sep 2016 12:19:50 +0900 Subject: [PATCH 10/10] Declare jsk_add_rostest in all distros --- jsk_perception/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jsk_perception/CMakeLists.txt b/jsk_perception/CMakeLists.txt index 0009e115d7..6a3da69c91 100644 --- a/jsk_perception/CMakeLists.txt +++ b/jsk_perception/CMakeLists.txt @@ -357,12 +357,13 @@ if(CATKIN_ENABLE_TESTING) set(ROSLINT_CPP_OPTS "--filter=-whitespace/parens,-whitespace/braces") roslint_cpp() roslint_python() + # declare rostest + macro(jsk_add_rostest rostest_file) + add_rostest(${rostest_file}) + roslaunch_add_file_check(${rostest_file}) + endmacro() if("$ENV{ROS_DISTRO}" STRGREATER "hydro") # roslaunch_add_file_check in hydro is too strict - macro(jsk_add_rostest rostest_file) - add_rostest(${rostest_file}) - roslaunch_add_file_check(${rostest_file}) - endmacro() # FIXME: jsk_tools/test_topic_published.py does not work on hydro travis/jenkins # https://github.com/jsk-ros-pkg/jsk_common/pull/1293#issuecomment-164158260 jsk_add_rostest(test/add_mask_image.test)