introlab / rtabmap

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

ORB_SLAM3::Tracking::Tracking no matching function call when building RTABMap #886

Open Srijal97 opened 2 years ago

Srijal97 commented 2 years ago

I am trying to build RTABMap (from the noetic-devel branch, and also the latest) with ORB_SLAM3 support on Ubuntu 20. It seems that there is a mismatch at this point between /rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp and ORB_SLAM3/include/Tracking.h.

I build RTABMap with the following cmake options: cmake .. -DWITH_G2O=OFF -DWITH_QT=OFF -DWITH_ORB_SLAM=ON, and here is the output:

-- MOBILE_BUILD=OFF
CMake Deprecation Warning at CMakeLists.txt:72 (cmake_policy):
  The OLD behavior for policy CMP0043 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- Eigen found (include: /usr/include/eigen3, version: 3.3.7)
-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- The imported target "vtkParseOGLExt" references the file
   "/usr/bin/vtkParseOGLExt-7.1"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "pvtk" references the file
   "/usr/bin/pvtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.

-- QHULL found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so)
-- PCL definitions don't contain "-march=native", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).
-- Found Sqlite3: /usr/include /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE  found components: C CXX 
-- Found OpenMP: /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;/usr/lib/x86_64-linux-gnu/libpthread.so
-- Add PCL_OMP to definitions
-- Found OpenCV: /usr/include/opencv4
-- Found PCL: /usr/include/pcl-1.10;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/vtk-7.1;/usr/include/freetype2;/usr/include/x86_64-linux-gnu
-- Found ZLIB: /usr/include
-- Found Freenect: /usr/include
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- GTSAM include directory:  /usr/lib/cmake/GTSAM/../../../include
-- FlyCapture2_INCLUDE_DIR=FlyCapture2_INCLUDE_DIR-NOTFOUND
-- FlyCapture2_LIBRARY=FlyCapture2_LIBRARY-NOTFOUND
-- Triclops_INCLUDE_DIR=Triclops_INCLUDE_DIR-NOTFOUND
-- Triclops_LIBRARY=Triclops_LIBRARY-NOTFOUND
-- FlyCaptureBridge_LIBRARY=FlyCaptureBridge_LIBRARY-NOTFOUND
-- Found Boost: /usr/include (found version "1.71.0") found components: thread filesystem system program_options date_time chrono atomic 
-- Found libpointmatcher: /opt/ros/noetic/include;/usr/include/eigen3
-- Found Boost: /usr/include (found version "1.71.0") found components: thread filesystem system program_options date_time chrono timer serialization atomic 
-- Found CUDA: /usr/local/cuda (found suitable version "11.4", minimum required is "11") 
-- Found ZED sdk: /usr/local/zed/include
-- Found CUDA: /usr/local/cuda (found version "11.4") 
-- Found CUDA: /usr/local/cuda/include
-- Found octomap 1.9.8: /opt/ros/noetic/include
-- Architecture: x86_64
-- Found Pangolin: /usr/local/lib/cmake/Pangolin/../../../include;/usr/include;/usr/include;/usr/include;/usr/include/eigen3
-- Found ORB_SLAM3: /root/ORB_SLAM3/include;/root/ORB_SLAM3/include/CameraModels;/root/ORB_SLAM3/Thirdparty/g2o;/root/ORB_SLAM3;/usr/local/lib/cmake/Pangolin/../../../include;/usr/include;/usr/include;/usr/include;/usr/include/eigen3
-- Found Pthreads
-- RTAB-Map GUI lib is not built, some tools won't be built...
-- RTAB-Map GUI lib is not built, the RGBDMapping and WifiMapping examples will not be built...
-- --------------------------------------------
-- Info :
--   RTAB-Map Version =     0.20.18
--   CMAKE_VERSION =        3.16.3
--   CMAKE_INSTALL_PREFIX = /usr/local
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++14
--   FLANN_KDTREE_MEM_OPT = OFF
--   PCL_DEFINITIONS = -DDISABLE_OPENNI2;-DDISABLE_PCAP;-DDISABLE_PNG;-DDISABLE_LIBUSB_1_0
--   PCL_VERSION = 1.10.0
-- 
-- Optional dependencies ('*' affects some default parameters) :
--  *With OpenCV 4.2.0 xfeatures2d = NO, nonfree = NO (License: BSD)
--   With Qt                   = NO (WITH_QT=OFF)
--   With external SQLite3     = YES (License: Public Domain)
--   With ORB OcTree           = YES (License: GPLv3)
--   With SupertPoint          = NO (WITH_TORCH=OFF)
--   With Python3              = NO (WITH_PYTHON=OFF)
--   With Madgwick             = YES (License: GPL)
--   With FastCV               = NO (FastCV not found)
--   With PDAL                 = NO (PDAL not found)
-- 
--  Solvers:
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--  *With g2o                  = NO (WITH_G2O=OFF)
--  *With GTSAM                = YES (License: BSD)
--  *With Ceres                = NO (WITH_CERES=OFF)
--   With VERTIGO              = YES (License: GPLv3)
--   With cvsba                = NO (WITH_CVSBA=OFF)
--  *With libpointmatcher      = YES (License: BSD)
--   With CCCoreLib            = NO (WITH_CCCORELIB=OFF)
--   With Open3D               = NO (WITH_OPEN3D=OFF)
-- 
--  Reconstruction Approaches:
--   With OCTOMAP              = YES (License: BSD)
--   With CPUTSDF              = NO (WITH_CPUTSDF=OFF)
--   With OpenChisel           = NO (WITH_OPENCHISEL=OFF)
--   With AliceVision          = NO (WITH_ALICE_VISION=OFF)
-- 
--  Camera Drivers:
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = YES (License: Apache v2)
--   With Freenect2            = NO (libfreenect2 not found)
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)
--   With Kinect for Azure     = NO (Kinect for Azure SDK not found)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With ZED                  = YES
--   With ZEDOC                = NO (ZED Open Capture not found)
--   With RealSense            = NO (librealsense not found)
--   With RealSense2           = NO (librealsense2 not found)
--   With MyntEyeS             = NO (mynteye s sdk not found)
--   With DepthAI              = NO (WITH_DEPTHAI=OFF)
-- 
--  Odometry Approaches:
--   With loam_velodyne        = NO (WITH_LOAM=OFF)
--   With floam                = NO (WITH_FLOAM=OFF)
--   With libfovis             = NO (WITH_FOVIS=OFF)
--   With libviso2             = NO (WITH_VISO2=OFF)
--   With dvo_core             = NO (WITH_DVO=OFF)
--   With okvis                = NO (WITH_OKVIS=OFF)
--   With msckf_vio            = NO (WITH_MSCKF_VIO=OFF)
--   With VINS-Fusion          = NO (WITH_VINS=OFF)
--   With OpenVINS             = NO (WITH_OPENVINS=OFF)
--   With ORB_SLAM3            = YES (License: GPLv3)
-- Show all options with: cmake -LA | grep WITH_
-- --------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /root/rtabmap/build

