Build error when adding a new point type
henry0572 opened this issue · 2 comments
Last year, a per-point time stamp was added to velodyne ros drivers.
ros-drivers velodyne
Issue Add a per-point timestamping of data
ros-drivers/velodyne#281
PR Add per-point time field
ros-drivers/velodyne#290
I'd like to use this in ndt_omp as well, as it helps with distortion correction in combination with IMU.
I added a new point time PointXYZIT in reference to the issue below, but it doesn't work.
fast_gicp
Support for more pcl point types
koide3/fast_gicp#10
henry@ubuntu:~/catkin_ws$ catkin_make -j4
~~~
[100%] Linking CXX executable /home/henry/catkin_ws/devel/lib/ndt_omp/align
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::KdTreeFLANN<PointXYZIT, flann::L2_Simple<float> >::nearestKSearch(PointXYZIT const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::KdTreeFLANN<PointXYZIT, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<PointXYZIT> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::KdTreeFLANN<PointXYZIT, flann::L2_Simple<float> >::radiusSearch(PointXYZIT const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::VoxelGrid<PointXYZIT>::applyFilter(pcl::PointCloud<PointXYZIT>&)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::PCLBase<PointXYZIT>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `void pcl::getMinMax3D<PointXYZIT>(pcl::PointCloud<PointXYZIT>::ConstPtr const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, float, float, Eigen::Matrix<float, 4, 1, 0, 4, 1>&, Eigen::Matrix<float, 4, 1, 0, 4, 1>&, bool)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::KdTreeFLANN<PointXYZIT, flann::L2_Simple<float> >::KdTreeFLANN(bool)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::KdTreeFLANN<PointXYZIT, flann::L2_Simple<float> >::setEpsilon(float)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::PCLBase<PointXYZIT>::setInputCloud(boost::shared_ptr<pcl::PointCloud<PointXYZIT> const> const&)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::PCLBase<PointXYZIT>::setIndices(boost::shared_ptr<pcl::PointIndices const> const&)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::PCLBase<PointXYZIT>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::KdTreeFLANN<PointXYZIT, flann::L2_Simple<float> >::cleanup()'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::PCLBase<PointXYZIT>::PCLBase()'
/usr/bin/ld: /home/henry/catkin_ws/devel/lib/libndt_omp.so: undefined reference to `pcl::PCLBase<PointXYZIT>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [ndt_omp/CMakeFiles/align.dir/build.make:390: /home/henry/catkin_ws/devel/lib/ndt_omp/align] エラー 1
make[1]: *** [CMakeFiles/Makefile2:4845: ndt_omp/CMakeFiles/align.dir/all] エラー 2
make: *** [Makefile:141: all] エラー 2
Invoking "make -j4" failed
Can you give me some advices on these result?
Thank you!
Customized ndt_omp
henry0572@de4d98b
@henry0572
Probably, you need to include implementation hpp files corresponding to the undefined references in voxel_grid_covariance_omp.cpp
and ndt_omp.cpp
(like following ones).
#include <pcl/impl/pcl_base.hpp>
#include <pcl/filters/impl/voxel_grid.hpp>
#include <pcl/kdtree/impl/kdtree_flann.hpp>
Thank you for your quick comment.
I was able to build it successfully.