libpointmatcher icon indicating copy to clipboard operation
libpointmatcher copied to clipboard

Error during compilation: No match for operator

Open mstampa opened this issue 5 years ago • 8 comments

Name Version
ubuntu: Description: Ubuntu 18.04.3 LTS
architecture: 64-bit
gcc: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
git: git version 2.17.1
cmake: cmake version 3.10.2 CMake suite maintained and supported by Kitware (kitware.com/cmake).
boost: Version: 1.65.1.0ubuntu1
eigen3: Version: 3.3.4-4
doxygen: Version: 1.8.13-10

Hello folks,

I'm trying to use libpointmatcher within a ROS workspace as a dependency to SegMapper. Next to a couple of harmless warnings regarding std::auto_ptr being deprecated, I get errors of the following form during compilation:

~/work/segmap_ws/src/libpointmatcher/pointmatcher/DataPointsFilters/Gestalt.cpp:498:52: error: no match for ‘operator+=’ (operand types are ‘Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<float, -1, -1>, float, float> >::type {aka Eigen::IndexedView<Eigen::Matrix<float, -1, -1>, float, float>}’ and ‘Eigen::DenseCoeffsBase<Eigen::Matrix<float, -1, 1>, 1>::Scalar {aka float}’) gestaltMeans(indices(0,it), indices(1,it)) += heights(it);

Similar errors occur for operator++ and operator- in other lines of the same file.

Issue #329 describes the same problem, but was never fully answered. As proposed by @simonpierredeschenes there I reinstalled Eigen (sudo apt install --reinstall libeigen3-dev; sudo dpkg-reconfigure libeigen3-dev), unfortunately to no avail. Other things I've tried:

  • Check out the master branch (SegMap lists an older version as its dependency)
  • Compile with C++ standards 11,14 and 17: catkin build -DCMAKE_CXX_STANDARD=14 libnabo libpointmatcher

Hopefully I didn't miss anything too obvious. Any help for fixing this problem will be highly appreciated!

Thanks in advance.

mstampa avatar Oct 16 '19 08:10 mstampa

Hi! I am having this issue as well, trying to compile it as a dependency of SegMap. Did you manage to solve it in the end? I would very much appreciate any guidance.

paulacarbo07 avatar Jan 28 '20 13:01 paulacarbo07

@simonpierredeschenes can you have a look?

pomerlef avatar Jan 28 '20 14:01 pomerlef

I have a feeling that the dependency eigen_catkin might be the root problem. I replaced it with "eigen" in all package.xml files, and had to adapt some CMakeLists.txt and include-directives here and there. I did the same with pcl_catkin, doxygen_catkin etc, essentially trying to use versions shipped with Ubuntu and ROS instead of compiling these packages myself whenever possible.

However, I wasn't smart enough to document my changes. In the end, I was able to compile SegMap but it still crashes immediately after startup. But this might be an issue to open up on their page rather than here.

If I have some free time I will try to recreate what I did, but of course I'd prefer if the developers had a look.

mstampa avatar Jan 29 '20 09:01 mstampa

I will try to have a look soon. However, it might take some time before I figure out the issue myself. I will keep you updated if I find something.

simonpierredeschenes avatar Jan 29 '20 17:01 simonpierredeschenes

@simonpierredeschenes I was able to recreate what I did for libpointmatcher. In short:

  • Use find_package for Eigen3 in CMakeLists.txt (it was already included as a TODO)
  • Update all eigen include paths, e.g. from #include <Eigen/Core> to #include <eigen3/Eigen/Core>. This is also necessary in libnabo/nabo/nabo.h.

Please see the patch file attached. On my system it compiles without errors now, hope it helps! issue362.txt

mstampa avatar Feb 07 '20 14:02 mstampa

@fangcywangermu in English would be better...

pomerlef avatar Mar 06 '20 16:03 pomerlef

@simonpierredeschenes I was able to recreate what I did for libpointmatcher. In short:

  • Use find_package for Eigen3 in CMakeLists.txt (it was already included as a TODO)
  • Update all eigen include paths, e.g. from #include <Eigen/Core> to #include <eigen3/Eigen/Core>. This is also necessary in libnabo/nabo/nabo.h.

Please see the patch file attached. On my system it compiles without errors now, hope it helps! issue362.txt

After I changed according to what you said, there was still a problem of mismatch. I changed it according to what txt said.

fangcywangermu avatar Mar 06 '20 16:03 fangcywangermu

@fangcywangermu in English would be better...

OK

fangcywangermu avatar Mar 06 '20 16:03 fangcywangermu

I am getting a quite similar (double not flaot) error on a ROS2 Grid Mapper code. I checked the attached file issue362.txt. Did the exact changes but still no use. I use eigen3.4.0 and ROS2 humble.

bunalti avatar Jan 28 '23 15:01 bunalti

@simonpierredeschenes can you continue the investigation?

pomerlef avatar Jan 30 '23 15:01 pomerlef

I have changed my libeginen3-dev package version=3.4.0 to version=3.3.4 and version=3.3.7 both seems to compile without any issues.

bunalti avatar Jan 31 '23 07:01 bunalti