While running make, I get the following errors in OdometryORBSLAM.cpp:

/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp: In constructor 'ORB_SLAM3::Tracker::Tracker(ORB_SLAM3::System*, ORB_SLAM3::ORBVocabulary*, ORB_SLAM3::FrameDrawer*, ORB_SLAM3::MapDrawer*, ORB_SLAM3::Atlas*, ORB_SLAM3::KeyFrameDatabase*, const string&, int, long unsigned int)':
/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp:61:52: error: no matching function for call to 'ORB_SLAM3::Tracking::Tracking(ORB_SLAM3::System*&, ORB_SLAM3::ORBVocabulary*&, ORB_SLAM3::FrameDrawer*&, ORB_SLAM3::MapDrawer*&, ORB_SLAM3::Atlas*&, ORB_SLAM3::KeyFrameDatabase*&, const string&, const int&)'
   61 |                maxFeatureMapSize_(maxFeatureMapSize)
      |                                                    ^
In file included from /root/ORB_SLAM3/include/System.h:31,
                 from /root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp:40:
/root/ORB_SLAM3/include/Tracking.h:61:5: note: candidate: 'ORB_SLAM3::Tracking::Tracking(ORB_SLAM3::System*, ORB_SLAM3::ORBVocabulary*, ORB_SLAM3::FrameDrawer*, ORB_SLAM3::MapDrawer*, ORB_SLAM3::Atlas*, ORB_SLAM3::KeyFrameDatabase*, const string&, int, ORB_SLAM3::Settings*, const string&)'
   61 |     Tracking(System* pSys, ORBVocabulary* pVoc, FrameDrawer* pFrameDrawer, MapDrawer* pMapDrawer, Atlas* pAtlas,
      |     ^~~~~~~~
/root/ORB_SLAM3/include/Tracking.h:61:5: note:   candidate expects 10 arguments, 8 provided
/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp: In member function 'void ORB_SLAM3::Tracker::Track()':
/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp:122:31: error: 'using SE3f = class Sophus::SE3<float>' {aka 'class Sophus::SE3<float>'} has no member named 'empty'
  122 |                  if(mVelocity.empty() || mCurrentFrame.mnId<mnLastRelocFrameId+2)
      |                               ^~~~~
/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp:156:36: error: 'using SE3f = class Sophus::SE3<float>' {aka 'class Sophus::SE3<float>'} has no member named 'empty'
  156 |                      if(!mVelocity.empty())
      |                                    ^~~~~
/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp:178:36: error: 'using SE3f = class Sophus::SE3<float>' {aka 'class Sophus::SE3<float>'} has no member named 'empty'
  178 |                      if(!mVelocity.empty())
      |                                    ^~~~~
/root/rtabmap/corelib/src/odometry/OdometryORBSLAM.cpp:183:48: error: 'Sophus::SE3<float> ORB_SLAM3::Frame::mTcw' is private within this context
  183 |                          TcwMM = mCurrentFrame.mTcw.clone();
      |                                                ^~~~

and some more. I can add the whole log if it helps. But one of the issues as I see it is that the constructor in ORB_SLAM3/include/Tracking.h, line 61:

Tracking(System* pSys, ORBVocabulary* pVoc, FrameDrawer* pFrameDrawer, MapDrawer* pMapDrawer, Atlas* pAtlas,
             KeyFrameDatabase* pKFDB, const string &strSettingPath, const int sensor, Settings* settings, const string &_nameSeq=std::string());

has the additional Settings* settings argument which is not taken care of by the call in OdometryORBSLAM.cpp, line 60:

Tracking(pSys, pVoc, pFrameDrawer, pMapDrawer, pMap, pKFDB, strSettingPath, sensor)

Any advice on how I could resolve this?

Srijal97 commented 2 years ago

Accidentally closed the issue, sorry!

To bypass this error, I am using ORB-SLAM3 v0.4-beta for now, and it builds and works just fine. Support for ORB-SLAM3 v1.0-release needs to be implemented.

matlabbe commented 2 years ago

Stick to https://github.com/UZ-SLAMLab/ORB_SLAM3/releases/tag/v0.4-beta with this patch https://gist.github.com/matlabbe/f5cb281304a1305b2824a6ce19792e13 for now. They did a lot of API breaking changes between v0.4 and v1.0. Would need to take 1 day or two to make it work with v1.0.

PonyPC commented 1 year ago

Is there any update about ORB-SLAM3 v1.0 integrating with rtabmap in IMU_RGBD mode?

ericlai0323 commented 1 year ago

@matlabbe Hello, I'd like to ask if there have been any updates regarding the integration of IMU and RGBD in ORB-SLAM3 with RTAB-Map. Thank you very much!

matlabbe commented 1 year ago

I created a pull request here till I have more time to debug. There are some issues when enabling IMU... that seems more related to ORB_SLAM3.

matlabbe commented 1 year ago

I merged this pull request https://github.com/introlab/rtabmap/pull/1152, see pull request description for current issues with ORB-SLAM3 integration. At least for VO (Stereo/RGB-D) mode should work out-of-the-box. For VIO, the crashes seem more related to the ORB-SLAM3 library itself (see comments here).