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

Undefined reference to pcl_ros::transformPointCloud

asked 2015-12-28 22:38:22 -0500

Robpuff gravatar image

updated 2016-01-08 20:44:59 -0500

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?

edit retag flag offensive close merge delete

Comments

do you also find_package the PCL library?

mgruhler gravatar image mgruhler  ( 2016-01-07 07:09:25 -0500 )edit

Yes, I use find_package(PCL REQUIRED). I included my entire CMakeLists file Thanks

Robpuff gravatar image Robpuff  ( 2016-01-08 20:47:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-01-08 23:31:17 -0500

ahendrix gravatar image

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
)
edit flag offensive delete link more

Comments

Thank you so much! This worked for me!

Robpuff gravatar image Robpuff  ( 2016-01-09 02:51:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-28 22:38:22 -0500

Seen: 262 times

Last updated: Jan 08 '16