Ask Your Question

How to enable GPU-Features of Rtabmap

asked 2022-05-09 02:30:15 -0500

TurBot gravatar image

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 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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-05-11 07:40:44 -0500

matlabbe gravatar image

The drawAxis error for Opencv 4.5.5 has been fixed here:

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.

edit flag offensive delete link more


Splendid! This does the job. I wasn't sure how to replace this drawAxis part, so thanks a heap for fixing it!

TurBot gravatar image TurBot  ( 2022-05-11 10:06:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-05-09 02:30:15 -0500

Seen: 90 times

Last updated: May 11