Ask Your Question
0

Laser Scan to Point Cloud Error

asked 2017-03-01 22:27:06 -0600

edokusmayuda gravatar image

updated 2017-03-02 06:12:32 -0600

gvdhoorn gravatar image

Hi, I am trying to convert laser scan data to point cloud as the tutorial that show Here. But i get this error when i make the package using catkin_make:

[ 66%] Built target tf_generate_messages_py
[ 83%] Linking CXX executable /home/edokusmayuda/catkin_ws/devel/lib/laser_scan/laser_scan_node
CMakeFiles/laser_scan_node.dir/src/laser_scan.cpp.o: In function `laser_geometry::LaserProjection::transformLaserScanToPointCloud(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::LaserScan_<std::allocator<void> > const&, sensor_msgs::PointCloud_<std::allocator<void> >&, tf::Transformer&, int)':
laser_scan.cpp:(.text._ZN14laser_geometry15LaserProjection30transformLaserScanToPointCloudERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN11sensor_msgs10LaserScan_ISaIvEEERNS9_11PointCloud_ISB_EERN2tf11TransformerEi[_ZN14laser_geometry15LaserProjection30transformLaserScanToPointCloudERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN11sensor_msgs10LaserScan_ISaIvEEERNS9_11PointCloud_ISB_EERN2tf11TransformerEi]+0x4a): undefined reference to `laser_geometry::LaserProjection::transformLaserScanToPointCloud_(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud_<std::allocator<void> >&, sensor_msgs::LaserScan_<std::allocator<void> > const&, tf::Transformer&, double, int)'
CMakeFiles/laser_scan_node.dir/src/laser_scan.cpp.o: In function `LaserScanToPointCloud::LaserScanToPointCloud(ros::NodeHandle)':
laser_scan.cpp:(.text._ZN21LaserScanToPointCloudC2EN3ros10NodeHandleE[_ZN21LaserScanToPointCloudC5EN3ros10NodeHandleE]+0x5c9): undefined reference to `laser_geometry::LaserProjection::~LaserProjection()'
CMakeFiles/laser_scan_node.dir/src/laser_scan.cpp.o: In function `LaserScanToPointCloud::~LaserScanToPointCloud()':
laser_scan.cpp:(.text._ZN21LaserScanToPointCloudD2Ev[_ZN21LaserScanToPointCloudD5Ev]+0x63): undefined reference to `laser_geometry::LaserProjection::~LaserProjection()'
laser_scan.cpp:(.text._ZN21LaserScanToPointCloudD2Ev[_ZN21LaserScanToPointCloudD5Ev]+0xcb): undefined reference to `laser_geometry::LaserProjection::~LaserProjection()'
collect2: error: ld returned 1 exit status
laser_scan/CMakeFiles/laser_scan_node.dir/build.make:118: recipe for target '/home/edokusmayuda/catkin_ws/devel/lib/laser_scan/laser_scan_node' failed
make[2]: *** [/home/edokusmayuda/catkin_ws/devel/lib/laser_scan/laser_scan_node] Error 1
CMakeFiles/Makefile2:991: recipe for target 'laser_scan/CMakeFiles/laser_scan_node.dir/all' failed
make[1]: *** [laser_scan/CMakeFiles/laser_scan_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

this is my CMakelist.txtx

find_package(catkin REQUIRED COMPONENTS message_filters sensor_msgs tf) 
catkin_package(CATKIN_DEPENDS message_filters sensor_msgs tf)
include_directories(${Eigen_INCLUDE_DIRS})
include_directories(${catkin_INCLUDE_DIRS})
add_executable(laser_scan_node src/laser_scan.cpp)
add_dependencies(laser_scan_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${Eigen_INCLUDE_DIRS})
target_link_libraries(laser_scan_node ${catkin_LIBRARIES} ${Eigen_INCLUDE_DIRS})

Can anybody help me. Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-02 06:38:20 -0600

mgruhler gravatar image

You need to add laser_geometry as a dependency.

I.e. in the package.xml as a depend and in the CMakeLists.txt add it to the find_package call.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-03-01 22:27:06 -0600

Seen: 187 times

Last updated: Mar 02 '17