Ask Your Question
0

pcl_ros compilation from source

asked 2013-01-31 10:32:54 -0600

kalectro gravatar image

Hi,

I am trying to install pcl_ros from source on a raspberry pi running groovy. I get this undefined reference when it tries to link bag_to_pcd

[  5%] Built target pcl_ros_tf
Linking CXX executable /opt/ros/groovy/ros_catkin_ws/devel_isolated/pcl_ros/lib/pcl_ros/bag_to_pcd
CMakeFiles/bag_to_pcd.dir/tools/bag_to_pcd.cpp.o: In function `pcl::PCDWriter::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool)':
bag_to_pcd.cpp:(.text._ZN3pcl9PCDWriter5writeERKSsRKN11sensor_msgs12PointCloud2_ISaIvEEERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEERKNS9_10QuaternionIfLi0EEEb[pcl::PCDWriter::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool)]+0x40): undefined reference to `pcl::PCDWriter::writeBinary(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&)'
bag_to_pcd.cpp:(.text._ZN3pcl9PCDWriter5writeERKSsRKN11sensor_msgs12PointCloud2_ISaIvEEERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEERKNS9_10QuaternionIfLi0EEEb[pcl::PCDWriter::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool)]+0x6c): undefined reference to `pcl::PCDWriter::writeASCII(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, int)'
collect2: ld returned 1 exit status
make[2]: *** [/opt/ros/groovy/ros_catkin_ws/devel_isolated/pcl_ros/lib/pcl_ros/bag_to_pcd] Error 1
make[1]: *** [CMakeFiles/bag_to_pcd.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'pcl_ros': 
  Command '['/opt/ros/groovy/ros_catkin_ws/build_isolated/nodelet_topic_tools/catkin_generated/env_cached.sh', 'make', '-j1']' returned non-zero exit status 2
Command failed, exiting.

according to the PCL forum an undefined reference to pcl::PCDWriter::write means that I did not link against libpcl_io.so

I checked the CMakeLists and it does link against it, so I do not know what the problem is. It would be great if anyone can help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-07 14:39:55 -0600

kalectro gravatar image

So the problem seems to be that I compiled PCL as an external library which is unfortunately different from PCL provided by ROS.

edit flag offensive delete link more

Comments

So what did you do to fix it?

obsti gravatar imageobsti ( 2013-03-26 08:50:42 -0600 )edit

if you install ROS from source it comes with its own PCL which should work. Installing PCL as an external dependency can also work. Just make sure to compile with USE_ROS = 1

kalectro gravatar imagekalectro ( 2013-03-26 10:20:41 -0600 )edit

Where and how do I need to set USE_ROS=1?

obsti gravatar imageobsti ( 2013-03-26 11:14:30 -0600 )edit

Which version do you want to compile? Is 1.6.0 ok for you? Then you can use the PCL provided by ROS and you can just catkin_make_isolated it without any change. If 1.6.0 is not acceptable, use cmake -DUSE_ROS=1 .

kalectro gravatar imagekalectro ( 2013-03-26 11:17:16 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-01-31 10:32:54 -0600

Seen: 834 times

Last updated: Feb 07 '13