introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.84k stars 786 forks source link

Build error eigen Plugins #1283

Open adricort opened 6 months ago

adricort commented 6 months ago

I am trying to build rtabmap and rtabmap_ros from source (rolling, I know binaries are not passing) as indicated in the instructions, but 2 things happen:

  1. I get the following error:

Starting >>> grid_map_ros --- stderr: rtabmap
CMake Deprecation Warning at examples/LidarMapping/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell

CMake that the project does not need compatibility with older versions.

: fatal error: grid_map_core/eigen_plugins/FunctorsPlugin.hpp: No such file or directory compilation terminated. : fatal error: grid_map_core/eigen_plugins/FunctorsPlugin.hpp: No such file or directory compilation terminated. : fatal error: grid_map_core/eigen_plugins/FunctorsPlugin.hpp: No such file or directory gmake[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/build.make:146: corelib/src/CMakeFiles/rtabmap_core.dir/Memory.cpp.o] Error 1 gmake[2]: *** Waiting for unfinished jobs.... gmake[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/build.make:118: corelib/src/CMakeFiles/rtabmap_core.dir/RtabmapThread.cpp.o] Error 1 compilation terminated. gmake[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/build.make:104: corelib/src/CMakeFiles/rtabmap_core.dir/Rtabmap.cpp.o] Error 1 : fatal error: grid_map_core/eigen_plugins/FunctorsPlugin.hpp: No such file or directory compilation terminated. gmake[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/build.make:174: corelib/src/CMakeFiles/rtabmap_core.dir/DBDriverSqlite3.cpp.o] Error 1 : fatal error: grid_map_core/eigen_plugins/FunctorsPlugin.hpp: No such file or directory compilation terminated. gmake[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/build.make:160: corelib/src/CMakeFiles/rtabmap_core.dir/DBDriver.cpp.o] Error 1 : fatal error: grid_map_core/eigen_plugins/FunctorsPlugin.hpp: No such file or directory compilation terminated. gmake[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/build.make:132: corelib/src/CMakeFiles/rtabmap_core.dir/Statistics.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:894: corelib/src/CMakeFiles/rtabmap_core.dir/all] Error 2 gmake: *** [Makefile:156: all] Error 2 --- Failed <<< rtabmap [6.81s, exited with code 2]

Is there any modification in the package for it to find the eigen plugins properly? I haven't found so much documentation about it, only here, but I think it is another problem.

  1. (maybe not important at the moment) libpointmatcher can't be resolved for the dependencies for jammy, is it required?
matlabbe commented 6 months ago

The error seems coming from grid_map_core. You can disable that dependency with cmake -DWITH_GRIDMAP=OFF ... Thanks for the link, if I can reproduce it I could give a try. What is your machine? Ubuntu 22.04 with ROS2 Humble? From CI, rtabmap should build on jammy/humble even with ros-humble-grid-map-core dependency, see log here: https://github.com/introlab/rtabmap/actions/runs/9238128356/job/25415869022

libpointmatcher from ros-humble-libpointmatcher should also work.

Serafadam commented 1 month ago

Hi, I had the same issue when linking against rtabmap from official ROS apt, it seems that this issue is related to https://github.com/ANYbotics/grid_map/issues/382

matlabbe commented 1 month ago

I tried building RGBDMapping example using rtabmap humble binaries and I don't see the error.

source /opt/ros/humble/setup.bash
cd rtabmap/examples/RGBDMapping
mkdir build
cd build
cmake ..
make VERBOSE=1

Here the include directories make VERBOSE=1: /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DDISABLE_PCAP -DDISABLE_PNG -DEIGEN_DENSEBASE_PLUGIN=\"grid_map_core/eigen_plugins/DenseBasePlugin.hpp\" -DEIGEN_FUNCTORS_PLUGIN=\"grid_map_core/eigen_plugins/FunctorsPlugin.hpp\" -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -Dkiss_fft_scalar=double -I/home/mathieu/workspace/rtabmap/examples/RGBDMapping/build/rgbd_mapping_autogen/include -isystem /opt/ros/humble/include/rtabmap-0.21 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/opencv4 -isystem /usr/include/pcl-1.12 -isystem /usr/include/eigen3 -isystem /usr/include/ni -isystem /opt/ros/humble/include -isystem /usr/include/openni2 -isystem /usr/include/vtk-9.1 -isystem /usr/include/jsoncpp -isystem /usr/include/freetype2 -fPIC -MD -MT CMakeFiles/rgbd_mapping.dir/main.cpp.o -MF CMakeFiles/rgbd_mapping.dir/main.cpp.o.d -o CMakeFiles/rgbd_mapping.dir/main.cpp.o -c /home/mathieu/workspace/rtabmap/examples/RGBDMapping/main.cpp

I see -isystem /opt/ros/humble/include and on my system, the files grid_map_core/eigen_plugins/DenseBasePlugin.hpp and grid_map_core/eigen_plugins/FunctorsPlugin.hpp are indeed located under /opt/ros/humble/include:

$ ls /opt/ros/humble/include/grid_map_core/eigen_plugins/*
/opt/ros/humble/include/grid_map_core/eigen_plugins/DenseBasePlugin.hpp
/opt/ros/humble/include/grid_map_core/eigen_plugins/Functors.hpp
/opt/ros/humble/include/grid_map_core/eigen_plugins/FunctorsPlugin.hpp

Are the include directories different on your system?

matlabbe commented 1 month ago

I removed grid_map from the public interface. That change will be pushed on next ros1/ros2 binary release.