Re: Orbslam2 with rtabmap in ubuntu 20 and ros noetic

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Orbslam2-with-rtabmap-in-ubuntu-20-and-ros-noetic-tp9034p9060.html

Hi,

Why not ORB_SLAM3? At least version v0.4 is working with ubuntu 20.04 (v1 requires opencv 4.4).
git clone -b v0.4-beta https://github.com/UZ-SLAMLab/ORB_SLAM3.git
cd ORB_SLAM3
wget https://gist.githubusercontent.com/matlabbe/f5cb281304a1305b2824a6ce19792e13/raw/f8bbc796edc29b9f815cbf3c99a0c3e13e23663d/orbslam3_v4_rtabmap_fix.patch
git apply orbslam3_v4_rtabmap_fix.patch
./build.sh

For ORB_SLAM2, I fixed an error in this commit. However, I tried this more recent pull request for opencv4:
git clone https://github.com/raulmur/ORB_SLAM2.git
cd ORB_SLAM2
git fetch origin pull/970/head:noetic-devel
git checkout noetic-devel
wget https://gist.githubusercontent.com/matlabbe/c10403c5d44af85cc3585c0e1c601a60/raw/48adf04098960d86ddf225f1a8c68af87bfcf56e/orbslam2_f2e6f51_marchnative_disabled.patch
git apply orbslam2_f2e6f51_marchnative_disabled.patch
./build.sh

Note that if you switch between ORB_SLAM2 and ORB_SLAM3, remove CMakeCache.txt of rtabma/build dir or edit it to replace the old paths from ORB_SLAM2 to ORB_SLAM3 or vice-versa.

I just tested both with a Kinect Azure. Note however that with ORB_SLAM3, the VIO is not implemented on rtabmap side, only VO like ORB_SLAM2.

cheers,
Mathieu