0
$\begingroup$

Rosanswers logo

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, std::allocator > 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


Originally posted by ctguell on ROS Answers with karma: 63 on 2013-10-10

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This is the wrong way. You should create a new ros package and use pcl17 in this package. Don't manipulate pcl17 directly.


Originally posted by MichaelKorn with karma: 1480 on 2013-10-10

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ctguell on 2013-10-11:
@MichaelKorn thanks, could you explain a little how to accomplish this? to be able use the pcl17 code with ROS

Comment by MichaelKorn on 2013-10-12:
Just create a new ROS package and use pcl17 as dependency.

Comment by ctguell on 2013-10-15:
@MichaelKorn thanks. Now im in the verge of finally accomplishing the task but i have a small problem. When i run the program from the bin, from the package pcl17 direct form download, "rosrun pcl17 pcl_ground_based_rgbd_people_detector" it runs but with a problem. but if I run it from the pcl_trunk "/pcl17/build/pcl_trunk/build/bin$ ./pcl_ground_based_rgbd_people_detector" it runs perfectly. So when in include the pcl17 in my new package im getting the program that has the problem and not the one in trunk that works fine. Do you have any idea how to solve this? The error is the following. [pcl17::people::PersonClassifier::evaluate] SVM has not been set! once again thanks

Comment by MichaelKorn on 2013-10-15:
I'm not familiar with the PersonClassifier. You can find the error message in people/include/pcl/people/impl/person_classifier.hpp. So the question is why:SVM_weights_.size() == 0? This should be loaded from a file. In the main_ground_based_people_detection.cpp you can find a hard-coded RELATIV Path

Comment by ctguell on 2013-10-15:
@MichaelKorn thanks that was the problem, its solved now, really appreciate the help ;)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.