ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Problem with PCL using ROS indigo

asked 2014-11-16 20:45:23 -0500

lmartinez gravatar image

ROS indigo, pcl-1.7

I try to use voxel grid filter with the line:

pcl::VoxelGrid<pcl::pclpointcloud2> sor;

But it throws errors when linking the libraries like the following:

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpcl_filters.so: undefined reference to `pcl::search::KdTree<pcl::pointxyzrgbnormal, pcl::kdtreeflann<pcl::pointxyzrgbnormal,="" flann::l2_simple<float=""> > >::KdTree(bool)'

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpcl_filters.so: undefined reference to `pcl::PCLBase<pcl::cppfsignature>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libpcl_filters.so: undefined reference to `pcl::search::KdTree<pcl::pointxyz, pcl::kdtreeflann<pcl::pointxyz,="" flann::l2_simple<float=""> > >::KdTree(bool)'

When I don't use voxel grid filter, the program compiles without problems.

Can someone tell me why it might be?

edit retag flag offensive close merge delete

Comments

Please add your CMakeLists to your question.

paulbovbel gravatar image paulbovbel  ( 2014-11-22 23:50:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-07-21 15:44:52 -0500

ZainMehdi gravatar image

It might be late but could help someone with the same problem. The issue can be resolved by compiling /installing latest version of pcl from source. Additionally if your program uses pcl_conversion and pcl_ros packages that were installed from binaries then they will link against older version of pcl and again create dependency issue. You have to build these packages from source too to maintain version consistency. After it you wont have this error and program will compile fine.

edit flag offensive delete link more

Comments

1

How exactly did you go about installing pcl_conversions and pcl_ros from source?

M@t gravatar image M@t  ( 2018-04-10 20:11:57 -0500 )edit
2

Just download the package in your workspace and build them.

ZainMehdi gravatar image ZainMehdi  ( 2018-04-10 20:34:12 -0500 )edit
1

Yeap, not entirely sure how catkin/cmake knows to use the local version rather than the installed binaries, but I can confirm that using pcl_ros installed from source gets around the dependency issue I had with pcl_ros requiring PCL 1.7 (I'm now using PCL 1.8). Thanks for the help @ZainMehdi!

M@t gravatar image M@t  ( 2018-04-11 17:47:22 -0500 )edit

@ZainMehdi sorry I know this is an old post, but your suggestion works until I try to compile multiple ros packages from source that require PCL. Just one ros package is fine, but two or more and I get a very odd error. Any ideas?:

add_custom_target cannot create target "pcl_ros_gencfg" because another
  target with the same name already exists.  The existing target is a custom
  target created in source directory "/opt/ros_ws/src/other_ros_node_requiring_pcl".  See
  documentation for policy CMP0002 for more details.

I've created a new issue here: https://answers.ros.org/question/3729...

ia gravatar image ia  ( 2021-03-01 09:04:01 -0500 )edit

Question Tools

Stats

Asked: 2014-11-16 20:45:23 -0500

Seen: 1,188 times

Last updated: Jul 21 '17