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

Normal Estimation using PCL--Error

asked 2013-08-24 22:23:14 -0500

sai gravatar image

updated 2013-08-26 00:59:09 -0500

Ubuntu12.04 fuerte

When I just add this one line in the code, I am getting the errors given below.

pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;

Full code

void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& cloud) {

sensor_msgs::PointCloud2 cloud_filtered;

         // estimate normals
         pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>);

              pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;

// Publish the data pub.publish (cloud_filtered);

}

Error:

CMakeFiles/temp3.dir/src/temp3.cpp.o: In function pcl::search::OrganizedNeighbor<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)': temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEE[pcl::search::OrganizedNeighbor<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)]+0x88): undefined reference topcl::search::OrganizedNeighbor<pcl::pointxyz>::estimateFocalLengthFromInputCloud(pcl::PointCloud<pcl::pointxyz> const&)' temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEE[pcl::search::OrganizedNeighbor<pcl::pointxyz>::setInputCloud(boost::shared_ptr<pcl::pointcloud<pcl::pointxyz> const> const&)]+0xa2): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::generateRadiusLookupTable(unsigned int, unsigned int)' CMakeFiles/temp3.dir/src/temp3.cpp.o: In functionpcl::search::OrganizedNeighbor<pcl::pointxyz>::setInputCloud(boost::shared_ptr<pcl::pointcloud<pcl::pointxyz> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int=""> > const> const&)': temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEERKNS5_IKSt6vectorIiSaIiEEEE[pcl::search::OrganizedNeighbor<pcl::pointxyz>::setInputCloud(boost::shared_ptr<pcl::pointcloud<pcl::pointxyz> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int=""> > const> const&)]+0xd8): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::estimateFocalLengthFromInputCloud(pcl::PointCloud<pcl::PointXYZ> const&)' temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEERKNS5_IKSt6vectorIiSaIiEEEE[pcl::search::OrganizedNeighbor<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)]+0xf2): undefined reference topcl::search::OrganizedNeighbor<pcl::pointxyz>::generateRadiusLookupTable(unsigned int, unsigned int)' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::pointxyz>]+0x24): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::nearestKSearch(pcl::PointCloud<pcl::PointXYZ> const&, int, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&)' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::PointXYZ>]+0x28): undefined reference topcl::search::OrganizedNeighbor<pcl::pointxyz>::nearestKSearch(int, int, std::vector<int, std::allocator<int=""> >&, std::vector<float, std::allocator<float=""> >&)' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::pointxyz>]+0x30): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::radiusSearch(pcl::PointXYZ const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, int) const' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::PointXYZ>]+0x38): undefined reference topcl::search::OrganizedNeighbor<pcl::pointxyz>::radiusSearch(int, double, std::vector<int, std::allocator<int=""> >&, std::vector<float, std::allocator<float=""> >&, int) const' collect2: ld returned 1 exit status make[3]: * [../bin/temp3] Error 1

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2013-08-29 04:16:37 -0500

teddybouch gravatar image

I'm having a very similar issue, which I posted to the PCL pages here: http://www.pcl-users.org/undefined-reference-to-pcl-PCLBase-when-linking-with-catkin-td4029311.html#a4029329

I tried adding the namespace line, but I got a compilation error:

/home/abouchard/catkin_ws/src/find_object/src/find_object.cpp:46:17: error: ‘pcl17’ is not a namespace-name

My initial hunch was that I had incorrectly installed PCL 1.7 over 1.6, and indeed they had installed to different places and it seemed to be a crap shoot which files were being used. However, at this point I've completely removed all 1.6 stuff and it's still hitting linker problems.

Since I'm able to build the correspondence_grouping tutorial independent of ROS, I'm starting to think that the issue might be with catkin, and was researching other answers here to make sure that it's not already addressed when I ran across this.

edit flag offensive delete link more
0

answered 2013-08-26 02:07:24 -0500

First of all, I can't read your error very well, looks like some linker problems.

Not sure if helpful, I am using the experimental pcl 1.7, but this works for me:

using namespace pcl17;
NormalEstimation<PointXYZRGB, PointXYZRGBNormal> ne;

I tried to change PointXYZRGBNormal to Normal and got compiler errors instead of your linker error.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-08-24 22:23:14 -0500

Seen: 2,180 times

Last updated: Aug 29 '13