How to link ROS to pcl17
Im running the ground_based_rgbd_people_detector from pcl17 and im looking to publish the distance to ROS. To do this i Included ros/ros.h to the .cpp code but when i try to compile it y get the following error:--undefined reference to `ros::init(int&, char**, std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, unsigned int)'
Im using rosbuild, and im really stuck. Would really appreciate some help.
I Need to add the reference to ros or the ros ibrary in the CMakeList.txt but dont know how. Right now my CMakeList.txt is: set(SUBSYS_NAME people) set(SUBSYS_DESC "Point cloud people library") set(SUBSYS_DEPS common kdtree search features sample_consensus filters io visualization geometry segmentation octree)
if(NOT VTK_FOUND) set(DEFAULT FALSE) set(REASON "VTK was not found.") else(NOT VTK_FOUND) set(DEFAULT TRUE) set(REASON) set(VTK_USE_FILE ${VTK_USE_FILE} CACHE INTERNAL "VTK_USE_FILE") include (${VTK_USE_FILE}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) endif(NOT VTK_FOUND)
set(build TRUE) PCL_SUBSYS_OPTION(build ${SUBSYS_NAME} ${SUBSYS_DESC} ON) PCL_SUBSYS_DEPEND(build ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS})
PCL_ADD_DOC(${SUBSYS_NAME})
if(build) set(incs include/pcl17/${SUBSYS_NAME}/ground_based_people_detection_app.h include/pcl17/${SUBSYS_NAME}/head_based_subcluster.h include/pcl17/${SUBSYS_NAME}/height_map_2d.h include/pcl17/${SUBSYS_NAME}/person_classifier.h include/pcl17/${SUBSYS_NAME}/person_cluster.h include/pcl17/${SUBSYS_NAME}/hog.h )
set(impl_incs
include/pcl17/${SUBSYS_NAME}/impl/ground_based_people_detection_app.hpp
include/pcl17/${SUBSYS_NAME}/impl/head_based_subcluster.hpp
include/pcl17/${SUBSYS_NAME}/impl/height_map_2d.hpp
include/pcl17/${SUBSYS_NAME}/impl/person_classifier.hpp
include/pcl17/${SUBSYS_NAME}/impl/person_cluster.hpp
include/pcl17/${SUBSYS_NAME}/impl/hog.hpp
)
set(srcs
)
set(LIB_NAME pcl_${SUBSYS_NAME})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${impl_incs})
PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "${SUBSYS_DEPS}" "" "" "" "")
# Install include files
PCL_ADD_INCLUDES(${SUBSYS_NAME} ${SUBSYS_NAME} ${incs})
PCL_ADD_INCLUDES(${SUBSYS_NAME} ${SUBSYS_NAME}/impl ${impl_incs})
SET_TARGET_PROPERTIES(pcl_${SUBSYS_NAME} PROPERTIES LINKER_LANGUAGE CXX)
PCL_ADD_EXECUTABLE(pcl_ground_based_rgbd_people_detector ${SUBSYS_NAME} apps/main_ground_based_people_detection.cpp)
target_link_libraries(pcl_ground_based_rgbd_people_detector pcl_people pcl_common pcl_kdtree pcl_search pcl_features pcl_sample_consensus pcl_filters pcl_io pcl_visualization pcl_segmentation)
endif(build)
How can i refenrece correctly to ROS
Cris