Search code examples
eigenpoint-cloud-libraryeigen3

PCL 1.8.1 gives compilation errors related with typecast of Eigen classes when using Eigen 3.3.90


For a project that I am working on, I need to use Point Cloud Library and the author of some of the code that I am reusing had suggested to go for PCL 1.8.1 and the latest branch of Eigen3. I downloaded all dependencies and built them successfully. I checked this by making sure I see them in my usr/local/include directory and also ran simple examples for each library (VTK, Boost, Eigen) to see if they work. All is good till there.

Then I downloaded PCL source from GitHub and I am able to configure it. But when I attempt to compile it, I see this error: Downloads/pcl-pcl-1.8.1/surface/include/pcl/surface/impl/bilateral_upsampling.hpp:112:88: error: cannot convert ‘Eigen::internal::enable_if, float, float> >::type {aka Eigen::IndexedView, float, float>}’ to ‘float’ in initialization float val_exp_depth = val_exp_depth_matrix(dx+window_size_, dy+window_size_);

I am using the following:

  • Ubuntu 16.04, PCL 1.8.1, VTK 8.1.1, FLANN 1.8.4, Eigen 3.3.90 (Default branch),Boost 1.68.0.
  • Probably unrelated: CUDA 9.1, Ceres 1.14, gtest, ROS-kinetic (I did ruin my ROS installation in the process, but I don't mind reinstalling it later. I am bringing this up, if by any chance it has some correlation that I have no clue about).

I am new to most of this, so I apologize in advance if I was not able to explain well or have not shared enough information for you to help me. Please let me know, and I'll do as much as I can. Any help is much appreciated. Thanks!


Solution

  • The problem is that the matrix val_exp_depth_matrix is indexed using float values (dxand dy). They must be cast to integral types, like int or long.

    This issue has already been fixed in PCL repository.