Rosanswers logo

OS: Ubuntu 20.04 CUDA 11.6, CuDNN 8.4 (GPU is Nvidia Quadro T 1000) OpenCV 4.5.5 with GPU support also for CUDA and also the opencv_contribs

currently using Rtabmap standalone, but I intend to use the same properties under rtabmap_ros: selecting Preferences-->Advanced-->Features there would be at least for some of the algorithms the possibility to select "GPU-Version". Unfortunately this is greyed out.

Following this tutorial https://github.com/introlab/rtabmap/wiki/Installation#rtab-map-desktop-ubuntu-1804-2004 I tried to get the feature to work with a dockerfile but still, the GPU option is not available for selection.

Until now I installed rtabmap using the debian package. I suspected, that there might be some issue about the OpenCV version so I tried to build rtabmap from source. Here now I wasn't able to "colcon build" the package because it appears that some functions in rtabmap use cv:aruco::drawAxis which was present in OpenCV 3.x but is so no longer in OpenCV 4.x. Therefore I assume that by installing from debian another version of OpenCV is invoked (other than my manually built 4.5) but that it is not linked to my GPU/CUDA installation.

Now -- how can this issue be solved?

  • Is there a different git for rtabmap with GPU support (I used branch foxy-devel)?
  • Shoud I do a clean install with CUDA 10.x, OpenCV3 and try a new build of rtabmap?
  • Am I completely missing out on some other issue, that might block the GPU-Features on my system? (Standard programs using OpenCL or T-API are working just fine on the recent setup, so the problem seems to me to be centered around rtabmap itself, not the availability of GPU for computational purposes ...)

Any helpful suggestion will be greatly appreciated.

Originally posted by TurBot on ROS Answers with karma: 5 on 2022-05-09

Post score: 0


1 Answer 1


Rosanswers logo

The drawAxis error for Opencv 4.5.5 has been fixed here: https://github.com/introlab/rtabmap/commit/cf64b20e1fd5b7aca6f5f708e9b790aa41e799db

OpenCV should be built WITH_CUDA=ON, then rtabmap should be built against that OpenCV version, not the one installed by binaries. It should be easier to remove opencv binaries and rebuild all ros packages depending on it (like cv_bridge). Build/install your OpenCV/CUDA version in /usr/local, rtabmap and rtabmap_ros should then find it automatically and build with it.

Originally posted by matlabbe with karma: 6409 on 2022-05-11

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by TurBot on 2022-05-11:
Splendid! This does the job. I wasn't sure how to replace this drawAxis part, so thanks a heap for fixing it!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.