@@ -23,11 +23,13 @@ add_compile_options(-std=c++14)
2323
2424## Find catkin macros and libraries
2525find_package (catkin2 REQUIRED COMPONENTS
26- camera
26+ cv_bridge
2727 ff_util
28+ image_transport
2829 localization_common
2930 localization_measurements
3031 msg_conversions
32+ nodelet
3133 optimization_common
3234 point_cloud_common
3335 vision_common
@@ -48,7 +50,7 @@ find_package(pcl_conversions REQUIRED)
4850catkin_package (
4951 INCLUDE_DIRS include ${CERES_INCLUDE_DIRS} ${GTSAM_INCLUDE_DIR} ${PCL_INCLUDE_DIRS} ${pcl_conversions_INCLUDE_DIRS}
5052 LIBRARIES ${PROJECT_NAME} ${CERES_LIBRARIES} ${PCL_LIBRARIES} ${GTSAM_LIBRARIES}
51- CATKIN_DEPENDS roscpp ff_msgs ff_util localization_common localization_measurements msg_conversions optimization_common point_cloud_common vision_common
53+ CATKIN_DEPENDS roscpp cv_bridge ff_msgs ff_util image_transport localization_common localization_measurements msg_conversions nodelet optimization_common point_cloud_common vision_common
5254 DEPENDS gtsam pcl
5355)
5456
@@ -88,24 +90,29 @@ if(CATKIN_ENABLE_TESTING)
8890 target_link_libraries (test_point_to_plane_icp_depth_odometry
8991 ${PROJECT_NAME} ${catkin_LIBRARIES}
9092 )
91- add_rostest_gtest (test_image_features_with_known_correspondences_aligner_depth_odometry
92- test /test_image_features_with_known_correspondences_aligner_depth_odometry.test
93- test /test_image_features_with_known_correspondences_aligner_depth_odometry.cc
94- test /test_utilities.cc
95- )
96- target_link_libraries (test_image_features_with_known_correspondences_aligner_depth_odometry
97- ${PROJECT_NAME} ${catkin_LIBRARIES}
98- )
9993
100- find_package (rostest REQUIRED )
101- add_rostest_gtest (test_depth_odometry_wrapper
102- test /test_depth_odometry_wrapper.test
103- test /test_depth_odometry_wrapper.cc
104- test /test_utilities.cc
105- )
106- target_link_libraries (test_depth_odometry_wrapper
107- ${PROJECT_NAME} ${catkin_LIBRARIES}
108- )
94+ # Ignore these tests if OpenCV 4 installed as cv_bridge will cause a runtime segfault
95+ # since it uses opencv4 on newer ros versions and the rest of the code uses opencv3
96+ find_package (OpenCV 4 QUIET )
97+ if (NOT OpenCV_FOUND)
98+ add_rostest_gtest (test_image_features_with_known_correspondences_aligner_depth_odometry
99+ test /test_image_features_with_known_correspondences_aligner_depth_odometry.test
100+ test /test_image_features_with_known_correspondences_aligner_depth_odometry.cc
101+ test /test_utilities.cc
102+ )
103+ target_link_libraries (test_image_features_with_known_correspondences_aligner_depth_odometry
104+ ${PROJECT_NAME} ${catkin_LIBRARIES}
105+ )
106+
107+ add_rostest_gtest (test_depth_odometry_wrapper
108+ test /test_depth_odometry_wrapper.test
109+ test /test_depth_odometry_wrapper.cc
110+ test /test_utilities.cc
111+ )
112+ target_link_libraries (test_depth_odometry_wrapper
113+ ${PROJECT_NAME} ${catkin_LIBRARIES}
114+ )
115+ endif ()
109116
110117endif ()
111118
0 commit comments