0

Rosanswers logo

I am getting undefined reference to pcl_ros::transformPointCloud in the linking phase of catkin_make. This is the source code:

void cloud_cb_cam1 (const sensor_msgs::PointCloud2ConstPtr& input)
{
  cam1_data_valid = true;

sensor_msgs::PointCloud2 ros_cam1; pcl_ros::transformPointCloud("pf1_link", input, ros_cam1, tf_listener); pcl_conversions::toPCL(ros_cam1, pcl_cam1);

if (cam1_data_valid && cam2_data_valid) { cam1_data_valid = false; cam2_data_valid = false; pcl_combine(); } }

My CMakeLists includes these libraries:

cmake_minimum_required(VERSION 2.8.3)
project(pc_combine)

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs ) find_package(PCL REQUIRED)

catkin_package( )

include_directories( ${catkin_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} )

target_link_libraries( pc_combine ${catkin_LIBRARIES} ${PCL_LIBRARIES} )

link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS})

Am I missing any libraries?


Originally posted by Robpuff on ROS Answers with karma: 3 on 2015-12-28

Post score: 0


Original comments

Comment by mgruhler on 2016-01-07:
do you also find_package the PCL library?

Comment by Robpuff on 2016-01-08:
Yes, I use find_package(PCL REQUIRED). I included my entire CMakeLists file Thanks

1 Answers1

0

Rosanswers logo

Your C++ code is using the pcl_ros and pcl_conversions packages, in addition to PCL. You should also include these packages in your list of dependencies:

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  pcl_ros
  pcl_conversions
)

Originally posted by ahendrix with karma: 47576 on 2016-01-09

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Robpuff on 2016-01-09:
Thank you so much! This worked for me!