2012-09-13 13:26:12 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2012-09-14 18:17:12 +00:00
|
|
|
project(pcl_ros)
|
2012-09-13 13:26:12 +00:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Find system dependencies
|
2014-04-01 18:01:31 -07:00
|
|
|
find_package(cmake_modules REQUIRED)
|
2013-07-19 17:27:18 -07:00
|
|
|
find_package(Boost REQUIRED COMPONENTS system filesystem thread)
|
2015-05-27 16:52:23 -04:00
|
|
|
find_package(Eigen3 REQUIRED)
|
2017-07-14 23:57:34 +00:00
|
|
|
find_package(PCL REQUIRED COMPONENTS core io surface)
|
2016-04-21 15:18:33 -07:00
|
|
|
|
|
|
|
|
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
|
2017-04-13 23:54:13 +00:00
|
|
|
# FIXME: this causes duplicates and not found error in ubuntu:zesty
|
|
|
|
|
list(REMOVE_ITEM PCL_LIBRARIES "/usr/lib/libmpi.so")
|
2017-07-14 23:59:58 +00:00
|
|
|
|
|
|
|
|
# For debian: https://github.com/ros-perception/perception_pcl/issues/139
|
|
|
|
|
list(REMOVE_ITEM PCL_LIBRARIES
|
|
|
|
|
"vtkGUISupportQt"
|
|
|
|
|
"vtkGUISupportQtOpenGL"
|
|
|
|
|
"vtkGUISupportQtSQL"
|
|
|
|
|
"vtkGUISupportQtWebkit"
|
|
|
|
|
"vtkViewsQt"
|
|
|
|
|
"vtkRenderingQt")
|
2016-04-21 15:18:33 -07:00
|
|
|
endif()
|
2012-09-13 13:26:12 +00:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Find catkin packages
|
|
|
|
|
find_package(catkin REQUIRED COMPONENTS
|
|
|
|
|
dynamic_reconfigure
|
|
|
|
|
genmsg
|
|
|
|
|
nodelet
|
|
|
|
|
nodelet_topic_tools
|
|
|
|
|
pcl_conversions
|
|
|
|
|
pcl_msgs
|
|
|
|
|
pluginlib
|
|
|
|
|
rosbag
|
|
|
|
|
rosconsole
|
|
|
|
|
roscpp
|
|
|
|
|
roslib
|
|
|
|
|
sensor_msgs
|
|
|
|
|
std_msgs
|
|
|
|
|
tf
|
2016-05-08 09:41:31 -04:00
|
|
|
tf2_eigen
|
2012-10-23 19:45:04 -07:00
|
|
|
)
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Add include directories
|
|
|
|
|
include_directories(include
|
|
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
|
${catkin_INCLUDE_DIRS}
|
2015-05-27 16:52:23 -04:00
|
|
|
${Eigen3_INCLUDE_DIRS}
|
2013-07-19 17:27:18 -07:00
|
|
|
${PCL_INCLUDE_DIRS}
|
2012-09-13 13:26:12 +00:00
|
|
|
)
|
|
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Generate dynamic_reconfigure
|
|
|
|
|
generate_dynamic_reconfigure_options(
|
|
|
|
|
cfg/EuclideanClusterExtraction.cfg
|
|
|
|
|
cfg/ExtractIndices.cfg
|
|
|
|
|
cfg/ExtractPolygonalPrismData.cfg
|
|
|
|
|
cfg/Feature.cfg
|
|
|
|
|
cfg/Filter.cfg
|
|
|
|
|
cfg/MLS.cfg
|
|
|
|
|
cfg/SACSegmentation.cfg
|
|
|
|
|
cfg/SACSegmentationFromNormals.cfg
|
|
|
|
|
cfg/SegmentDifferences.cfg
|
|
|
|
|
cfg/StatisticalOutlierRemoval.cfg
|
2015-05-26 16:01:16 -04:00
|
|
|
cfg/RadiusOutlierRemoval.cfg
|
2013-07-19 17:27:18 -07:00
|
|
|
cfg/VoxelGrid.cfg
|
2014-08-01 07:02:36 -04:00
|
|
|
cfg/CropBox.cfg
|
2013-07-19 17:27:18 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
## Declare the catkin package
|
2012-12-18 17:40:49 -08:00
|
|
|
catkin_package(
|
|
|
|
|
INCLUDE_DIRS include
|
2013-07-19 17:27:18 -07:00
|
|
|
LIBRARIES
|
|
|
|
|
pcl_ros_filters
|
|
|
|
|
pcl_ros_io
|
|
|
|
|
pcl_ros_tf
|
|
|
|
|
CATKIN_DEPENDS
|
|
|
|
|
dynamic_reconfigure
|
|
|
|
|
message_filters
|
|
|
|
|
nodelet
|
2017-08-09 04:46:35 +09:00
|
|
|
nodelet_topic_tools
|
2013-07-19 17:27:18 -07:00
|
|
|
pcl_conversions
|
2013-07-19 21:14:36 -07:00
|
|
|
pcl_msgs
|
2013-07-19 17:27:18 -07:00
|
|
|
rosbag
|
|
|
|
|
roscpp
|
|
|
|
|
sensor_msgs
|
|
|
|
|
std_msgs
|
|
|
|
|
tf
|
|
|
|
|
DEPENDS
|
|
|
|
|
Boost
|
2015-05-27 16:52:23 -04:00
|
|
|
Eigen3
|
2013-07-19 17:27:18 -07:00
|
|
|
PCL
|
2012-12-18 17:40:49 -08:00
|
|
|
)
|
2012-10-23 19:45:04 -07:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Declare the pcl_ros_tf library
|
|
|
|
|
add_library(pcl_ros_tf src/transforms.cpp)
|
2015-05-27 16:52:23 -04:00
|
|
|
target_link_libraries(pcl_ros_tf ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2013-07-19 17:27:18 -07:00
|
|
|
add_dependencies(pcl_ros_tf pcl_ros_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Nodelets
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Declare the pcl_ros_io library
|
|
|
|
|
add_library(pcl_ros_io
|
|
|
|
|
src/pcl_ros/io/bag_io.cpp
|
|
|
|
|
src/pcl_ros/io/concatenate_data.cpp
|
|
|
|
|
src/pcl_ros/io/concatenate_fields.cpp
|
|
|
|
|
src/pcl_ros/io/io.cpp
|
|
|
|
|
src/pcl_ros/io/pcd_io.cpp
|
|
|
|
|
)
|
2015-05-27 16:52:23 -04:00
|
|
|
target_link_libraries(pcl_ros_io pcl_ros_tf ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2012-12-17 21:17:31 -08:00
|
|
|
class_loader_hide_library_symbols(pcl_ros_io)
|
|
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Declare the pcl_ros_features library
|
|
|
|
|
add_library(pcl_ros_features
|
|
|
|
|
src/pcl_ros/features/feature.cpp
|
|
|
|
|
# Compilation is much faster if we include all the following CPP files in feature.cpp
|
|
|
|
|
src/pcl_ros/features/boundary.cpp
|
|
|
|
|
src/pcl_ros/features/fpfh.cpp
|
|
|
|
|
src/pcl_ros/features/fpfh_omp.cpp
|
2015-05-07 15:21:11 -04:00
|
|
|
src/pcl_ros/features/shot.cpp
|
|
|
|
|
src/pcl_ros/features/shot_omp.cpp
|
2013-07-19 17:27:18 -07:00
|
|
|
src/pcl_ros/features/moment_invariants.cpp
|
|
|
|
|
src/pcl_ros/features/normal_3d.cpp
|
|
|
|
|
src/pcl_ros/features/normal_3d_omp.cpp
|
|
|
|
|
src/pcl_ros/features/pfh.cpp
|
|
|
|
|
src/pcl_ros/features/principal_curvatures.cpp
|
|
|
|
|
src/pcl_ros/features/vfh.cpp
|
|
|
|
|
)
|
2015-05-27 16:52:23 -04:00
|
|
|
target_link_libraries (pcl_ros_features ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2013-09-20 11:09:03 -07:00
|
|
|
add_dependencies(pcl_ros_features ${PROJECT_NAME}_gencfg)
|
2013-05-11 03:29:09 +09:00
|
|
|
class_loader_hide_library_symbols(pcl_ros_features)
|
|
|
|
|
|
|
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Declare the pcl_ros_filters library
|
|
|
|
|
add_library(pcl_ros_filters
|
|
|
|
|
src/pcl_ros/filters/extract_indices.cpp
|
|
|
|
|
src/pcl_ros/filters/filter.cpp
|
|
|
|
|
src/pcl_ros/filters/passthrough.cpp
|
|
|
|
|
src/pcl_ros/filters/project_inliers.cpp
|
|
|
|
|
src/pcl_ros/filters/radius_outlier_removal.cpp
|
|
|
|
|
src/pcl_ros/filters/statistical_outlier_removal.cpp
|
|
|
|
|
src/pcl_ros/filters/voxel_grid.cpp
|
2014-08-01 07:02:36 -04:00
|
|
|
src/pcl_ros/filters/crop_box.cpp
|
2013-07-19 17:27:18 -07:00
|
|
|
)
|
2015-05-27 16:52:23 -04:00
|
|
|
target_link_libraries(pcl_ros_filters pcl_ros_tf ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2013-09-18 14:00:29 -07:00
|
|
|
add_dependencies(pcl_ros_filters ${PROJECT_NAME}_gencfg)
|
2012-12-17 21:17:31 -08:00
|
|
|
class_loader_hide_library_symbols(pcl_ros_filters)
|
|
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Declare the pcl_ros_segmentation library
|
2013-05-11 03:29:09 +09:00
|
|
|
add_library (pcl_ros_segmentation
|
2013-07-19 17:27:18 -07:00
|
|
|
src/pcl_ros/segmentation/extract_clusters.cpp
|
|
|
|
|
src/pcl_ros/segmentation/extract_polygonal_prism_data.cpp
|
|
|
|
|
src/pcl_ros/segmentation/sac_segmentation.cpp
|
|
|
|
|
src/pcl_ros/segmentation/segment_differences.cpp
|
|
|
|
|
src/pcl_ros/segmentation/segmentation.cpp
|
|
|
|
|
)
|
2015-06-22 17:31:48 +02:00
|
|
|
target_link_libraries(pcl_ros_segmentation pcl_ros_tf ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2013-09-20 11:21:56 -07:00
|
|
|
add_dependencies(pcl_ros_segmentation ${PROJECT_NAME}_gencfg)
|
2013-05-11 03:29:09 +09:00
|
|
|
class_loader_hide_library_symbols(pcl_ros_segmentation)
|
|
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Declare the pcl_ros_surface library
|
2013-05-11 03:29:09 +09:00
|
|
|
add_library (pcl_ros_surface
|
2013-07-19 17:27:18 -07:00
|
|
|
src/pcl_ros/surface/surface.cpp
|
|
|
|
|
# Compilation is much faster if we include all the following CPP files in surface.cpp
|
|
|
|
|
src/pcl_ros/surface/convex_hull.cpp
|
|
|
|
|
src/pcl_ros/surface/moving_least_squares.cpp
|
|
|
|
|
)
|
2015-05-27 16:52:23 -04:00
|
|
|
target_link_libraries(pcl_ros_surface ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2013-09-20 11:21:56 -07:00
|
|
|
add_dependencies(pcl_ros_surface ${PROJECT_NAME}_gencfg)
|
2013-05-11 03:29:09 +09:00
|
|
|
class_loader_hide_library_symbols(pcl_ros_surface)
|
|
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
## Tools
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
add_executable(pcd_to_pointcloud tools/pcd_to_pointcloud.cpp)
|
2015-06-22 17:31:48 +02:00
|
|
|
target_link_libraries(pcd_to_pointcloud ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
add_executable(pointcloud_to_pcd tools/pointcloud_to_pcd.cpp)
|
2015-06-22 17:31:48 +02:00
|
|
|
target_link_libraries(pointcloud_to_pcd ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARY_DIRS} ${PCL_LIBRARIES})
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
add_executable(bag_to_pcd tools/bag_to_pcd.cpp)
|
2015-06-22 17:31:48 +02:00
|
|
|
target_link_libraries(bag_to_pcd pcl_ros_tf ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARY_DIRS} ${PCL_LIBRARIES})
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
add_executable(convert_pcd_to_image tools/convert_pcd_to_image.cpp)
|
2015-06-22 17:31:48 +02:00
|
|
|
target_link_libraries(convert_pcd_to_image ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2013-07-19 17:27:18 -07:00
|
|
|
add_executable(convert_pointcloud_to_image tools/convert_pointcloud_to_image.cpp)
|
2015-06-22 17:31:48 +02:00
|
|
|
target_link_libraries(convert_pointcloud_to_image ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${PCL_LIBRARIES})
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2017-05-31 02:29:09 +09:00
|
|
|
## Downloads
|
|
|
|
|
|
|
|
|
|
catkin_download(table_scene_lms400.pcd http://download.ros.org/data/pcl/table_scene_lms400.pcd
|
|
|
|
|
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/samples/data
|
|
|
|
|
MD5 546b5b4822fb1de21b0cf83d41ad6683
|
|
|
|
|
)
|
|
|
|
|
add_custom_target(download ALL DEPENDS download_extra_data)
|
|
|
|
|
|
2015-02-11 11:42:25 -08:00
|
|
|
#############
|
|
|
|
|
## Testing ##
|
|
|
|
|
#############
|
|
|
|
|
|
|
|
|
|
if(CATKIN_ENABLE_TESTING)
|
2015-05-27 16:52:23 -04:00
|
|
|
find_package(rostest REQUIRED)
|
|
|
|
|
add_rostest_gtest(test_tf_message_filter_pcl tests/test_tf_message_filter_pcl.launch src/test/test_tf_message_filter_pcl.cpp)
|
|
|
|
|
target_link_libraries(test_tf_message_filter_pcl ${catkin_LIBRARIES} ${GTEST_LIBRARIES})
|
2017-05-31 02:45:14 +09:00
|
|
|
add_rostest(samples/sample_statistical_outlier_removal.launch ARGS gui:=false)
|
2017-05-31 02:29:09 +09:00
|
|
|
add_rostest(samples/sample_voxel_grid.launch ARGS gui:=false)
|
2015-02-11 11:42:25 -08:00
|
|
|
endif(CATKIN_ENABLE_TESTING)
|
|
|
|
|
|
2012-12-17 18:09:15 -08:00
|
|
|
|
2012-10-04 16:58:35 +02:00
|
|
|
install(DIRECTORY include/${PROJECT_NAME}/
|
2013-07-19 17:27:18 -07:00
|
|
|
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
|
|
|
|
|
|
|
|
|
|
install(
|
|
|
|
|
TARGETS
|
|
|
|
|
pcl_ros_tf
|
|
|
|
|
pcl_ros_io
|
|
|
|
|
pcl_ros_features
|
|
|
|
|
pcl_ros_filters
|
|
|
|
|
pcl_ros_surface
|
|
|
|
|
pcl_ros_segmentation
|
|
|
|
|
pcd_to_pointcloud
|
|
|
|
|
pointcloud_to_pcd
|
|
|
|
|
bag_to_pcd
|
|
|
|
|
convert_pcd_to_image
|
|
|
|
|
convert_pointcloud_to_image
|
|
|
|
|
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
|
|
|
|
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
|
|
|
|
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
2012-09-13 13:40:21 +00:00
|
|
|
)
|
2012-09-13 13:26:12 +00:00
|
|
|
|
2017-05-31 02:54:50 +09:00
|
|
|
install(DIRECTORY plugins samples
|
|
|
|
|
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
|